RV32 SoC DS UG
High-Perf RV32 SoC DS UG
RV64 SoC DS UG API and Examples
Embedded IDE UG
Loading...
Searching...
No Matches

Overview

Serial Peripheral Interface (SPI) driver.

This module provides functions to configure and control SPI input/output and interrupt behavior.

Usage & Initialization.

This is an example show how to instantiate SPI Driver with spi_instance_t.

#include "spi/spi.h"
#define SPI (spi_hwreg_t*)SYSTEM_SPI_0_IO_CTRL
.hwreg = SPI,
.cpol = LOW,
.clkDivider = 15,
.ssSetup = 5,
.ssHold = 2,
.ssDisable = 7
},
@ FULL_DUPLEX_SINGLE_LINE
Full-duplex mode using single data lin.
Definition spi.h:142
@ LOW
Clock is low when id.
Definition spi.h:149
@ DATA_SAMPLED_RISE_EDGE
Data sampled on rising clock ed.
Definition spi.h:155
void spi_applyConfig(spi_instance_t *inst)
Applies the current configuration settings stored in the spi_instance_t structure to the SPI hardware...
Definition spi.c:93
SPI driver API definitions.
SPI instance. Holds the software registers and hardware pointer.
Definition spi.h:236
enum cfg_cpol cpol
Stored Clock Polarity.
Definition spi.h:238
See also
Example SPI Flash Demo - Learn how to use the driver for interacting with Flash devices

Topics

 API Functions
 Function definitions for SPI driver.
 Data Structures
 Structs used by the driver.
 Data Types
 Enums used by the driver.
 Register Definitions
 Register bitmasks and offsets.