NEORV32 Software Framework Documentation
The NEORV32 RISC-V Processor
|
Execute in place module (XIP) HW driver header file. More...
#include <stdint.h>
Go to the source code of this file.
Data Structures | |
struct | neorv32_xip_t |
Functions | |
Prototypes | |
int | neorv32_xip_available (void) |
void | neorv32_xip_setup (int prsc, int cdiv, int cpol, int cpha, uint8_t rd_cmd) |
int | neorv32_xip_start (int abytes) |
void | neorv32_xip_highspeed_enable (void) |
void | neorv32_xip_highspeed_disable (void) |
uint32_t | neorv32_xip_get_clock_speed (void) |
void | neorv32_xip_spi_trans (int nbytes, uint64_t *rtx_data) |
IO Device: Execute In Place Module (XIP) | |
#define | NEORV32_XIP ((neorv32_xip_t*) (NEORV32_XIP_BASE)) |
enum | NEORV32_XIP_CTRL_enum { XIP_CTRL_EN = 0 , XIP_CTRL_PRSC0 = 1 , XIP_CTRL_PRSC1 = 2 , XIP_CTRL_PRSC2 = 3 , XIP_CTRL_CPOL = 4 , XIP_CTRL_CPHA = 5 , XIP_CTRL_SPI_NBYTES_LSB = 6 , XIP_CTRL_SPI_NBYTES_MSB = 9 , XIP_CTRL_XIP_EN = 10 , XIP_CTRL_XIP_ABYTES_LSB = 11 , XIP_CTRL_XIP_ABYTES_MSB = 12 , XIP_CTRL_RD_CMD_LSB = 13 , XIP_CTRL_RD_CMD_MSB = 20 , XIP_CTRL_SPI_CSEN = 21 , XIP_CTRL_HIGHSPEED = 22 , XIP_CTRL_CDIV0 = 23 , XIP_CTRL_CDIV1 = 24 , XIP_CTRL_CDIV2 = 25 , XIP_CTRL_CDIV3 = 26 , XIP_CTRL_BURST_EN = 29 , XIP_CTRL_PHY_BUSY = 30 , XIP_CTRL_XIP_BUSY = 31 } |
Execute in place module (XIP) HW driver header file.
#define NEORV32_XIP ((neorv32_xip_t*) (NEORV32_XIP_BASE)) |
XIP module hardware access (neorv32_xip_t)
XIP control/data register bits
int neorv32_xip_available | ( | void | ) |
Check if XIP module was synthesized.
uint32_t neorv32_xip_get_clock_speed | ( | void | ) |
Get configured clock speed in Hz.
void neorv32_xip_highspeed_disable | ( | void | ) |
Disable high-speed SPI mode.
void neorv32_xip_highspeed_enable | ( | void | ) |
Enable high-speed SPI mode (running at half of the processor clock).
void neorv32_xip_setup | ( | int | prsc, |
int | cdiv, | ||
int | cpol, | ||
int | cpha, | ||
uint8_t | rd_cmd ) |
Configure XIP module: configure SPI/flash properties.
[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. |
void neorv32_xip_spi_trans | ( | int | nbytes, |
uint64_t * | rtx_data ) |
Direct SPI access to the XIP flash.
[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)). |
int neorv32_xip_start | ( | int | abytes | ) |
Enable XIP mode (to allow CPU to transparently fetch data & instructions).
[in] | abytes | Number of address bytes used to access the SPI flash (1,2,3,4). |