SPI driver for the SiFli SF32LB57 SPI controller.
More...
SPI driver for the SiFli SF32LB57 SPI controller.
The controller shifts 8-bit frames, most significant bit first, so it does not support PBL_SPI_LSB_FIRST. Chip selects are GPIOs. Writes of SPI_SF32LB57_DMA_MIN_BYTES or more go through the transmit DMA channel when there is one; other transfers are moved through the FIFOs from the controller's interrupt.
&s_spi1_tx_dma,
PBL_GPIO(&s_gpio1, 3, 0));
#define SF32LB57_HPSYS_RCC_CLK_SPI1
Definition sifli,sf32lb57-hpsys-rcc.h:27
#define PBL_CLK(_ctrl, _id)
Initializer for a struct pbl_clk.
Definition clk.h:132
#define PBL_GPIO(_port, _pin, _flags)
Initializer for a struct pbl_gpio.
Definition gpio.h:158
#define PBL_SPI_SF32LB57_DEFINE(sym, _name, _base, _irq, _clk, _pinctrl, _dma_tx,...)
Define a SiFli SF32LB57 SPI bus.
Definition sf32lb57.h:78
◆ pbl_spi_sf32lb57
| Data Fields |
|
uintptr_t |
base |
Registers. |
|
struct pbl_spi_bus |
bus |
SPI bus. |
|
struct pbl_clk |
clk |
Controller clock. |
|
const struct pbl_dma_chan * |
dma_tx |
Transmit DMA channel, or NULL. |
|
pbl_irq_t |
irq |
Interrupt line. |
|
struct pbl_pinctrl |
pinctrl |
SCLK, DIO and DI pins. |
|
struct pbl_spi_sf32lb57_state * |
state |
Driver runtime state. |
◆ PBL_SPI_SF32LB57_DEFINE
| #define PBL_SPI_SF32LB57_DEFINE |
( |
|
sym, |
|
|
|
_name, |
|
|
|
_base, |
|
|
|
_irq, |
|
|
|
_clk, |
|
|
|
_pinctrl, |
|
|
|
_dma_tx, |
|
|
|
... |
|
) |
| |
Value:
static struct pbl_spi_sf32lb57_state sym##_sf32lb57_state; \
.state = &sym##_sf32lb57_state, \
.clk = _clk, \
.dma_tx = (_dma_tx), \
.base = (_base), \
.irq = (_irq), \
}; \
PBL_IRQ_CONNECT_NUM(_irq, CONFIG_SPI_SF32LB57_IRQ_PRIO, pbl_spi_sf32lb57_irq_handler, \
&sym##_inst, 0)
#define PBL_PINCTRL(_default, _sleep, _reg)
Initializer for a struct pbl_pinctrl.
Definition pinctrl.h:132
SiFli SF32LB57 SPI bus.
Definition sf32lb57.h:45
An SPI controller.
Definition spi.h:140
#define PBL_SPI_BUS_STATE_DEFINE(sym,...)
Define the class state of bus sym, for the PBL_SPI_*_DEFINE() macro of a driver.
Definition spi.h:182
#define PBL_SPI_BUS_INIT(sym, _name, _parent, _ops)
Initializer for the struct pbl_spi_bus of bus sym.
Definition spi.h:195
Define a SiFli SF32LB57 SPI bus.
- Parameters
-
| sym | Symbol of the bus. |
| _name | Name. |
| _base | Register base address. |
| _irq | Interrupt line. |
| _clk | Controller clock, from PBL_CLK(). |
| _pinctrl | Pin states. |
| _dma_tx | Transmit DMA channel, or NULL. |
| ... | Chip select GPIOs, from PBL_GPIO(). |
◆ SPI_SF32LB57_DMA_MIN_BYTES
| #define SPI_SF32LB57_DMA_MIN_BYTES 32U |
Shortest write that goes through DMA.