Execute in place module (XIP) HW driver source file.
More...
Execute in place module (XIP) HW driver source file.
- Note
- These functions should only be used if the XIP module was synthesized (IO_XIP_EN = true).
- See also
- https://stnolting.github.io/neorv32/sw/files.html
◆ 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_get_clock_speed()
uint32_t neorv32_xip_get_clock_speed |
( |
void | | ) |
|
Get configured clock speed in Hz.
- Returns
- Actual configured XIP clock speed in Hz.
◆ 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()
void neorv32_xip_setup |
( |
int | prsc, |
|
|
int | cdiv, |
|
|
int | cpol, |
|
|
int | cpha, |
|
|
uint8_t | rd_cmd ) |
Configure XIP module: configure SPI/flash 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). @prama[in] cdiv Clock divider (0..15). |
[in] | cpol | SPI clock polarity (0/1). |
[in] | cpha | SPI clock phase(0/1). |
[in] | rd_cmd | SPI flash read byte command. |
◆ neorv32_xip_spi_trans()
void neorv32_xip_spi_trans |
( |
int | 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 |
( |
int | abytes | ) |
|
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). |
- Returns
- 0 if XIP configuration is OK, -1 if configuration error.