44#include <sdk/config.h>
45#include <nuttx/config.h>
46#include <nuttx/spi/spi.h>
51#define SPI_HAS_TRANSACTION 1
54#define SPI_HAS_NOTUSINGINTERRUPT 1
61#define SPI_ATOMIC_VERSION 1
63#define SPI_MODE0 SPIDEV_MODE0
64#define SPI_MODE1 SPIDEV_MODE1
65#define SPI_MODE2 SPIDEV_MODE2
66#define SPI_MODE3 SPIDEV_MODE3
68#define SPI_CLOCK_DIV2 2
69#define SPI_CLOCK_DIV4 4
70#define SPI_CLOCK_DIV8 8
71#define SPI_CLOCK_DIV16 16
72#define SPI_CLOCK_DIV32 32
73#define SPI_CLOCK_DIV64 64
74#define SPI_CLOCK_DIV128 128
109 : clock_(clock), bit_order_(bitOrder), data_mode_(dataMode) { }
115 : clock_(4000000), bit_order_(MSBFIRST), data_mode_(
SPI_MODE0) { }
263 void send(
void *buf,
size_t count);
304 FAR
struct spi_dev_s* spi_dev;
305 uint32_t spi_base_clock;
306 uint8_t spi_bit_order;
308 uint8_t spi_transmitting;
323 uint16_t interrupt_mask;
330 uint16_t interrupt_save;
335#if defined(CONFIG_CXD56_SPI4) && defined(CONFIG_SPI_EXCHANGE)
338#ifndef IS_INCLUDED_BY_SPI_CPP
343#error Please enable SPI4 and SPI_EXCHANGE in NuttX
346#if defined(CONFIG_CXD56_SPI5) && defined(CONFIG_SPI_EXCHANGE)
350#if defined(CONFIG_CXD56_SPI3) && defined(CONFIG_SPI_EXCHANGE)
SPI controller.
Definition: SPI.h:131
void setBitOrder(uint8_t bitOrder)
This function is deprecated. New applications should use beginTransaction() to configure SPI settings...
void usingInterrupt(uint8_t interruptNumber)
Register interrupt with the SPI library.
void send16(void *buf, size_t count)
Write 16-bit buffer the SPI bus (only write transfer)
SPIClass(int port)
Create SPIClass object.
void transfer16(void *buf, size_t count)
Write 16-bit data to the SPI bus and also receive data.
void end(void)
Disable the SPI bus.
void setClockDivider(uint8_t clockDiv)
This function is deprecated. New applications should use beginTransaction() to configure SPI settings...
uint16_t transfer16(uint16_t data)
Write 16-bit data to the SPI bus and also receive 16-bit data.
void notUsingInterrupt(uint8_t interruptNumber)
Disable interrupt with the SPI library.
void selectCS(int cs)
Select chip select number (only for SPI3)
void setDataMode(uint8_t dataMode)
This function is deprecated. New applications should use beginTransaction() to configure SPI settings...
void disableCS()
Disable chip select by software (only for SPI3)
void begin(void)
Initialize the SPI library.
void send(void *buf, size_t count)
Write buffer to the SPI bus (only write transfer)
void endTransaction(void)
After performing a group of transfers and releasing the chip select signal, this function allows othe...
void enableCS()
Enable chip select by software (only for SPI3)
void beginTransaction(SPISettings settings)
Before using SPI.transfer() or asserting chip select pins, this function is used to gain exclusive ac...
void transfer(void *buf, size_t count)
Write data to the SPI bus and also receive data.
uint8_t transfer(uint8_t data)
Write 8-bit data to the SPI bus and also receive 8-bit data.
SPI settings.
Definition: SPI.h:99
SPISettings(uint32_t clock, uint8_t bitOrder, uint8_t dataMode)
Construct a new SPISettings object.
Definition: SPI.h:108
SPISettings()
Construct a new SPISettings object.
Definition: SPI.h:114
SpiInterruptMode
Spi interrupt mode.
Definition: SPI.h:80
#define SPI_MODE0
Definition: SPI.h:63
@ SPI_INT_MODE_MASK
Definition: SPI.h:82
@ SPI_INT_MODE_GLOBAL
Definition: SPI.h:83
@ SPI_INT_MODE_NONE
Definition: SPI.h:81