|
SmartSnippets DA1459x SDK
|
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... | |
Embedded Flash Controller.
| typedef void(* hw_fcu_operation_completed_cb) (void *user_data) |
Callback called upon completion of erase or write (interrupt or DMA)
| [in] | user_data | pointer to user data |
FCU erase/suspend modes.
| __STATIC_FORCEINLINE bool hw_fcu_are_flash_operations_prohibited | ( | void | ) |
Check if flash operations are prohibited.
| __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.
| [in] | mode | mode of erase suspend operation |
| [in] | page_erase_time | flash page erase time in microseconds |
| [in] | segment_erase_time | flash page segment erase time in microseconds |
| __STATIC_FORCEINLINE void hw_fcu_disable_dma | ( | void | ) |
Disable DMA handshake when writing to the FCU.
| __STATIC_FORCEINLINE void hw_fcu_enable_bus_error | ( | void | ) |
Enable bus error response.
| __STATIC_FORCEINLINE void hw_fcu_enable_dma | ( | void | ) |
Enable DMA handshake when writing to the FCU.
| __ALWAYS_RETAINED_CODE void hw_fcu_enable_erase | ( | HW_FCU_FLASH_PROG_MODE | mode | ) |
Put FCU in erase mode.
| [in] | mode | flash page/block erase mode |
| __STATIC_FORCEINLINE void hw_fcu_enable_erase_suspend | ( | void | ) |
Enable erase/suspend functionality.
| __STATIC_FORCEINLINE void hw_fcu_enable_flash_read_protection | ( | void | ) |
Enable program flash read protection.
| __STATIC_FORCEINLINE void hw_fcu_enable_flash_write_protection | ( | void | ) |
Enable program flash write protection.
| __ALWAYS_RETAINED_CODE HW_FCU_ERROR hw_fcu_erase_block | ( | uint32_t | address, |
| struct hw_fcu_operation_params_t * | params | ||
| ) |
Erase flash block.
| [in] | address | flash address. |
| [in] | params | pointer to operation parameters structuree |
| __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.
| [in] | address | page address |
| [in] | params | pointer to operation parameters structure |
| __STATIC_FORCEINLINE bool hw_fcu_get_bus_error_status | ( | void | ) |
Get bus error status.
| __STATIC_FORCEINLINE HW_FCU_ERASE_SUSPEND_MODE hw_fcu_get_erase_suspend_mode | ( | void | ) |
| __STATIC_FORCEINLINE HW_FCU_FLASH_ACCESS_MODE hw_fcu_get_flash_access_mode | ( | void | ) |
Get flash read/write/erase mode.
| __STATIC_FORCEINLINE uint16_t hw_fcu_get_flash_hold_time | ( | void | ) |
Get program flash NVSTR1 hold time.
| __STATIC_FORCEINLINE uint32_t hw_fcu_get_flash_mass_erase_time | ( | void | ) |
Get program flash mass erase time.
| __STATIC_FORCEINLINE uint32_t hw_fcu_get_flash_page_erase_time | ( | void | ) |
Get program flash page 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.
| __STATIC_FORCEINLINE uint16_t hw_fcu_get_flash_program_time | ( | void | ) |
Get program flash programming time.
| __STATIC_FORCEINLINE HW_FCU_FLASH_PROG_MODE hw_fcu_get_flash_programming_mode | ( | void | ) |
Get program flash mode.
| __STATIC_FORCEINLINE uint8_t hw_fcu_get_flash_sleep_to_standby_time | ( | void | ) |
Get program flash sleep to standby wake-up time.
| __STATIC_FORCEINLINE uint32_t hw_fcu_get_segment_erase_counter | ( | void | ) |
Get segment erase time counter value.
| __STATIC_FORCEINLINE uint32_t hw_fcu_get_total_erase_counter | ( | void | ) |
Get total erase time counter value.
| __STATIC_FORCEINLINE HW_FCU_VDD_LEVEL_VALUE hw_fcu_get_vdd_level_value | ( | void | ) |
Get VDD level value.
| __STATIC_FORCEINLINE HW_FCU_WAIT_CYCLES hw_fcu_get_wait_cycles | ( | void | ) |
| __STATIC_FORCEINLINE bool hw_fcu_is_asleep | ( | void | ) |
Check if fcu is in sleeping mode.
| __ALWAYS_RETAINED_CODE bool hw_fcu_is_available | ( | void | ) |
Check if FCU is not busy or in sleeping mode.
| __STATIC_FORCEINLINE bool hw_fcu_is_bus_error_enabled | ( | void | ) |
Check if bus error response is enabled.
| __STATIC_FORCEINLINE bool hw_fcu_is_dma_enabled | ( | void | ) |
Check if DMA handshake when writing to the FCU is enabled.
| __STATIC_FORCEINLINE bool hw_fcu_is_erase_in_progress | ( | void | ) |
Check if flash erase is in progress.
| __STATIC_FORCEINLINE bool hw_fcu_is_erase_suspend_enabled | ( | void | ) |
Check if erase/suspend functionality is enabled.
| __STATIC_FORCEINLINE bool hw_fcu_is_flash_erase_suspended | ( | void | ) |
Check if flash erase is suspended.
| __STATIC_FORCEINLINE bool hw_fcu_is_flash_read_mode_inhibited | ( | void | ) |
Check if program flash read mode is inhibited.
| __STATIC_FORCEINLINE bool hw_fcu_is_flash_read_protection_enabled | ( | void | ) |
Check program flash read protection.
| __STATIC_FORCEINLINE bool hw_fcu_is_flash_write_protection_enabled | ( | void | ) |
Check program flash write protection.
| __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.
| [in] | mask | Mask of the actions to check |
return True, if any protection is enabled, otherwise false.
| __STATIC_FORCEINLINE bool hw_fcu_is_write_in_progress | ( | void | ) |
Check if flash write is in progress.
| __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.
| [in] | address | flash address |
| [in] | dst | buffer to store data (avoid casting uint8_t* or uint16_t* to uint32_t*) |
| [in] | len | buffer size in 32bit words |
| [in] | params | pointer to operation parameters structure |
| __STATIC_FORCEINLINE void hw_fcu_resume_erase | ( | void | ) |
Resume erase.
| __STATIC_FORCEINLINE void hw_fcu_set_erase_suspend_mode | ( | HW_FCU_ERASE_SUSPEND_MODE | mode | ) |
| __STATIC_FORCEINLINE void hw_fcu_set_flash_access_mode | ( | HW_FCU_FLASH_ACCESS_MODE | mode | ) |
Set flash read or write/erase mode.
| [in] | mode | flash read/write/erase mode |
| __STATIC_FORCEINLINE void hw_fcu_set_flash_hold_time | ( | uint16_t | hold_time | ) |
Set program flash NVSTR1 hold time.
| [in] | hold_time | hold time in microseconds. T = PTNVH1 x 1 us |
| __STATIC_FORCEINLINE void hw_fcu_set_flash_mass_erase_time | ( | uint32_t | erase_time | ) |
Set program flash mass erase time.
| [in] | erase_time | mass erase time in microseconds. T= PTME x 1 us |
| __STATIC_FORCEINLINE void hw_fcu_set_flash_page_erase_time | ( | uint32_t | erase_time | ) |
Set program flash page erase time.
| [in] | erase_time | page erase time in microseconds. T= PTERASE x 1 us |
| __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.
| [in] | erase_time | page segment erase time for suspend erase in microseconds. |
| __STATIC_FORCEINLINE void hw_fcu_set_flash_program_time | ( | uint16_t | prog_time | ) |
Set program flash programming time.
| [in] | prog_time | programming time in microseconds. T = PTPROG x 1 us |
| __STATIC_FORCEINLINE void hw_fcu_set_flash_programming_mode | ( | HW_FCU_FLASH_PROG_MODE | mode | ) |
Set program flash mode.
| [in] | mode | program flash mode |
| __STATIC_FORCEINLINE void hw_fcu_set_flash_sleep_to_standby_time | ( | uint8_t | wakeup_time | ) |
Set program flash sleep to standby wake-up time.
| [in] | wakeup_time | sleep to standby wake-up time in microseconds. T = PTWK_SP x 1us |
| __STATIC_FORCEINLINE void hw_fcu_set_sleep_mode | ( | void | ) |
Puts FCU (eFlash) in sleep mode for lower leakage current.
| __STATIC_FORCEINLINE void hw_fcu_set_vdd_level_value | ( | HW_FCU_VDD_LEVEL_VALUE | value | ) |
Set VDD level value.
| [in] | value | VDD level value |
| __STATIC_FORCEINLINE void hw_fcu_set_wait_cycles | ( | HW_FCU_WAIT_CYCLES | wait_cycles | ) |
Set wait cycles.
| [in] | wait_cycles | (allowed values 0...7) |
| __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)
| [in] | src | buffer to be written (avoid casting uint8_t* or uint16_t* to uint32_t*) |
| [in] | address | flash address |
| [in] | len | buffer size in 32bit words |
| [in] | params | pointer to operation parameters structure |
1.8.16