![]() |
API Reference
The NEORV32 RISC-V Processor
|
Serial memory controller (SMC) HW driver header file. More...
Go to the source code of this file.
Data Structures | |
| struct | neorv32_smc_t |
Enumerations | |
| enum | NEORV32_SMC_MSIZE_enum { SMC_MSIZE_2MB = 0b00 , SMC_MSIZE_4MB = 0b01 , SMC_MSIZE_8MB = 0b10 , SMC_MSIZE_16MB = 0b11 } |
Functions | |
Prototypes | |
| int | neorv32_smc_available (void) |
| void | neorv32_smc_setup (int dual, int msize, int cdiv, int rwait, uint8_t rcmd, uint8_t wcmd, uint32_t icmd) |
| int | neorv32_smc_busy (void) |
| void | neorv32_smc_pins_enable (void) |
| void | neorv32_smc_pins_disable (void) |
| uint32_t | neorv32_smc_get_clockspeed (void) |
| uint32_t | neorv32_smc_get_baseaddr (void) |
IO Device: Serial Memory Controller (SMC) | |
| #define | NEORV32_SMC ((neorv32_smc_t*) (NEORV32_SMC_BASE)) |
| enum | NEORV32_SMC_CFG0_enum { SMC_CSR0_EN = 0 , SMC_CSR0_IOEN = 1 , SMC_CSR0_DUAL = 3 , SMC_CSR0_BUSY = 4 , SMC_CSR0_MSIZE_LSB = 7 , SMC_CSR0_MSIZE_MSB = 8 , SMC_CSR0_CDIV_LSB = 9 , SMC_CSR0_CDIV_MSB = 11 , SMC_CSR0_RWAIT_LSB = 12 , SMC_CSR0_RWAIT_MSB = 15 , SMC_CSR0_RCMD_LSB = 16 , SMC_CSR0_RCMD_MSB = 23 , SMC_CSR0_WCMD_LSB = 24 , SMC_CSR0_WCMD_MSB = 31 } |
| enum | NEORV32_SMC_CFG1_enum { SMC_CSR1_ICMD0_LSB = 0 , SMC_CSR1_ICMD0_MSB = 7 , SMC_CSR1_ICMD1_LSB = 8 , SMC_CSR1_ICMD1_MSB = 15 , SMC_CSR1_ICMD2_LSB = 16 , SMC_CSR1_ICMD2_MSB = 23 , SMC_CSR1_MEM_BASE_LSB = 28 , SMC_CSR1_MEM_BASE_MSB = 31 } |
Serial memory controller (SMC) HW driver header file.
| #define NEORV32_SMC ((neorv32_smc_t*) (NEORV32_SMC_BASE)) |
SMC hardware handle (neorv32_smc_t)
SMC control and status register 0 (CSR0) bits
SMC control and status register 1 (CSR1) bits
| int neorv32_smc_available | ( | void | ) |
Check if SMC was synthesized.
| int neorv32_smc_busy | ( | void | ) |
Check if a SMC memory operation is in progress.
| uint32_t neorv32_smc_get_baseaddr | ( | void | ) |
Get configured SMC memory base address.
| uint32_t neorv32_smc_get_clockspeed | ( | void | ) |
Get configured SMC SPI clock speed in Hz.
| void neorv32_smc_pins_disable | ( | void | ) |
Disable SMC control of SMC IO pins.
| void neorv32_smc_pins_enable | ( | void | ) |
Enable SMC control of SMC IO pins.
| void neorv32_smc_setup | ( | int | dual, |
| int | msize, | ||
| int | cdiv, | ||
| int | rwait, | ||
| uint8_t | rcmd, | ||
| uint8_t | wcmd, | ||
| uint32_t | icmd ) |
Reset, configure and enable SMC.
| [in] | dual | Enable dual-chip mode (0,1). |
| [in] | msize | Memory chip size select (NEORV32_SMC_MSIZE_enum). |
| [in] | cdiv | Clock divider (3-bit); f_SPI = f_cpu/(2*(cdiv+1)). |
| [in] | rwait | Number of read access dummy/wait cycles (0..15). |
| [in] | rcmd | Memory chip read command (8-bit). |
| [in] | wcmd | Memory chip write command (8-bit). |
| [in] | icmd | Initialization commands (3x8-bit, LSB-aligned). |