|
pico-ice
RaspberryPi Pico with an iCE40 FPGA
|
SRAM chip I/O. More...
Macros | |
| #define | ICE_SRAM_STATUS_BUSY_MASK 0x01 |
| #define | ICE_SRAM_TRANSFER_SIZE 32 |
Functions | |
| void | ice_sram_init (void) |
| Send an initialization command to the SRAM chip. | |
| void | ice_sram_reset (void) |
| Send a reset command to the SRAM chipo. | |
| void | ice_sram_get_id (uint8_t id[8]) |
| Obtain the chip ID from the SRAM chip. | |
| void | ice_sram_write_async (uint32_t addr, const uint8_t *data, size_t data_size, void(*callback)(volatile void *), void *context) |
| Calling this function when any SPI transfer is in progress on this bus waits for it then starts. | |
| void | ice_sram_write_blocking (uint32_t addr, const uint8_t *data, size_t data_size) |
| Write a buffer to the flash chip and wait until completion. | |
| void | ice_sram_read_async (uint32_t addr, uint8_t *data, size_t data_size, void(*callback)(volatile void *), void *context) |
| Read a buffer from the flash chip in the background, with a callback called once done. | |
| void | ice_sram_read_blocking (uint32_t addr, uint8_t *data, size_t data_size) |
| Read a buffer from the flash chip and wait until completion. | |
SRAM chip I/O.
The SRAM chip is APS6404L-3SQN.
| void ice_sram_get_id | ( | uint8_t | id[8] | ) |
Obtain the chip ID from the SRAM chip.
| id | Buffer to which the ID is written. |
The format is:
| void ice_sram_read_async | ( | uint32_t | addr, |
| uint8_t * | data, | ||
| size_t | data_size, | ||
| void(*)(volatile void *) | callback, | ||
| void * | context | ||
| ) |
Read a buffer from the flash chip in the background, with a callback called once done.
| addr | Address from which read the data. |
| data | Buffer to which save the data read. |
| data_size | Size of this buffer in bytes. |
| callback | Function called once the transfer is complete. |
| context | Argument passed to that function. |
Calling this function when any SPI transfer is in progress on this bus waits for it then starts.
| void ice_sram_read_blocking | ( | uint32_t | addr, |
| uint8_t * | data, | ||
| size_t | data_size | ||
| ) |
Read a buffer from the flash chip and wait until completion.
| addr | Address from which read the data. |
| data | Buffer to which save the data read. |
| data_size | Size of this buffer in bytes. |
| void ice_sram_write_async | ( | uint32_t | addr, |
| const uint8_t * | data, | ||
| size_t | data_size, | ||
| void(*)(volatile void *) | callback, | ||
| void * | context | ||
| ) |
Calling this function when any SPI transfer is in progress on this bus waits for it then starts.
| addr | Address to which write the data. |
| data | Buffer with the data to send. |
| data_size | Size of this buffer in bytes. |
| callback | Function called once the transfer is complete. |
| context | Argument passed to that function. |
Calling this function when a transfer is in progress waits then starts.
| void ice_sram_write_blocking | ( | uint32_t | addr, |
| const uint8_t * | data, | ||
| size_t | data_size | ||
| ) |
Write a buffer to the flash chip and wait until completion.
| addr | Address to which write the data. |
| data | Buffer with the data to send. |
| data_size | Size of this buffer in bytes. |