|
SmartSnippets DA1459x SDK
|
QSPI Flash Memory Controller. More...
Files | |
| file | hw_qspi_v2.h |
| Definition of API for the QSPI Low Level Driver. | |
Data Structures | |
| union | hw_qspi_data_t |
| This union is used in order to allow different size access when reading/writing to QSPIC_READDATA_REG, QSPIC_WRITEDATA_REG, QSPIC_DUMMYDATA_REG because. More... | |
| struct | hw_qspi_config_t |
| QSPIC configuration structure. More... | |
| struct | hw_qspi_read_instr_config_t |
| Read instruction configuration structure (auto access mode) More... | |
| struct | hw_qspi_erase_instr_config_t |
| QSPIC Erase instruction configuration structure (auto access mode) More... | |
| struct | hw_qspi_read_status_instr_config_t |
| QSPIC read status instruction configuration structure (auto access mode) More... | |
| struct | hw_qspi_write_enable_instr_config_t |
| QSPIC write enable instruction configuration structure (auto access mode) More... | |
| struct | hw_qspi_page_program_instr_config_t |
| QSPIC Page Program instruction configuration structure (manual access mode) More... | |
| struct | hw_qspi_suspend_resume_instr_config_t |
| QSPIC Erase suspend/resume instruction structure (auto access mode) More... | |
Macros | |
| #define | HW_QSPIC_REG_GETF(id, reg, field) |
| Get the value of a field of a QSPIC register. More... | |
| #define | HW_QSPIC_REG_SETF(id, reg, field, new_val) |
| Set the value of a field of a QSPIC register. More... | |
| #define | HW_QSPIC_REG_SET_BIT(id, reg, field) QSPIBA(id)->QSPIC_##reg##_REG |= (1 << QSPIC_QSPIC_##reg##_REG_##QSPIC_##field##_Pos) |
| Set a bit of a QSPIC register. More... | |
| #define | HW_QSPIC_REG_CLR_BIT(id, reg, field) QSPIBA(id)->QSPIC_##reg##_REG &= ~QSPIC_QSPIC_##reg##_REG_##QSPIC_##field##_Msk |
| Clear a bit of a QSPIC register. More... | |
Typedefs | |
| typedef void * | HW_QSPIC_ID |
| QSPI Controller ID. More... | |
Functions | |
| __STATIC_FORCEINLINE void | hw_qspi_clock_enable (HW_QSPIC_ID id) |
| Enable QSPI controller clock. More... | |
| __STATIC_FORCEINLINE void | hw_qspi_clock_disable (HW_QSPIC_ID id) |
| Disable QSPI controller clock. More... | |
| __STATIC_FORCEINLINE void | hw_qspi_cs_enable (HW_QSPIC_ID id) |
| Enable CS on QSPI bus in manual access mode. More... | |
| __STATIC_FORCEINLINE void | hw_qspi_cs_disable (HW_QSPIC_ID id) |
| Disable CS on QSPI bus in manual access mode. More... | |
| __STATIC_FORCEINLINE HW_QSPI_BUS_STATUS | hw_qspi_get_bus_status (HW_QSPIC_ID id) |
| Get QSPIC Bus status. More... | |
| __STATIC_FORCEINLINE void | hw_qspi_set_div (HW_QSPIC_ID id, HW_QSPI_CLK_DIV div) |
| Set QSPIC clock divider. More... | |
| __STATIC_FORCEINLINE HW_QSPI_CLK_DIV | hw_qspi_get_div (HW_QSPIC_ID id) |
| Get QSPIC clock divider. More... | |
| __STATIC_FORCEINLINE void | hw_qspi_set_manual_access_bus_mode (HW_QSPIC_ID id, HW_QSPI_BUS_MODE bus_mode) |
| Set QSPIC bus mode in manual access mode. More... | |
| __STATIC_FORCEINLINE void | hw_qspi_set_access_mode (HW_QSPIC_ID id, HW_QSPI_ACCESS_MODE access_mode) |
| Set QSPIC access mode. More... | |
| __STATIC_FORCEINLINE HW_QSPI_ACCESS_MODE | hw_qspi_get_access_mode (HW_QSPIC_ID id) |
| Get QSPIC access mode. More... | |
| __STATIC_FORCEINLINE void | hw_qspi_set_clock_mode (HW_QSPIC_ID id, HW_QSPI_CLK_MODE clk_mode) |
| Set QSPIC clock mode. More... | |
| __STATIC_FORCEINLINE HW_QSPI_CLK_MODE | hw_qspi_get_clock_mode (HW_QSPIC_ID id) |
| Get QSPIC clock mode. More... | |
| __STATIC_FORCEINLINE void | hw_qspi_set_io2_direction (HW_QSPIC_ID id, HW_QSPI_IO_DIR dir) |
| Set QSPI_IO2 direction. More... | |
| __STATIC_FORCEINLINE HW_QSPI_IO_DIR | hw_qspi_get_io2_direction (HW_QSPIC_ID id) |
| Get QSPI_IO2 direction. More... | |
| __STATIC_FORCEINLINE void | hw_qspi_set_io3_direction (HW_QSPIC_ID id, HW_QSPI_IO_DIR dir) |
| Set QSPI_IO3 direction. More... | |
| __STATIC_FORCEINLINE HW_QSPI_IO_DIR | hw_qspi_get_io3_direction (HW_QSPIC_ID id) |
| Get QSPI_IO3 direction. More... | |
| __STATIC_FORCEINLINE void | hw_qspi_set_io2_value (HW_QSPIC_ID id, HW_QSPI_IO_VALUE value) |
| Set the value of QSPI_IO2 pad when QSPI_IO2 direction is output. More... | |
| __STATIC_FORCEINLINE HW_QSPI_IO_VALUE | hw_qspi_get_io2_value (HW_QSPIC_ID id) |
| Get the value of QSPI_IO2 pad when QSPI_IO2 direction is output. More... | |
| __STATIC_FORCEINLINE void | hw_qspi_set_io3_value (HW_QSPIC_ID id, HW_QSPI_IO_VALUE value) |
| Set the value of QSPI_IO3 pad when QSPI_IO3 direction is output. More... | |
| __STATIC_FORCEINLINE HW_QSPI_IO_VALUE | hw_qspi_get_io3_value (HW_QSPIC_ID id) |
| Get the value of QSPI_IO3 pad when QSPI_IO3 direction is output. More... | |
| __STATIC_FORCEINLINE void | hw_qspi_set_io (HW_QSPIC_ID id, HW_QSPI_BUS_MODE bus_mode) |
| Set the direction and the level of QSPIC IOs based on the Bus Mode. More... | |
| __STATIC_FORCEINLINE void | hw_qspi_set_hready_mode (HW_QSPIC_ID id, HW_QSPI_HREADY_MODE mode) |
| Set QSPIC HReady signal mode. More... | |
| __STATIC_FORCEINLINE HW_QSPI_HREADY_MODE | hw_qspi_get_hready_mode (HW_QSPIC_ID id) |
| Get QSPIC HReady signal mode. More... | |
| __STATIC_FORCEINLINE void | hw_qspi_set_read_sampling_edge (HW_QSPIC_ID id, HW_QSPI_SAMPLING_EDGE edge) |
| Set QSPIC read sampling edge. More... | |
| __STATIC_FORCEINLINE HW_QSPI_SAMPLING_EDGE | hw_qspi_get_read_sampling_edge (HW_QSPIC_ID id) |
| Get QSPIC read sampling edge. More... | |
| __STATIC_FORCEINLINE void | hw_qspi_set_read_pipe (HW_QSPIC_ID id, HW_QSPI_READ_PIPE read_pipe) |
| Set QSPIC data read pipe status. More... | |
| __STATIC_FORCEINLINE HW_QSPI_READ_PIPE | hw_qspi_get_read_pipe (HW_QSPIC_ID id) |
| Get QSPIC read pipe status. More... | |
| __STATIC_FORCEINLINE void | hw_qspi_set_read_pipe_clock_delay (HW_QSPIC_ID id, HW_QSPI_READ_PIPE_DELAY delay) |
| Set the QSPIC read pipe clock delay. More... | |
| __STATIC_FORCEINLINE HW_QSPI_READ_PIPE_DELAY | hw_qspi_get_read_pipe_clock_delay (HW_QSPIC_ID id) |
| Get QSPIC read pipe clock delay. More... | |
| __STATIC_FORCEINLINE void | hw_qspi_set_address_size (HW_QSPIC_ID id, HW_QSPI_ADDR_SIZE addr_size) |
| Set QSPIC address size. More... | |
| __STATIC_FORCEINLINE HW_QSPI_ADDR_SIZE | hw_qspi_get_address_size (HW_QSPIC_ID id) |
| Get QSPIC address size. More... | |
| __STATIC_FORCEINLINE void | hw_qspi_set_slew_rate (HW_QSPIC_ID id, HW_QSPI_SLEW_RATE slew_rate) |
| Set slew rate of QSPIC pads. More... | |
| __STATIC_FORCEINLINE HW_QSPI_SLEW_RATE | hw_qspi_get_slew_rate (HW_QSPIC_ID id) |
| Get slew rate of QSPIC pads. More... | |
| __STATIC_FORCEINLINE void | hw_qspi_set_drive_current (HW_QSPIC_ID id, HW_QSPI_DRIVE_CURRENT drive_current) |
| Set drive current of QSPIC pads. More... | |
| __STATIC_FORCEINLINE HW_QSPI_DRIVE_CURRENT | hw_qspi_get_drive_current (HW_QSPIC_ID id) |
| Get drive current of QSPIC pads. More... | |
| __STATIC_FORCEINLINE void | hw_qspi_set_dummy_bytes (HW_QSPIC_ID id, uint8_t dummy_bytes) |
| Set the number of dummy bytes in auto access mode. More... | |
| __STATIC_FORCEINLINE uint8_t | hw_qspi_get_dummy_bytes (HW_QSPIC_ID id) |
| Get the number of dummy bytes in auto access mode. More... | |
| __STATIC_FORCEINLINE void | hw_qspi_set_read_cs_idle_delay (HW_QSPIC_ID id, uint16_t cs_idle_delay_nsec, uint32_t clk_freq_hz) |
| Set the minimum number of clocks cycles that CS stays in idle mode, between two consecutive read commands. More... | |
| __STATIC_FORCEINLINE void | hw_qspi_set_erase_cs_idle_delay (HW_QSPIC_ID id, uint16_t cs_idle_delay_nsec, uint32_t clk_freq_hz) |
| Set the minimum number of clocks cycles that CS stays in idle mode, between a write enable, erase, erase suspend and erase resume instruction and the next consecutive command. More... | |
| __STATIC_FORCEINLINE uint32_t | hw_qspi_read32 (HW_QSPIC_ID id) |
| Generate 32 bits data transfer from the external device to the QSPIC (manual mode) More... | |
| __STATIC_FORCEINLINE uint16_t | hw_qspi_read16 (HW_QSPIC_ID id) |
| Generate 16 bits data transfer from the external device to the QSPIC (manual mode) More... | |
| __STATIC_FORCEINLINE uint8_t | hw_qspi_read8 (HW_QSPIC_ID id) |
| Generate 8 bits data transfer from the external device to the QSPIC (manual mode) More... | |
| __STATIC_FORCEINLINE void | hw_qspi_write32 (HW_QSPIC_ID id, uint32_t data) |
| Generate 32 bits data transfer from the QSPIC to the external device (manual mode) More... | |
| __STATIC_FORCEINLINE void | hw_qspi_write16 (HW_QSPIC_ID id, uint16_t data) |
| Generate 16 bits data transfer from the QSPIC to the external device (manual mode) More... | |
| __STATIC_FORCEINLINE void | hw_qspi_write8 (HW_QSPIC_ID id, uint8_t data) |
| Generate 8 bits data transfer from the QSPIC to the external device (manual mode) More... | |
| __STATIC_FORCEINLINE void | hw_qspi_dummy32 (HW_QSPIC_ID id) |
| Generate clock pulses on the SPI bus for a 32-bit transfer. More... | |
| __STATIC_FORCEINLINE void | hw_qspi_dummy16 (HW_QSPIC_ID id) |
| Generate clock pulses on the SPI bus for a 16-bit transfer. More... | |
| __STATIC_FORCEINLINE void | hw_qspi_dummy8 (HW_QSPIC_ID id) |
| Generate clock pulses on the SPI bus for an 8-bit transfer. More... | |
| __RETAINED_CODE void | hw_qspi_init (HW_QSPIC_ID id, const hw_qspi_config_t *cfg) |
| Initialize the QSPI controller (QSPIC) More... | |
| __STATIC_FORCEINLINE void | hw_qspi_read_instr_init (HW_QSPIC_ID id, const hw_qspi_read_instr_config_t *cfg, uint8_t dummy_bytes, uint32_t sys_clk_freq_hz) |
| Initialize the read instruction of the QSPIC. More... | |
| __STATIC_FORCEINLINE void | hw_qspi_erase_instr_init (HW_QSPIC_ID id, const hw_qspi_erase_instr_config_t *cfg, uint32_t sys_clk_freq_hz) |
| Initialize the erase instruction of the QSPIC. More... | |
| __STATIC_FORCEINLINE void | hw_qspi_read_status_instr_init (HW_QSPIC_ID id, const hw_qspi_read_status_instr_config_t *cfg, uint32_t sys_clk_freq_hz) |
| Initialize the read status register instruction of the QSPIC. More... | |
| __STATIC_FORCEINLINE void | hw_qspi_write_enable_instr_init (HW_QSPIC_ID id, const hw_qspi_write_enable_instr_config_t *cfg) |
| Initialize the write enable instruction of the QSPIC. More... | |
| __STATIC_FORCEINLINE void | hw_qspi_suspend_resume_instr_init (HW_QSPIC_ID id, const hw_qspi_suspend_resume_instr_config_t *cfg) |
| Initialize the program and erase suspend/resume instruction of the QSPIC. More... | |
| __STATIC_FORCEINLINE void | hw_qspi_exit_continuous_mode_instr_init (HW_QSPIC_ID id, HW_QSPI_CONTINUOUS_MODE mode, HW_QSPI_ADDR_SIZE addr_size) |
| Initialize the exit from continuous mode instruction of the QSPIC. More... | |
| __STATIC_FORCEINLINE void | hw_qspi_set_erase_address (HW_QSPIC_ID id, uint32_t erase_addr) |
| Set the address of the block/sector that is requested to be erased. More... | |
| __STATIC_FORCEINLINE void | hw_qspi_trigger_erase (HW_QSPIC_ID id) |
| Trigger erase block/sector. More... | |
| __STATIC_FORCEINLINE HW_QSPI_ERASE_STATUS | hw_qspi_get_erase_status (HW_QSPIC_ID id) |
| Get erase status. More... | |
| __RETAINED_CODE void | hw_qspi_erase_block (HW_QSPIC_ID id, uint32_t addr) |
| Erase block/sector of flash memory. More... | |
| __STATIC_FORCEINLINE void | hw_qspi_set_extra_byte (HW_QSPIC_ID id, uint8_t extra_byte, HW_QSPI_BUS_MODE bus_mode, bool half_disable_out) |
| Set an extra byte to use with read instructions. More... | |
| __STATIC_FORCEINLINE void | hw_qspi_exit_continuous_mode_sequence_enable (HW_QSPIC_ID id) |
| Enable the 'exit from continuous read mode' sequence in automode. More... | |
| __STATIC_FORCEINLINE void | hw_qspi_exit_continuous_mode_sequence_disable (HW_QSPIC_ID id) |
| Disable the 'exit from continuous read mode' sequence in automode. More... | |
QSPI Flash Memory Controller.
| #define HW_QSPIC_REG_CLR_BIT | ( | id, | |
| reg, | |||
| field | |||
| ) | QSPIBA(id)->QSPIC_##reg##_REG &= ~QSPIC_QSPIC_##reg##_REG_##QSPIC_##field##_Msk |
Clear a bit of a QSPIC register.
| [in] | id | QSPI controller id |
| [in] | reg | is the register to access |
| [in] | field | is the register bit to clear |
| #define HW_QSPIC_REG_GETF | ( | id, | |
| reg, | |||
| field | |||
| ) |
Get the value of a field of a QSPIC register.
| [in] | id | QSPI controller id |
| [in] | reg | is the register to access |
| [in] | field | is the register field to write |
| #define HW_QSPIC_REG_SET_BIT | ( | id, | |
| reg, | |||
| field | |||
| ) | QSPIBA(id)->QSPIC_##reg##_REG |= (1 << QSPIC_QSPIC_##reg##_REG_##QSPIC_##field##_Pos) |
Set a bit of a QSPIC register.
| [in] | id | QSPI controller id |
| [in] | reg | is the register to access |
| [in] | field | is the register bit to set |
| #define HW_QSPIC_REG_SETF | ( | id, | |
| reg, | |||
| field, | |||
| new_val | |||
| ) |
Set the value of a field of a QSPIC register.
| [in] | id | QSPI controller id |
| [in] | reg | is the register to access |
| [in] | field | is the register field to write |
| [in] | new_val | is the value to write |
| typedef void* HW_QSPIC_ID |
QSPI Controller ID.
| enum HW_QSPI_ACCESS_MODE |
| enum HW_QSPI_ADDR_SIZE |
| enum HW_QSPI_BUS_MODE |
| enum HW_QSPI_BUS_STATUS |
| enum HW_QSPI_BUSY_LEVEL |
| enum HW_QSPI_CLK_DIV |
| enum HW_QSPI_CLK_MODE |
| enum HW_QSPI_ERASE_STATUS |
The status of sector/block erasing.
| enum HW_QSPI_EXTRA_BYTE |
QSPIC extra byte half setting in auto access mode.
| Enumerator | |
|---|---|
| HW_QSPI_EXTRA_BYTE_HALF_DISABLE | Transmit the complete extra byte |
| HW_QSPI_EXTRA_BYTE_HALF_ENABLE | The output switches to Hi-Z during the transmission of the low nibble of the extra byte |
| enum HW_QSPI_HREADY_MODE |
QSPIC HREADY signal mode when accessing the WRITEDATA, READDATA and DUMMYDATA registers.
| enum HW_QSPI_IO_DIR |
QSPIC pad direction.
| Enumerator | |
|---|---|
| HW_QSPI_IO_DIR_AUTO_SEL | The QSPI pad is determined by the controller. |
| HW_QSPI_IO_DIR_OUTPUT | The QSPI pad is output |
| enum HW_QSPI_IO_VALUE |
| enum HW_QSPI_READ_PIPE |
QSPIC read pipe setting.
| Enumerator | |
|---|---|
| HW_QSPI_READ_PIPE_DISABLE | Disable read pipe delay |
| HW_QSPI_READ_PIPE_ENABLE | Enable read pipe delay |
QSPIC Read pipe clock delay in relation to the falling edge of QSPI_SCK.
QSPIC clock edge setting for the sampling of the incoming data when the read pipe is disabled.
| enum HW_QSPI_SLEW_RATE |
| __STATIC_FORCEINLINE void hw_qspi_clock_disable | ( | HW_QSPIC_ID | id | ) |
Disable QSPI controller clock.
| [in] | id | QSPI controller id |
| __STATIC_FORCEINLINE void hw_qspi_clock_enable | ( | HW_QSPIC_ID | id | ) |
Enable QSPI controller clock.
| [in] | id | QSPI controller id |
| __STATIC_FORCEINLINE void hw_qspi_cs_disable | ( | HW_QSPIC_ID | id | ) |
Disable CS on QSPI bus in manual access mode.
| [in] | id | QSPI controller id |
| __STATIC_FORCEINLINE void hw_qspi_cs_enable | ( | HW_QSPIC_ID | id | ) |
Enable CS on QSPI bus in manual access mode.
| [in] | id | QSPI controller id |
| __STATIC_FORCEINLINE void hw_qspi_dummy16 | ( | HW_QSPIC_ID | id | ) |
Generate clock pulses on the SPI bus for a 16-bit transfer.
| [in] | id | QSPI controller id |
| __STATIC_FORCEINLINE void hw_qspi_dummy32 | ( | HW_QSPIC_ID | id | ) |
Generate clock pulses on the SPI bus for a 32-bit transfer.
| [in] | id | QSPI controller id |
| __STATIC_FORCEINLINE void hw_qspi_dummy8 | ( | HW_QSPIC_ID | id | ) |
Generate clock pulses on the SPI bus for an 8-bit transfer.
| [in] | id | QSPI controller id |
| __RETAINED_CODE void hw_qspi_erase_block | ( | HW_QSPIC_ID | id, |
| uint32_t | addr | ||
| ) |
Erase block/sector of flash memory.
| [in] | id | QSPI controller id |
| [in] | addr | memory address of the block/sector to be erased |
| __STATIC_FORCEINLINE void hw_qspi_erase_instr_init | ( | HW_QSPIC_ID | id, |
| const hw_qspi_erase_instr_config_t * | cfg, | ||
| uint32_t | sys_clk_freq_hz | ||
| ) |
Initialize the erase instruction of the QSPIC.
| [in] | id | QSPI controller id |
| [in] | cfg | Pointer to configuration structure of the erase instruction. |
| [in] | sys_clk_freq_hz | The system clock frequency in Hz, which is used to calculate the minimum QSPI bus clock cycles that the Chip Select (CS) signal remain must high between an erase instruction and the next consecutive instruction. |
| __STATIC_FORCEINLINE void hw_qspi_exit_continuous_mode_instr_init | ( | HW_QSPIC_ID | id, |
| HW_QSPI_CONTINUOUS_MODE | mode, | ||
| HW_QSPI_ADDR_SIZE | addr_size | ||
| ) |
Initialize the exit from continuous mode instruction of the QSPIC.
| [in] | id | QSPI controller id |
| [in] | mode | Enable/Disable continuous mode of operation. |
| [in] | addr_size | The address size which determines the length of the sequence to exit the connected memory from continuous mode of operation. If the address size is 32 bits, the length of the command sequence is 2 bytes. Otherwise, for address size 24 bits only 1 byte is required. |
| __STATIC_FORCEINLINE void hw_qspi_exit_continuous_mode_sequence_disable | ( | HW_QSPIC_ID | id | ) |
Disable the 'exit from continuous read mode' sequence in automode.
| [in] | id | QSPI controller id |
| __STATIC_FORCEINLINE void hw_qspi_exit_continuous_mode_sequence_enable | ( | HW_QSPIC_ID | id | ) |
Enable the 'exit from continuous read mode' sequence in automode.
| [in] | id | QSPI controller id |
| __STATIC_FORCEINLINE HW_QSPI_ACCESS_MODE hw_qspi_get_access_mode | ( | HW_QSPIC_ID | id | ) |
Get QSPIC access mode.
| [in] | id | QSPI controller id |
| __STATIC_FORCEINLINE HW_QSPI_ADDR_SIZE hw_qspi_get_address_size | ( | HW_QSPIC_ID | id | ) |
Get QSPIC address size.
| [in] | id | QSPI controller id |
| __STATIC_FORCEINLINE HW_QSPI_BUS_STATUS hw_qspi_get_bus_status | ( | HW_QSPIC_ID | id | ) |
| __STATIC_FORCEINLINE HW_QSPI_CLK_MODE hw_qspi_get_clock_mode | ( | HW_QSPIC_ID | id | ) |
Get QSPIC clock mode.
| [in] | id | QSPI controller id |
| __STATIC_FORCEINLINE HW_QSPI_CLK_DIV hw_qspi_get_div | ( | HW_QSPIC_ID | id | ) |
Get QSPIC clock divider.
| [in] | id | QSPI controller id |
| __STATIC_FORCEINLINE HW_QSPI_DRIVE_CURRENT hw_qspi_get_drive_current | ( | HW_QSPIC_ID | id | ) |
Get drive current of QSPIC pads.
| [in] | id | QSPI controller id |
| __STATIC_FORCEINLINE uint8_t hw_qspi_get_dummy_bytes | ( | HW_QSPIC_ID | id | ) |
Get the number of dummy bytes in auto access mode.
| [in] | id | QSPI controller id |
| __STATIC_FORCEINLINE HW_QSPI_ERASE_STATUS hw_qspi_get_erase_status | ( | HW_QSPIC_ID | id | ) |
Get erase status.
| [in] | id | QSPI controller id |
| __STATIC_FORCEINLINE HW_QSPI_HREADY_MODE hw_qspi_get_hready_mode | ( | HW_QSPIC_ID | id | ) |
Get QSPIC HReady signal mode.
| [in] | id | QSPI controller id |
| __STATIC_FORCEINLINE HW_QSPI_IO_DIR hw_qspi_get_io2_direction | ( | HW_QSPIC_ID | id | ) |
Get QSPI_IO2 direction.
| [in] | id | QSPI controller id |
| __STATIC_FORCEINLINE HW_QSPI_IO_VALUE hw_qspi_get_io2_value | ( | HW_QSPIC_ID | id | ) |
Get the value of QSPI_IO2 pad when QSPI_IO2 direction is output.
| [in] | id | QSPI controller id |
| __STATIC_FORCEINLINE HW_QSPI_IO_DIR hw_qspi_get_io3_direction | ( | HW_QSPIC_ID | id | ) |
Get QSPI_IO3 direction.
| [in] | id | QSPI controller id |
| __STATIC_FORCEINLINE HW_QSPI_IO_VALUE hw_qspi_get_io3_value | ( | HW_QSPIC_ID | id | ) |
Get the value of QSPI_IO3 pad when QSPI_IO3 direction is output.
| [in] | id | QSPI controller id |
| __STATIC_FORCEINLINE HW_QSPI_READ_PIPE hw_qspi_get_read_pipe | ( | HW_QSPIC_ID | id | ) |
Get QSPIC read pipe status.
| [in] | id | QSPI controller id |
| __STATIC_FORCEINLINE HW_QSPI_READ_PIPE_DELAY hw_qspi_get_read_pipe_clock_delay | ( | HW_QSPIC_ID | id | ) |
Get QSPIC read pipe clock delay.
| [in] | id | QSPI controller id |
| __STATIC_FORCEINLINE HW_QSPI_SAMPLING_EDGE hw_qspi_get_read_sampling_edge | ( | HW_QSPIC_ID | id | ) |
Get QSPIC read sampling edge.
| [in] | id | QSPI controller id |
| __STATIC_FORCEINLINE HW_QSPI_SLEW_RATE hw_qspi_get_slew_rate | ( | HW_QSPIC_ID | id | ) |
Get slew rate of QSPIC pads.
| [in] | id | QSPI controller id |
| __RETAINED_CODE void hw_qspi_init | ( | HW_QSPIC_ID | id, |
| const hw_qspi_config_t * | cfg | ||
| ) |
Initialize the QSPI controller (QSPIC)
| [in] | id | QSPI controller id |
| [in] | cfg | Pointer to QSPIC configuration structure. |
| __STATIC_FORCEINLINE uint16_t hw_qspi_read16 | ( | HW_QSPIC_ID | id | ) |
Generate 16 bits data transfer from the external device to the QSPIC (manual mode)
| [in] | id | QSPI controller id |
| __STATIC_FORCEINLINE uint32_t hw_qspi_read32 | ( | HW_QSPIC_ID | id | ) |
Generate 32 bits data transfer from the external device to the QSPIC (manual mode)
| [in] | id | QSPI controller id |
| __STATIC_FORCEINLINE uint8_t hw_qspi_read8 | ( | HW_QSPIC_ID | id | ) |
Generate 8 bits data transfer from the external device to the QSPIC (manual mode)
| [in] | id | QSPI controller id |
| __STATIC_FORCEINLINE void hw_qspi_read_instr_init | ( | HW_QSPIC_ID | id, |
| const hw_qspi_read_instr_config_t * | cfg, | ||
| uint8_t | dummy_bytes, | ||
| uint32_t | sys_clk_freq_hz | ||
| ) |
Initialize the read instruction of the QSPIC.
| [in] | id | QSPI controller id |
| [in] | cfg | Pointer to configuration structure of the read instruction. |
| [in] | dummy_bytes | The number of dummy bytes. |
| [in] | sys_clk_freq_hz | The system clock frequency in Hz, which is used to calculate the minimum QSPI bus clock cycles that the Chip Select (CS) signal must remain high between two consecutive read instructions. |
| __STATIC_FORCEINLINE void hw_qspi_read_status_instr_init | ( | HW_QSPIC_ID | id, |
| const hw_qspi_read_status_instr_config_t * | cfg, | ||
| uint32_t | sys_clk_freq_hz | ||
| ) |
Initialize the read status register instruction of the QSPIC.
| [in] | id | QSPI controller id |
| [in] | cfg | Pointer to configuration structure of the read status register instruction. |
| [in] | sys_clk_freq_hz | The system clock frequency in Hz, which is used to calculate the minimum required delay, in QSPI bus clock cycles, between an erase or erase resume instruction and the next consecutive read status register instruction. |
| __STATIC_FORCEINLINE void hw_qspi_set_access_mode | ( | HW_QSPIC_ID | id, |
| HW_QSPI_ACCESS_MODE | access_mode | ||
| ) |
Set QSPIC access mode.
| [in] | id | QSPI controller id |
| [in] | access_mode | QSPIC access mode |
| __STATIC_FORCEINLINE void hw_qspi_set_address_size | ( | HW_QSPIC_ID | id, |
| HW_QSPI_ADDR_SIZE | addr_size | ||
| ) |
Set QSPIC address size.
| [in] | id | QSPI controller id |
| [in] | addr_size | QSPIC address size |
| __STATIC_FORCEINLINE void hw_qspi_set_clock_mode | ( | HW_QSPIC_ID | id, |
| HW_QSPI_CLK_MODE | clk_mode | ||
| ) |
Set QSPIC clock mode.
| [in] | id | QSPI controller id |
| [in] | clk_mode | QSPIC clock mode |
| __STATIC_FORCEINLINE void hw_qspi_set_div | ( | HW_QSPIC_ID | id, |
| HW_QSPI_CLK_DIV | div | ||
| ) |
Set QSPIC clock divider.
| [in] | id | QSPI controller id |
| [in] | div | QSPIC clock divider |
| __STATIC_FORCEINLINE void hw_qspi_set_drive_current | ( | HW_QSPIC_ID | id, |
| HW_QSPI_DRIVE_CURRENT | drive_current | ||
| ) |
Set drive current of QSPIC pads.
| [in] | id | QSPI controller id |
| [in] | drive_current | QSPIC pads drive current |
| __STATIC_FORCEINLINE void hw_qspi_set_dummy_bytes | ( | HW_QSPIC_ID | id, |
| uint8_t | dummy_bytes | ||
| ) |
Set the number of dummy bytes in auto access mode.
| [in] | id | QSPI controller id |
| [in] | dummy_bytes | Number of dummy bytes (0 - 4) |
| __STATIC_FORCEINLINE void hw_qspi_set_erase_address | ( | HW_QSPIC_ID | id, |
| uint32_t | erase_addr | ||
| ) |
Set the address of the block/sector that is requested to be erased.
| [in] | id | QSPI controller id |
| [in] | erase_addr | Address to erase. |
| __STATIC_FORCEINLINE void hw_qspi_set_erase_cs_idle_delay | ( | HW_QSPIC_ID | id, |
| uint16_t | cs_idle_delay_nsec, | ||
| uint32_t | clk_freq_hz | ||
| ) |
Set the minimum number of clocks cycles that CS stays in idle mode, between a write enable, erase, erase suspend and erase resume instruction and the next consecutive command.
| [in] | id | QSPI controller id |
| [in] | cs_idle_delay_nsec | The minimum time in nsec that the CS signal stays idle |
| [in] | clk_freq_hz | The QSPI controller clock frequency (in Hz) |
| __STATIC_FORCEINLINE void hw_qspi_set_extra_byte | ( | HW_QSPIC_ID | id, |
| uint8_t | extra_byte, | ||
| HW_QSPI_BUS_MODE | bus_mode, | ||
| bool | half_disable_out | ||
| ) |
Set an extra byte to use with read instructions.
| [in] | id | QSPI controller id |
| [in] | extra_byte | an extra byte transferred after the address asking memory to stay in continuous read mode or wait for a normal instruction after CS goes inactive |
| [in] | bus_mode | the mode of the SPI bus during the extra byte phase. |
| [in] | half_disable_out | true - disable (hi-z) output during the transmission of bits [3:0] of extra byte false - transmit the complete extra byte |
| __STATIC_FORCEINLINE void hw_qspi_set_hready_mode | ( | HW_QSPIC_ID | id, |
| HW_QSPI_HREADY_MODE | mode | ||
| ) |
Set QSPIC HReady signal mode.
| [in] | id | QSPI controller id |
| [in] | mode | HReady signal mode |
| __STATIC_FORCEINLINE void hw_qspi_set_io | ( | HW_QSPIC_ID | id, |
| HW_QSPI_BUS_MODE | bus_mode | ||
| ) |
Set the direction and the level of QSPIC IOs based on the Bus Mode.
| [in] | id | QSPI controller id |
| [in] | bus_mode | The QSPIC Bus Mode |
| __STATIC_FORCEINLINE void hw_qspi_set_io2_direction | ( | HW_QSPIC_ID | id, |
| HW_QSPI_IO_DIR | dir | ||
| ) |
Set QSPI_IO2 direction.
| [in] | id | QSPI controller id |
| [in] | dir | QSPI_IO2 direction |
| __STATIC_FORCEINLINE void hw_qspi_set_io2_value | ( | HW_QSPIC_ID | id, |
| HW_QSPI_IO_VALUE | value | ||
| ) |
Set the value of QSPI_IO2 pad when QSPI_IO2 direction is output.
| [in] | id | QSPI controller id |
| [in] | value | The value of QSPI_IO2 pad |
| __STATIC_FORCEINLINE void hw_qspi_set_io3_direction | ( | HW_QSPIC_ID | id, |
| HW_QSPI_IO_DIR | dir | ||
| ) |
Set QSPI_IO3 direction.
| [in] | id | QSPI controller id |
| [in] | dir | QSPI_IO3 direction |
| __STATIC_FORCEINLINE void hw_qspi_set_io3_value | ( | HW_QSPIC_ID | id, |
| HW_QSPI_IO_VALUE | value | ||
| ) |
Set the value of QSPI_IO3 pad when QSPI_IO3 direction is output.
| [in] | id | QSPI controller id |
| [in] | value | The value of QSPI_IO3 pad |
| __STATIC_FORCEINLINE void hw_qspi_set_manual_access_bus_mode | ( | HW_QSPIC_ID | id, |
| HW_QSPI_BUS_MODE | bus_mode | ||
| ) |
Set QSPIC bus mode in manual access mode.
| [in] | id | QSPI controller id |
| [in] | bus_mode | QSPIC bus mode in manual access mode |
| __STATIC_FORCEINLINE void hw_qspi_set_read_cs_idle_delay | ( | HW_QSPIC_ID | id, |
| uint16_t | cs_idle_delay_nsec, | ||
| uint32_t | clk_freq_hz | ||
| ) |
Set the minimum number of clocks cycles that CS stays in idle mode, between two consecutive read commands.
| [in] | id | QSPI controller id |
| [in] | cs_idle_delay_nsec | The minimum time in nsec that the CS signal stays idle |
| [in] | clk_freq_hz | The QSPI controller clock frequency (in Hz) |
| __STATIC_FORCEINLINE void hw_qspi_set_read_pipe | ( | HW_QSPIC_ID | id, |
| HW_QSPI_READ_PIPE | read_pipe | ||
| ) |
Set QSPIC data read pipe status.
| [in] | id | QSPI controller id |
| [in] | read_pipe | Status of data read pipe |
| __STATIC_FORCEINLINE void hw_qspi_set_read_pipe_clock_delay | ( | HW_QSPIC_ID | id, |
| HW_QSPI_READ_PIPE_DELAY | delay | ||
| ) |
Set the QSPIC read pipe clock delay.
| [in] | id | QSPI controller id |
| [in] | delay | Read pipe clock delay |
| __STATIC_FORCEINLINE void hw_qspi_set_read_sampling_edge | ( | HW_QSPIC_ID | id, |
| HW_QSPI_SAMPLING_EDGE | edge | ||
| ) |
Set QSPIC read sampling edge.
| [in] | id | QSPI controller id |
| [in] | edge | Read sampling edge |
| __STATIC_FORCEINLINE void hw_qspi_set_slew_rate | ( | HW_QSPIC_ID | id, |
| HW_QSPI_SLEW_RATE | slew_rate | ||
| ) |
Set slew rate of QSPIC pads.
| [in] | id | QSPI controller id |
| [in] | slew_rate | QSPIC pads slew rate |
| __STATIC_FORCEINLINE void hw_qspi_suspend_resume_instr_init | ( | HW_QSPIC_ID | id, |
| const hw_qspi_suspend_resume_instr_config_t * | cfg | ||
| ) |
Initialize the program and erase suspend/resume instruction of the QSPIC.
| [in] | id | QSPI controller id |
| [in] | cfg | Pointer to configuration structure of the program and erase suspend/resume instruction. |
| __STATIC_FORCEINLINE void hw_qspi_trigger_erase | ( | HW_QSPIC_ID | id | ) |
Trigger erase block/sector.
| [in] | id | QSPI controller id |
| __STATIC_FORCEINLINE void hw_qspi_write16 | ( | HW_QSPIC_ID | id, |
| uint16_t | data | ||
| ) |
Generate 16 bits data transfer from the QSPIC to the external device (manual mode)
| [in] | id | QSPI controller id |
| [in] | data | 16 bits value to be written on the device |
| __STATIC_FORCEINLINE void hw_qspi_write32 | ( | HW_QSPIC_ID | id, |
| uint32_t | data | ||
| ) |
Generate 32 bits data transfer from the QSPIC to the external device (manual mode)
| [in] | id | QSPI controller id |
| [in] | data | 32 bits value to be written on the device |
| __STATIC_FORCEINLINE void hw_qspi_write8 | ( | HW_QSPIC_ID | id, |
| uint8_t | data | ||
| ) |
Generate 8 bits data transfer from the QSPIC to the external device (manual mode)
| [in] | id | QSPI controller id |
| [in] | data | 8 bits value to be written on the device |
| __STATIC_FORCEINLINE void hw_qspi_write_enable_instr_init | ( | HW_QSPIC_ID | id, |
| const hw_qspi_write_enable_instr_config_t * | cfg | ||
| ) |
Initialize the write enable instruction of the QSPIC.
| [in] | id | QSPI controller id |
| [in] | cfg | Pointer to configuration structure of the write enable instruction. |
1.8.16