SPI bus driver for the nRF5 SPIM peripheral.
More...
|
| #define | PBL_SPI_NRF5_DEFINE(sym, _name, _idx, _sck, _mosi, _miso, _deps, ...) |
| | Define a bus on an nRF5 SPIM instance.
|
| |
SPI bus driver for the nRF5 SPIM peripheral.
Transfers run through EasyDMA, so their buffers must be in data RAM, and are at most 65535 bytes. The clock runs at 125 kHz to 8 MHz, or up to 32 MHz on SPIM3.
SCK and MOSI are outputs and MISO an input with its wiring flags, e.g. a pull, and keep that configuration while the bus is disabled; MOSI and MISO may be left unconnected. The SPIM interrupt is connected by the board:
#define NRF5_GPIO_P1
Port P1.
Definition nrf5.h:42
#define NRF5_GPIO_P0
Port P0.
Definition nrf5.h:40
#define PBL_GPIO_ACTIVE_LOW
The pin is active when low.
Definition gpio.h:50
#define PBL_GPIO(_port, _pin, _flags)
Initializer for a struct pbl_gpio.
Definition gpio.h:148
void pbl_spi_nrf5_irq_handler(const struct pbl_spi_nrf5 *spi)
SPIM interrupt handler, to connect with PBL_IRQ_CONNECT().
#define PBL_SPI_NRF5_DEFINE(sym, _name, _idx, _sck, _mosi, _miso, _deps,...)
Define a bus on an nRF5 SPIM instance.
Definition nrf5.h:62
#define PBL_IRQ_CONNECT(line, prio, isr, arg, flags)
Bind a SoC interrupt line to a handler at build time.
Definition irq.h:114
◆ pbl_spi_nrf5
| Data Fields |
|
struct pbl_spi_bus |
bus |
SPI bus. |
|
uint8_t |
index |
SPIM instance index. |
|
struct pbl_gpio |
miso |
MISO pin, or unconnected. |
|
struct pbl_gpio |
mosi |
MOSI pin, or unconnected. |
|
struct pbl_gpio |
sck |
SCK pin. |
◆ PBL_SPI_NRF5_DEFINE
| #define PBL_SPI_NRF5_DEFINE |
( |
|
sym, |
|
|
|
_name, |
|
|
|
_idx, |
|
|
|
_sck, |
|
|
|
_mosi, |
|
|
|
_miso, |
|
|
|
_deps, |
|
|
|
... |
|
) |
| |
Value:
.index = (_idx), \
}; \
PBL_DEVICE_REGISTER(sym, &sym.
bus.
dev)
struct pbl_gpio miso
MISO pin, or unconnected.
Definition nrf5.h:43
struct pbl_gpio mosi
MOSI pin, or unconnected.
Definition nrf5.h:41
struct pbl_gpio sck
SCK pin.
Definition nrf5.h:39
struct pbl_spi_bus bus
SPI bus.
Definition nrf5.h:35
nRF5 SPI bus.
Definition nrf5.h:33
struct pbl_device dev
Device.
Definition spi.h:142
#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, _ops, _deps)
Initializer for the struct pbl_spi_bus of bus sym.
Definition spi.h:195
Define a bus on an nRF5 SPIM instance.
- Parameters
-
◆ pbl_spi_nrf5_irq_handler()
| void pbl_spi_nrf5_irq_handler |
( |
const struct pbl_spi_nrf5 * |
spi | ) |
|