|
#define | RTOS_QSPI_FLASH_READ_CHUNK_SIZE (24*1024) |
|
|
void | rtos_qspi_flash_start (rtos_qspi_flash_t *ctx, unsigned priority) |
|
void | rtos_qspi_flash_init (rtos_qspi_flash_t *ctx, xclock_t clock_block, port_t cs_port, port_t sclk_port, port_t sio_port, qspi_io_source_clock_t source_clock, int full_speed_clk_divisor, uint32_t full_speed_sclk_sample_delay, qspi_io_sample_edge_t full_speed_sclk_sample_edge, uint32_t full_speed_sio_pad_delay, int spi_read_clk_divisor, uint32_t spi_read_sclk_sample_delay, qspi_io_sample_edge_t spi_read_sclk_sample_edge, uint32_t spi_read_sio_pad_delay, qspi_flash_page_program_cmd_t quad_page_program_cmd) |
|
The public API for using the RTOS QSPI flash driver.
◆ rtos_qspi_flash_t
Typedef to the RTOS QSPI flash driver instance struct.
◆ rtos_qspi_flash_init()
void rtos_qspi_flash_init |
( |
rtos_qspi_flash_t * |
ctx, |
|
|
xclock_t |
clock_block, |
|
|
port_t |
cs_port, |
|
|
port_t |
sclk_port, |
|
|
port_t |
sio_port, |
|
|
qspi_io_source_clock_t |
source_clock, |
|
|
int |
full_speed_clk_divisor, |
|
|
uint32_t |
full_speed_sclk_sample_delay, |
|
|
qspi_io_sample_edge_t |
full_speed_sclk_sample_edge, |
|
|
uint32_t |
full_speed_sio_pad_delay, |
|
|
int |
spi_read_clk_divisor, |
|
|
uint32_t |
spi_read_sclk_sample_delay, |
|
|
qspi_io_sample_edge_t |
spi_read_sclk_sample_edge, |
|
|
uint32_t |
spi_read_sio_pad_delay, |
|
|
qspi_flash_page_program_cmd_t |
quad_page_program_cmd |
|
) |
| |
Initializes an RTOS QSPI flash driver instance. This must only be called by the tile that owns the driver instance. It may be called either before or after starting the RTOS, but must be called before calling rtos_qspi_flash_start() or any of the core QSPI flash driver functions with this instance.
- Parameters
-
ctx | A pointer to the QSPI flash driver instance to initialize. |
clock_block | The clock block to use for the qspi_io interface. |
cs_port | The chip select port. MUST be a 1-bit port. |
sclk_port | The SCLK port. MUST be a 1-bit port. |
sio_port | The SIO port. MUST be a 4-bit port. |
source_clock | The source clock to use for the QSPI I/O interface. Must be either qspi_io_source_clock_ref or qspi_io_source_clock_xcore. |
full_speed_clk_divisor | The divisor to use for QSPI reads and writes as well as SPI writes. The frequency of SCLK will be set to: (F_src) / (2 * full_speed_clk_divisor) Where F_src is the frequency of the source clock specified by source_clock . |
full_speed_sclk_sample_delay | Number of SCLK cycles to delay the sampling of SIO on input during a full speed transaction. Usually either 0 or 1 depending on the SCLK frequency. |
full_speed_sclk_sample_edge | The SCLK edge to sample the SIO input on during a full speed transaction. May be either qspi_io_sample_edge_rising or qspi_io_sample_edge_falling. |
full_speed_sio_pad_delay | Number of core clock cycles to delay sampling the SIO pads during a full speed transaction. This allows for more fine grained adjustment of sampling time. The value may be between 0 and 5. |
spi_read_clk_divisor | The divisor to use for the clock when performing a SPI read. This may need to be slower than the clock used for writes and QSPI reads. This is because a small handful of instructions must execute to turn the SIO port around from output to input and they must execute within a single SCLK period during a SPI read. QSPI reads have dummy cycles where these instructions may execute which allows for a higher clock frequency. The frequency of SCLK will be set to: (F_src) / (2 * spi_read_clk_divisor) Where F_src is the frequency of the source clock specified by source_clock . |
spi_read_sclk_sample_delay | Number of SCLK cycles to delay the sampling of SIO on input during a SPI read transaction. Usually either 0 or 1 depending on the SCLK frequency. |
spi_read_sclk_sample_edge | The SCLK edge to sample the SIO input on during a SPI read transaction. May be either qspi_io_sample_edge_rising or qspi_io_sample_edge_falling. |
spi_read_sio_pad_delay | Number of core clock cycles to delay sampling the SIO pads during a SPI read transaction. This allows for more fine grained adjustment of sampling time. The value may be between 0 and 5. |
quad_page_program_cmd | The command that will be sent when rtos_qspi_flash_write() is called if quad_page_program_enable is true. This should be a value returned by the QSPI_IO_BYTE_TO_MOSI() macro. |
◆ rtos_qspi_flash_start()
Starts an RTOS QSPI flash driver instance. This must only be called by the tile that owns the driver instance. It may be called either before or after starting the RTOS, but must be called before any of the core QSPI flash driver functions are called with this instance.
rtos_qspi_flash_init() must be called on this QSPI flash driver instance prior to calling this.
- Parameters
-
ctx | A pointer to the QSPI flash driver instance to start. |
priority | The priority of the task that gets created by the driver to handle the QSPI flash interface. |