Sapphire SoC DS Sapphire SoC UG Sapphire HP SoC DS Sapphire HP SoC UG RISC-V Embedded IDE UG Board Support Package
Loading...
Searching...
No Matches
spi_instance_t Struct Reference

#include <spi.h>

Data Fields

spi_hwreg_thwreg
 Pointer to Hardware Register Map.
enum cfg_cpol cpol
 Stored Clock Polarity.
enum cfg_cpha cpha
 Stored Clock Phase.
enum cfg_mode mode
 Stored Transfer Mode.
u32 clkDivider
 Clock Divider Value.
u32 ssSetup
 Slave Select Setup Cycles.
u32 ssHold
 Slave Select Hold Cycles.
u32 ssDisable
 Slave Select Disable Cycles.

Detailed Description

SPI instance. Holds the software registers and hardware pointer.

Note
This structure holds configuration values to be applied to the hardware.
  • cpol: Clock polarity (0 or 1).
  • cpha: Clock phase (0 or 1).
  • mode: SPI mode
    • 0: Full-duplex single line
    • 1: Half-duplex dual line (Available only when data width is 8 or 16)
    • 2: Half-duplex quad line (Available only when data width is 8 or 16)
  • clkDivider: Clock divider value.
    • Formula: SPI Driver frequency = FCLK / ((clockDivider+1)*2)
    • Note: FCLK is the system clock (io_systemClk). If peripheral clock is enabled, FCLK is driven by io_peripheralClk instead.
  • ssSetup: Slave select setup time.
    • Clock cycles between activated chip-select and first rising-edge of SCLK.
  • ssHold: Slave select hold time.
    • Clock cycles between last falling-edge and deactivated chip-select.
  • ssDisable: Slave select disable time.
    • Clock cycles between consecutive chip-select activations.

Definition at line 212 of file spi.h.

Field Documentation

◆ clkDivider

u32 spi_instance_t::clkDivider

Clock Divider Value.

Definition at line 217 of file spi.h.

◆ cpha

enum cfg_cpha spi_instance_t::cpha

Stored Clock Phase.

Definition at line 215 of file spi.h.

◆ cpol

enum cfg_cpol spi_instance_t::cpol

Stored Clock Polarity.

Definition at line 214 of file spi.h.

◆ hwreg

spi_hwreg_t* spi_instance_t::hwreg

Pointer to Hardware Register Map.

Definition at line 213 of file spi.h.

◆ mode

enum cfg_mode spi_instance_t::mode

Stored Transfer Mode.

Definition at line 216 of file spi.h.

◆ ssDisable

u32 spi_instance_t::ssDisable

Slave Select Disable Cycles.

Definition at line 220 of file spi.h.

◆ ssHold

u32 spi_instance_t::ssHold

Slave Select Hold Cycles.

Definition at line 219 of file spi.h.

◆ ssSetup

u32 spi_instance_t::ssSetup

Slave Select Setup Cycles.

Definition at line 218 of file spi.h.


The documentation for this struct was generated from the following file:
  • C:/Users/JasonLau/Downloads/workspace_local/GitLab/efx_IP/efx_soc_rv64/embedded_sw/software/standalone/driver/spi/spi.h