Execute in place module (XIP) HW driver header file.
More...
Go to the source code of this file.
Execute in place module (XIP) HW driver header file.
- Note
- These functions should only be used if the XIP module was synthesized (IO_XIP_EN = true).
◆ neorv32_xip_available()
int neorv32_xip_available |
( |
void |
| ) |
|
Check if XIP module was synthesized.
- Returns
- 0 if XIP was not synthesized, 1 if XIP is available.
◆ neorv32_xip_highspeed_disable()
void neorv32_xip_highspeed_disable |
( |
void |
| ) |
|
Disable high-speed SPI mode.
◆ neorv32_xip_highspeed_enable()
void neorv32_xip_highspeed_enable |
( |
void |
| ) |
|
Enable high-speed SPI mode (running at half of the processor clock).
- Note
- High-speed SPI mode ignores the programmed clock prescaler configuration.
◆ neorv32_xip_setup()
int neorv32_xip_setup |
( |
uint8_t |
prsc, |
|
|
uint8_t |
cpol, |
|
|
uint8_t |
cpha, |
|
|
uint8_t |
rd_cmd |
|
) |
| |
Configure XIP module: configure SPI properties.
- Warning
- This will reset the XIP module overriding the CTRL register.
- Note
- This function will also send 64 dummy clocks via the SPI port (with chip-select disabled).
- Parameters
-
[in] | prsc | SPI clock prescaler select (0..7). |
[in] | cpol | SPI clock polarity (0/1). |
[in] | cpha | SPI clock phase(0/1). |
[in] | rd_cmd | SPI flash read command. |
- Returns
- 0 if configuration is OK, -1 if configuration error.
◆ neorv32_xip_spi_trans()
int neorv32_xip_spi_trans |
( |
uint8_t |
nbytes, |
|
|
uint64_t * |
rtx_data |
|
) |
| |
Direct SPI access to the XIP flash.
- Warning
- This function can only be used BEFORE the XIP-mode is activated!
- Note
- This function is blocking.
- Parameters
-
[in] | nbytes | Number of bytes to transfer (1..8). |
[in,out] | rtx_data | Pointer to 64-bit TX/RX data (MSB-aligned for sending, LSB-aligned for receiving (only 32-bit)). |
- Returns
- 0 if valid transfer, 1 if transfer configuration error.
◆ neorv32_xip_start()
int neorv32_xip_start |
( |
uint8_t |
abytes, |
|
|
uint32_t |
page_base |
|
) |
| |
Enable XIP mode (to allow CPU to transparently fetch data & instructions).
- Parameters
-
[in] | abytes | Number of address bytes used to access the SPI flash (1,2,3,4). |
[in] | page_base | XIP memory page base address (top 4 address bits, 0..15). |
- Returns
- 0 if XIP configuration is OK, -1 if configuration error.