SmartSnippets DA1459x SDK
Files | Data Structures | Typedefs | Enumerations | Functions
Embedded Flash Controller

Embedded Flash Controller. More...

Files

file  hw_fcu.h
 Definition of API for the FCU Low Level Driver.
 

Data Structures

struct  hw_fcu_operation_params_t
 Operation parameters structure. More...
 

Typedefs

typedef void(* hw_fcu_operation_completed_cb) (void *user_data)
 Callback called upon completion of erase or write (interrupt or DMA) More...
 

Enumerations

enum  HW_FCU_ERROR
 FCU error codes.
 
enum  HW_FCU_ERASE_SUSPEND_MODE { HW_FCU_ERASE_SUSPEND_MODE_PREEMPTIVE, HW_FCU_ERASE_SUSPEND_MODE_NONPREEMPTIVE }
 FCU erase/suspend modes. More...
 
enum  HW_FCU_FLASH_ACCESS_MODE { HW_FCU_FLASH_ACCESS_MODE_READ, HW_FCU_FLASH_ACCESS_MODE_WRITE_ERASE }
 FCU flash read/write/erase mode. More...
 
enum  HW_FCU_FLASH_PROG_MODE { HW_FCU_FLASH_PROG_MODE_READ, HW_FCU_FLASH_PROG_MODE_WRITE_PAGE, HW_FCU_FLASH_PROG_MODE_ERASE_PAGE, HW_FCU_FLASH_PROG_MODE_ERASE_BLOCK }
 FCU program flash mode. More...
 
enum  HW_FCU_WAIT_CYCLES
 FCU wait cycles.
 
enum  HW_FCU_VDD_LEVEL_VALUE { HW_FCU_VDD_LESS_THAN_1V08, HW_FCU_VDD_GREATER_THAN_1V08 }
 FCU VDD level value. More...
 

Functions

__STATIC_FORCEINLINE void hw_fcu_set_vdd_level_value (HW_FCU_VDD_LEVEL_VALUE value)
 Set VDD level value. More...
 
__STATIC_FORCEINLINE HW_FCU_VDD_LEVEL_VALUE hw_fcu_get_vdd_level_value (void)
 Get VDD level value. More...
 
__STATIC_FORCEINLINE void hw_fcu_enable_vdd_level_overriding (void)
 Enable overriding of VDD level FCU input signal.
 
__STATIC_FORCEINLINE void hw_fcu_disable_vdd_level_overriding (void)
 Disable overriding of VDD level FCU input signal.
 
__STATIC_FORCEINLINE void hw_fcu_prohibit_flash_operations (void)
 Prohibit flash operations.
 
__STATIC_FORCEINLINE void hw_fcu_permit_flash_operations (void)
 Permit flash operations.
 
__STATIC_FORCEINLINE bool hw_fcu_are_flash_operations_prohibited (void)
 Check if flash operations are prohibited. More...
 
__STATIC_FORCEINLINE bool hw_fcu_is_flash_erase_suspended (void)
 Check if flash erase is suspended. More...
 
__STATIC_FORCEINLINE void hw_fcu_set_erase_suspend_mode (HW_FCU_ERASE_SUSPEND_MODE mode)
 Set erase/suspend mode. More...
 
__STATIC_FORCEINLINE HW_FCU_ERASE_SUSPEND_MODE hw_fcu_get_erase_suspend_mode (void)
 Get erase/suspend mode. More...
 
__STATIC_FORCEINLINE void hw_fcu_enable_erase_suspend (void)
 Enable erase/suspend functionality. More...
 
__STATIC_FORCEINLINE void hw_fcu_disable_erase_suspend (void)
 Disable erase/suspend functionality.
 
__STATIC_FORCEINLINE bool hw_fcu_is_erase_suspend_enabled (void)
 Check if erase/suspend functionality is enabled. More...
 
__STATIC_FORCEINLINE bool hw_fcu_is_asleep (void)
 Check if fcu is in sleeping mode. More...
 
__STATIC_FORCEINLINE void hw_fcu_enable_dma (void)
 Enable DMA handshake when writing to the FCU. More...
 
__STATIC_FORCEINLINE void hw_fcu_disable_dma (void)
 Disable DMA handshake when writing to the FCU. More...
 
__STATIC_FORCEINLINE bool hw_fcu_is_dma_enabled (void)
 Check if DMA handshake when writing to the FCU is enabled. More...
 
__STATIC_FORCEINLINE void hw_fcu_enable_bus_error (void)
 Enable bus error response. More...
 
__STATIC_FORCEINLINE bool hw_fcu_is_bus_error_enabled (void)
 Check if bus error response is enabled. More...
 
__STATIC_FORCEINLINE bool hw_fcu_get_bus_error_status (void)
 Get bus error status. More...
 
__STATIC_FORCEINLINE void hw_fcu_clear_interrupt (void)
 Clear FCU interrupt.
 
__STATIC_FORCEINLINE HW_FCU_WAIT_CYCLES hw_fcu_get_wait_cycles (void)
 Get wait cycles. More...
 
__STATIC_FORCEINLINE void hw_fcu_set_wait_cycles (HW_FCU_WAIT_CYCLES wait_cycles)
 Set wait cycles. More...
 
__STATIC_FORCEINLINE bool hw_fcu_is_protected_against_actions (uint32_t mask)
 
__STATIC_FORCEINLINE void hw_fcu_enable_flash_read_protection (void)
 Enable program flash read protection. More...
 
__STATIC_FORCEINLINE bool hw_fcu_is_flash_read_protection_enabled (void)
 Check program flash read protection. More...
 
__STATIC_FORCEINLINE void hw_fcu_enable_flash_write_protection (void)
 Enable program flash write protection. More...
 
__STATIC_FORCEINLINE bool hw_fcu_is_flash_write_protection_enabled (void)
 Check program flash write protection. More...
 
__STATIC_FORCEINLINE bool hw_fcu_is_flash_read_mode_inhibited (void)
 Check if program flash read mode is inhibited. More...
 
__STATIC_FORCEINLINE bool hw_fcu_is_erase_in_progress (void)
 Check if flash erase is in progress. More...
 
__STATIC_FORCEINLINE void hw_fcu_resume_erase (void)
 Resume erase. More...
 
__STATIC_FORCEINLINE bool hw_fcu_is_write_in_progress (void)
 Check if flash write is in progress. More...
 
__STATIC_FORCEINLINE void hw_fcu_set_flash_access_mode (HW_FCU_FLASH_ACCESS_MODE mode)
 Set flash read or write/erase mode. More...
 
__STATIC_FORCEINLINE HW_FCU_FLASH_ACCESS_MODE hw_fcu_get_flash_access_mode (void)
 Get flash read/write/erase mode. More...
 
__STATIC_FORCEINLINE void hw_fcu_set_flash_programming_mode (HW_FCU_FLASH_PROG_MODE mode)
 Set program flash mode. More...
 
__STATIC_FORCEINLINE HW_FCU_FLASH_PROG_MODE hw_fcu_get_flash_programming_mode (void)
 Get program flash mode. More...
 
__STATIC_FORCEINLINE void hw_fcu_set_sleep_mode (void)
 Puts FCU (eFlash) in sleep mode for lower leakage current. More...
 
__STATIC_FORCEINLINE void hw_fcu_set_flash_hold_time (uint16_t hold_time)
 Set program flash NVSTR1 hold time. More...
 
__STATIC_FORCEINLINE uint16_t hw_fcu_get_flash_hold_time (void)
 Get program flash NVSTR1 hold time. More...
 
__STATIC_FORCEINLINE void hw_fcu_set_flash_program_time (uint16_t prog_time)
 Set program flash programming time. More...
 
__STATIC_FORCEINLINE uint16_t hw_fcu_get_flash_program_time (void)
 Get program flash programming time. More...
 
__STATIC_FORCEINLINE void hw_fcu_set_flash_page_erase_time (uint32_t erase_time)
 Set program flash page erase time. More...
 
__STATIC_FORCEINLINE uint32_t hw_fcu_get_flash_page_erase_time (void)
 Get program flash page erase time. More...
 
__STATIC_FORCEINLINE void hw_fcu_set_flash_mass_erase_time (uint32_t erase_time)
 Set program flash mass erase time. More...
 
__STATIC_FORCEINLINE uint32_t hw_fcu_get_flash_mass_erase_time (void)
 Get program flash mass erase time. More...
 
__STATIC_FORCEINLINE void hw_fcu_set_flash_sleep_to_standby_time (uint8_t wakeup_time)
 Set program flash sleep to standby wake-up time. More...
 
__STATIC_FORCEINLINE uint8_t hw_fcu_get_flash_sleep_to_standby_time (void)
 Get program flash sleep to standby wake-up time. More...
 
__STATIC_FORCEINLINE void hw_fcu_set_flash_page_segment_erase_time (uint32_t erase_time)
 Set program flash page segment erase time for suspend erase. More...
 
__STATIC_FORCEINLINE uint32_t hw_fcu_get_flash_page_segment_erase_time (void)
 Get program flash page segment erase time for suspend erase. More...
 
__STATIC_FORCEINLINE uint32_t hw_fcu_get_total_erase_counter (void)
 Get total erase time counter value. More...
 
__STATIC_FORCEINLINE uint32_t hw_fcu_get_segment_erase_counter (void)
 Get segment erase time counter value. More...
 
__STATIC_FORCEINLINE void hw_fcu_enable_reset_delay (void)
 Enables reset delay when FCU write/erase begins.
 
__STATIC_FORCEINLINE void hw_fcu_disable_reset_delay (void)
 Disables reset delay when FCU write/erase has finished.
 
__ALWAYS_RETAINED_CODE void hw_fcu_wakeup (void)
 Wakeup FCU.
 
__ALWAYS_RETAINED_CODE void hw_fcu_sleep (void)
 Set FCU to sleep mode.
 
__ALWAYS_RETAINED_CODE void hw_fcu_enable_erase (HW_FCU_FLASH_PROG_MODE mode)
 Put FCU in erase mode. More...
 
__ALWAYS_RETAINED_CODE HW_FCU_ERROR hw_fcu_erase_page (uint32_t address, struct hw_fcu_operation_params_t *params)
 Erase flash block's page. More...
 
__ALWAYS_RETAINED_CODE HW_FCU_ERROR hw_fcu_configure_erase_page_suspend (HW_FCU_ERASE_SUSPEND_MODE mode, uint32_t page_erase_time, uint32_t segment_erase_time)
 Configure page erase suspend/resume. More...
 
__ALWAYS_RETAINED_CODE HW_FCU_ERROR hw_fcu_erase_block (uint32_t address, struct hw_fcu_operation_params_t *params)
 Erase flash block. More...
 
__ALWAYS_RETAINED_CODE void hw_fcu_enable_write (void)
 Put FCU in write mode.
 
__ALWAYS_RETAINED_CODE HW_FCU_ERROR hw_fcu_write (uint32_t *src, uint32_t address, uint32_t len, struct hw_fcu_operation_params_t *params)
 Write a buffer to flash address (first flash page should be erased) More...
 
__ALWAYS_RETAINED_CODE void hw_fcu_enable_read (void)
 Put FCU in read mode.
 
__ALWAYS_RETAINED_CODE HW_FCU_ERROR hw_fcu_read (uint32_t address, uint32_t *dst, uint32_t len, struct hw_fcu_operation_params_t *params)
 Read from flash address to buffer. More...
 
__ALWAYS_RETAINED_CODE bool hw_fcu_is_available (void)
 Check if FCU is not busy or in sleeping mode. More...
 

Detailed Description

Embedded Flash Controller.

Typedef Documentation

◆ hw_fcu_operation_completed_cb

typedef void(* hw_fcu_operation_completed_cb) (void *user_data)

Callback called upon completion of erase or write (interrupt or DMA)

Parameters
[in]user_datapointer to user data

Enumeration Type Documentation

◆ HW_FCU_ERASE_SUSPEND_MODE

FCU erase/suspend modes.

Enumerator
HW_FCU_ERASE_SUSPEND_MODE_PREEMPTIVE 

When a read operation is issued, erase is immediately suspended and erase segment time is not subtracted from total erase time

HW_FCU_ERASE_SUSPEND_MODE_NONPREEMPTIVE 

When a read operation is issued, FCU stall the read access until the erase segment is completed

◆ HW_FCU_FLASH_ACCESS_MODE

FCU flash read/write/erase mode.

Enumerator
HW_FCU_FLASH_ACCESS_MODE_READ 

Read mode selected

HW_FCU_FLASH_ACCESS_MODE_WRITE_ERASE 

Erase/write mode selected

◆ HW_FCU_FLASH_PROG_MODE

FCU program flash mode.

Enumerator
HW_FCU_FLASH_PROG_MODE_READ 

No write or erase to flash possible

HW_FCU_FLASH_PROG_MODE_WRITE_PAGE 

Write page

HW_FCU_FLASH_PROG_MODE_ERASE_PAGE 

Erase page

HW_FCU_FLASH_PROG_MODE_ERASE_BLOCK 

Erase one of the flash blocks completely

◆ HW_FCU_VDD_LEVEL_VALUE

FCU VDD level value.

Enumerator
HW_FCU_VDD_LESS_THAN_1V08 

Should be used if VDD < 1.08 V.

HW_FCU_VDD_GREATER_THAN_1V08 

Should be used if VDD > 1.08 V.

Function Documentation

◆ hw_fcu_are_flash_operations_prohibited()

__STATIC_FORCEINLINE bool hw_fcu_are_flash_operations_prohibited ( void  )

Check if flash operations are prohibited.

Returns
true if flash operations are prohibited, else false

◆ hw_fcu_configure_erase_page_suspend()

__ALWAYS_RETAINED_CODE HW_FCU_ERROR hw_fcu_configure_erase_page_suspend ( HW_FCU_ERASE_SUSPEND_MODE  mode,
uint32_t  page_erase_time,
uint32_t  segment_erase_time 
)

Configure page erase suspend/resume.

Parameters
[in]modemode of erase suspend operation
[in]page_erase_timeflash page erase time in microseconds
[in]segment_erase_timeflash page segment erase time in microseconds
Returns
HW_FCU_ERROR_NONE on success, else error
See also
HW_FCU_ERROR

◆ hw_fcu_disable_dma()

__STATIC_FORCEINLINE void hw_fcu_disable_dma ( void  )

Disable DMA handshake when writing to the FCU.

Note
IRQ generation remains enabled.

◆ hw_fcu_enable_bus_error()

__STATIC_FORCEINLINE void hw_fcu_enable_bus_error ( void  )

Enable bus error response.

Note
This bit can only be set and is reset by hardware reset. The BUS_ERROR status flag isn't affected by setting this bit.

◆ hw_fcu_enable_dma()

__STATIC_FORCEINLINE void hw_fcu_enable_dma ( void  )

Enable DMA handshake when writing to the FCU.

Note
It also disables IRQ generation.

◆ hw_fcu_enable_erase()

__ALWAYS_RETAINED_CODE void hw_fcu_enable_erase ( HW_FCU_FLASH_PROG_MODE  mode)

Put FCU in erase mode.

Parameters
[in]modeflash page/block erase mode

◆ hw_fcu_enable_erase_suspend()

__STATIC_FORCEINLINE void hw_fcu_enable_erase_suspend ( void  )

Enable erase/suspend functionality.

Note
HW supports automatic suspend on page erase command, when a read access is occurred on different page

◆ hw_fcu_enable_flash_read_protection()

__STATIC_FORCEINLINE void hw_fcu_enable_flash_read_protection ( void  )

Enable program flash read protection.

Note
This bit can only be set and is reset by hardware reset.

◆ hw_fcu_enable_flash_write_protection()

__STATIC_FORCEINLINE void hw_fcu_enable_flash_write_protection ( void  )

Enable program flash write protection.

Note
This bit can only be set and is reset by hardware reset.

◆ hw_fcu_erase_block()

__ALWAYS_RETAINED_CODE HW_FCU_ERROR hw_fcu_erase_block ( uint32_t  address,
struct hw_fcu_operation_params_t params 
)

Erase flash block.

Note
If there is no user callback registered, erasing will be performed in blocking mode.
Parameters
[in]addressflash address.
[in]paramspointer to operation parameters structuree
Note
If eFLASH address parameter is between 0x0 and 0x40000, eFLASH space between 0x40000 and 0x40800 won't be erased. If address parameter is between 0x40000 and 0x40800, all eFLASH space (0x0 - 0x40800) will be erased.
Returns
HW_FCU_ERROR_NONE on success, else error
See also
HW_FCU_ERROR
hw_fcu_register_user_cb

◆ hw_fcu_erase_page()

__ALWAYS_RETAINED_CODE HW_FCU_ERROR hw_fcu_erase_page ( uint32_t  address,
struct hw_fcu_operation_params_t params 
)

Erase flash block's page.

Note
If there is no user callback registered, erasing will be performed in blocking mode.
Parameters
[in]addresspage address
[in]paramspointer to operation parameters structure
Returns
HW_FCU_ERROR_NONE on success, else error
See also
HW_FCU_ERROR
hw_fcu_register_user_cb

◆ hw_fcu_get_bus_error_status()

__STATIC_FORCEINLINE bool hw_fcu_get_bus_error_status ( void  )

Get bus error status.

Returns
true if bus error occurred in the last FCU AHB access, else false
Note
Register gets cleared on next FCU AHB access.

◆ hw_fcu_get_erase_suspend_mode()

__STATIC_FORCEINLINE HW_FCU_ERASE_SUSPEND_MODE hw_fcu_get_erase_suspend_mode ( void  )

Get erase/suspend mode.

Returns
erase/suspend mode
See also
HW_FCU_ERASE_SUSPEND_MODE

◆ hw_fcu_get_flash_access_mode()

__STATIC_FORCEINLINE HW_FCU_FLASH_ACCESS_MODE hw_fcu_get_flash_access_mode ( void  )

Get flash read/write/erase mode.

Returns
flash read/write/erase mode
See also
HW_FCU_FLASH_ACCESS_MODE

◆ hw_fcu_get_flash_hold_time()

__STATIC_FORCEINLINE uint16_t hw_fcu_get_flash_hold_time ( void  )

Get program flash NVSTR1 hold time.

Returns
program flash NVSTR1 hold time in microseconds

◆ hw_fcu_get_flash_mass_erase_time()

__STATIC_FORCEINLINE uint32_t hw_fcu_get_flash_mass_erase_time ( void  )

Get program flash mass erase time.

Returns
program flash mass erase time in microseconds

◆ hw_fcu_get_flash_page_erase_time()

__STATIC_FORCEINLINE uint32_t hw_fcu_get_flash_page_erase_time ( void  )

Get program flash page erase time.

Returns
program flash page erase time in microseconds

◆ hw_fcu_get_flash_page_segment_erase_time()

__STATIC_FORCEINLINE uint32_t hw_fcu_get_flash_page_segment_erase_time ( void  )

Get program flash page segment erase time for suspend erase.

Returns
program flash page segment erase time for suspend erase in microseconds

◆ hw_fcu_get_flash_program_time()

__STATIC_FORCEINLINE uint16_t hw_fcu_get_flash_program_time ( void  )

Get program flash programming time.

Returns
program flash programming time in microseconds

◆ hw_fcu_get_flash_programming_mode()

__STATIC_FORCEINLINE HW_FCU_FLASH_PROG_MODE hw_fcu_get_flash_programming_mode ( void  )

Get program flash mode.

Returns
program flash mode
See also
HW_FCU_FLASH_MODE

◆ hw_fcu_get_flash_sleep_to_standby_time()

__STATIC_FORCEINLINE uint8_t hw_fcu_get_flash_sleep_to_standby_time ( void  )

Get program flash sleep to standby wake-up time.

Returns
program flash sleep to standby wake-up time in microseconds

◆ hw_fcu_get_segment_erase_counter()

__STATIC_FORCEINLINE uint32_t hw_fcu_get_segment_erase_counter ( void  )

Get segment erase time counter value.

Returns
segment erase time counter value in microseconds

◆ hw_fcu_get_total_erase_counter()

__STATIC_FORCEINLINE uint32_t hw_fcu_get_total_erase_counter ( void  )

Get total erase time counter value.

Returns
total erase time counter value in microseconds

◆ hw_fcu_get_vdd_level_value()

__STATIC_FORCEINLINE HW_FCU_VDD_LEVEL_VALUE hw_fcu_get_vdd_level_value ( void  )

Get VDD level value.

Note
If VDD_LEVEL_FORCE is set to 0, VDD level value has no effect.
Returns
VDD level value
See also
HW_FCU_VDD_LEVEL_VALUE
hw_fcu_enable_vdd_level_overriding

◆ hw_fcu_get_wait_cycles()

__STATIC_FORCEINLINE HW_FCU_WAIT_CYCLES hw_fcu_get_wait_cycles ( void  )

Get wait cycles.

Returns
wait cycles
See also
HW_FCU_WAIT_CYCLES

◆ hw_fcu_is_asleep()

__STATIC_FORCEINLINE bool hw_fcu_is_asleep ( void  )

Check if fcu is in sleeping mode.

Returns
true if FCU is in sleeping mode, else false (FCU is in standby mode)

◆ hw_fcu_is_available()

__ALWAYS_RETAINED_CODE bool hw_fcu_is_available ( void  )

Check if FCU is not busy or in sleeping mode.

Returns
true if FCU is available, else false

◆ hw_fcu_is_bus_error_enabled()

__STATIC_FORCEINLINE bool hw_fcu_is_bus_error_enabled ( void  )

Check if bus error response is enabled.

Returns
true if bus error response is enabled, else false

◆ hw_fcu_is_dma_enabled()

__STATIC_FORCEINLINE bool hw_fcu_is_dma_enabled ( void  )

Check if DMA handshake when writing to the FCU is enabled.

Returns
true if DMA handshake when writing to the FCU is enabled, else false

◆ hw_fcu_is_erase_in_progress()

__STATIC_FORCEINLINE bool hw_fcu_is_erase_in_progress ( void  )

Check if flash erase is in progress.

Returns
true if erase cycle in progress, else false

◆ hw_fcu_is_erase_suspend_enabled()

__STATIC_FORCEINLINE bool hw_fcu_is_erase_suspend_enabled ( void  )

Check if erase/suspend functionality is enabled.

Returns
true if erase/suspend functionality is enabled, else false

◆ hw_fcu_is_flash_erase_suspended()

__STATIC_FORCEINLINE bool hw_fcu_is_flash_erase_suspended ( void  )

Check if flash erase is suspended.

Note
If flash erase suspend is true, check FLASH_PTERASE_REG for the remaining time needed for the erase to complete. If flash erase suspend is false, check PROG_ERS status bit if an erase is in progress.
Returns
true if flash erase is suspended, else false

◆ hw_fcu_is_flash_read_mode_inhibited()

__STATIC_FORCEINLINE bool hw_fcu_is_flash_read_mode_inhibited ( void  )

Check if program flash read mode is inhibited.

Returns
true if program flash read mode is inhibited, else false

◆ hw_fcu_is_flash_read_protection_enabled()

__STATIC_FORCEINLINE bool hw_fcu_is_flash_read_protection_enabled ( void  )

Check program flash read protection.

Returns
true if the program flash cannot be read, else false

◆ hw_fcu_is_flash_write_protection_enabled()

__STATIC_FORCEINLINE bool hw_fcu_is_flash_write_protection_enabled ( void  )

Check program flash write protection.

Returns
true if the program flash cannot be written, else false

◆ hw_fcu_is_protected_against_actions()

__STATIC_FORCEINLINE bool hw_fcu_is_protected_against_actions ( uint32_t  mask)

Check if FCU is protected against specific actions

Use the input argument mask by OR-ing one or more of the following arguments to check whether specific FCU protections are enabled.

Parameters
[in]maskMask of the actions to check

return True, if any protection is enabled, otherwise false.

◆ hw_fcu_is_write_in_progress()

__STATIC_FORCEINLINE bool hw_fcu_is_write_in_progress ( void  )

Check if flash write is in progress.

Returns
true if write cycle in progress, else false

◆ hw_fcu_read()

__ALWAYS_RETAINED_CODE HW_FCU_ERROR hw_fcu_read ( uint32_t  address,
uint32_t *  dst,
uint32_t  len,
struct hw_fcu_operation_params_t params 
)

Read from flash address to buffer.

Note
If there is no user callback registered or a valid DMA channel, reading will be performed in blocking mode.
If FCU is in erase suspend state, then the state is reset, see
See also
hw_fcu_enable_read.
Parameters
[in]addressflash address
[in]dstbuffer to store data (avoid casting uint8_t* or uint16_t* to uint32_t*)
[in]lenbuffer size in 32bit words
[in]paramspointer to operation parameters structure
Returns
HW_FCU_ERROR_NONE on success, else error
See also
HW_FCU_ERROR
hw_fcu_register_user_cb

◆ hw_fcu_resume_erase()

__STATIC_FORCEINLINE void hw_fcu_resume_erase ( void  )

Resume erase.

Note
It should be called when ERASE_SUSPEND_EN == 1 and ERASE_SUSPEND_STAT == 1 to resume erasing.

◆ hw_fcu_set_erase_suspend_mode()

__STATIC_FORCEINLINE void hw_fcu_set_erase_suspend_mode ( HW_FCU_ERASE_SUSPEND_MODE  mode)

Set erase/suspend mode.

Parameters
[in]modeerase/suspend mode
See also
HW_FCU_ERASE_SUSPEND_MODE

◆ hw_fcu_set_flash_access_mode()

__STATIC_FORCEINLINE void hw_fcu_set_flash_access_mode ( HW_FCU_FLASH_ACCESS_MODE  mode)

Set flash read or write/erase mode.

Parameters
[in]modeflash read/write/erase mode
See also
HW_FCU_FLASH_ACCESS_MODE

◆ hw_fcu_set_flash_hold_time()

__STATIC_FORCEINLINE void hw_fcu_set_flash_hold_time ( uint16_t  hold_time)

Set program flash NVSTR1 hold time.

Parameters
[in]hold_timehold time in microseconds. T = PTNVH1 x 1 us

◆ hw_fcu_set_flash_mass_erase_time()

__STATIC_FORCEINLINE void hw_fcu_set_flash_mass_erase_time ( uint32_t  erase_time)

Set program flash mass erase time.

Parameters
[in]erase_timemass erase time in microseconds. T= PTME x 1 us

◆ hw_fcu_set_flash_page_erase_time()

__STATIC_FORCEINLINE void hw_fcu_set_flash_page_erase_time ( uint32_t  erase_time)

Set program flash page erase time.

Parameters
[in]erase_timepage erase time in microseconds. T= PTERASE x 1 us

◆ hw_fcu_set_flash_page_segment_erase_time()

__STATIC_FORCEINLINE void hw_fcu_set_flash_page_segment_erase_time ( uint32_t  erase_time)

Set program flash page segment erase time for suspend erase.

Parameters
[in]erase_timepage segment erase time for suspend erase in microseconds.

◆ hw_fcu_set_flash_program_time()

__STATIC_FORCEINLINE void hw_fcu_set_flash_program_time ( uint16_t  prog_time)

Set program flash programming time.

Parameters
[in]prog_timeprogramming time in microseconds. T = PTPROG x 1 us

◆ hw_fcu_set_flash_programming_mode()

__STATIC_FORCEINLINE void hw_fcu_set_flash_programming_mode ( HW_FCU_FLASH_PROG_MODE  mode)

Set program flash mode.

Parameters
[in]modeprogram flash mode
See also
HW_FCU_FLASH_MODE

◆ hw_fcu_set_flash_sleep_to_standby_time()

__STATIC_FORCEINLINE void hw_fcu_set_flash_sleep_to_standby_time ( uint8_t  wakeup_time)

Set program flash sleep to standby wake-up time.

Parameters
[in]wakeup_timesleep to standby wake-up time in microseconds. T = PTWK_SP x 1us

◆ hw_fcu_set_sleep_mode()

__STATIC_FORCEINLINE void hw_fcu_set_sleep_mode ( void  )

Puts FCU (eFlash) in sleep mode for lower leakage current.

Note
Automatically wakes up on read access.

◆ hw_fcu_set_vdd_level_value()

__STATIC_FORCEINLINE void hw_fcu_set_vdd_level_value ( HW_FCU_VDD_LEVEL_VALUE  value)

Set VDD level value.

Note
If VDD_LEVEL_FORCE is set to 0, VDD level value has no effect.
Parameters
[in]valueVDD level value
See also
HW_FCU_VDD_LEVEL_VALUE
hw_fcu_enable_vdd_level_overriding

◆ hw_fcu_set_wait_cycles()

__STATIC_FORCEINLINE void hw_fcu_set_wait_cycles ( HW_FCU_WAIT_CYCLES  wait_cycles)

Set wait cycles.

Note
Use cases: HCLK = 64 MHz, VDD = 0.9V -> 4 wait cycles HCLK = 64 MHz, VDD = 1.2V -> 1 wait cycles HCLK = 32 MHz, VDD = 0.9V -> 2 wait cycles (default conditions on power up) HCLK = 32 MHz, VDD = 1.2V -> 0 wait cycles HCLK = 16 MHz, VDD = 0.9V -> 1 wait cycles HCLK = 16 MHz, VDD = 1.2V -> 0 wait cycles HCLK = slower than above -> 0 wait cycles
Parameters
[in]wait_cycles(allowed values 0...7)
See also
HW_FCU_WAIT_CYCLES

◆ hw_fcu_write()

__ALWAYS_RETAINED_CODE HW_FCU_ERROR hw_fcu_write ( uint32_t *  src,
uint32_t  address,
uint32_t  len,
struct hw_fcu_operation_params_t params 
)

Write a buffer to flash address (first flash page should be erased)

Note
If there is no user callback registered, writing will be performed in blocking mode.
Parameters
[in]srcbuffer to be written (avoid casting uint8_t* or uint16_t* to uint32_t*)
[in]addressflash address
[in]lenbuffer size in 32bit words
[in]paramspointer to operation parameters structure
Returns
HW_FCU_ERROR_NONE on success, else error
See also
HW_FCU_ERROR
hw_fcu_register_user_cb