Go to the documentation of this file.
47 #define NO_OS_SPI_CPHA 0x01
48 #define NO_OS_SPI_CPOL 0x02
49 #define SPI_MAX_BUS_NUMBER 8
239 uint32_t, void (*)(
void *),
void *);
258 uint16_t bytes_number);
276 void (*callback)(
void *),
286 #endif // _NO_OS_SPI_H_
@ NO_OS_SPI_MODE_1
Definition: no_os_spi.h:63
@ NO_OS_SPI_QUAD_LANE
Definition: no_os_spi.h:91
void * mutex
Definition: no_os_spi.h:169
no_os_spi_mode
SPI configuration for clock phase and polarity.
Definition: no_os_spi.h:59
uint32_t device_id
Definition: no_os_spi.h:196
#define NO_OS_SPI_CPOL
Definition: no_os_spi.h:48
enum no_os_spi_bit_order bit_order
Definition: no_os_spi.h:150
int32_t no_os_spi_write_and_read(struct no_os_spi_desc *desc, uint8_t *data, uint16_t bytes_number)
Write and read data to/from SPI.
Definition: no_os_spi.c:159
enum no_os_spi_mode mode
Definition: no_os_spi.h:177
enum no_os_spi_bit_order bit_order
Definition: no_os_spi.h:179
Definition: no_os_spi.h:100
enum no_os_spi_lanes lanes
Definition: no_os_spi.h:206
uint32_t cs_delay_last
Definition: no_os_spi.h:117
enum no_os_spi_mode mode
Definition: no_os_spi.h:148
uint8_t slave_number
Definition: no_os_spi.h:171
@ NO_OS_SPI_MODE_2
Definition: no_os_spi.h:65
no_os_spi_bit_order
SPI configuration for bit order (MSB/LSB).
Definition: no_os_spi.h:74
int32_t no_os_spi_transfer_dma_sync(struct no_os_spi_desc *desc, struct no_os_spi_msg *msgs, uint32_t len)
Transfer a list of messages using DMA and busy wait for the completion.
Definition: no_os_spi.c:224
uint32_t device_id
Definition: no_os_spi.h:173
const struct no_os_spi_platform_ops * platform_ops
Definition: no_os_spi.h:183
@ NO_OS_SPI_OCTO_LANE
Definition: no_os_spi.h:93
const struct no_os_spi_platform_ops * platform_ops
Definition: no_os_spi.h:154
@ NO_OS_SPI_MODE_3
Definition: no_os_spi.h:67
uint8_t * tx_buff
Definition: no_os_spi.h:102
uint32_t device_id
Definition: no_os_spi.h:142
uint8_t chip_select
Definition: no_os_spi.h:146
uint8_t chip_select
Definition: no_os_spi.h:200
struct no_os_platform_spi_delays platform_delays
Definition: no_os_spi.h:156
struct no_os_spi_desc * parent
Definition: no_os_spi.h:214
uint8_t * rx_buff
Definition: no_os_spi.h:104
uint32_t cs_delay_first
Definition: no_os_spi.h:115
enum no_os_spi_lanes lanes
Definition: no_os_spi.h:152
uint8_t cs_change
Definition: no_os_spi.h:108
@ NO_OS_SPI_SINGLE_LANE
Definition: no_os_spi.h:87
enum no_os_spi_lanes lanes
Definition: no_os_spi.h:181
struct no_os_spi_desc * parent
Definition: no_os_spi.h:160
enum no_os_spi_bit_order bit_order
Definition: no_os_spi.h:204
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
uint32_t max_speed_hz
Definition: no_os_spi.h:175
int32_t no_os_spi_transfer(struct no_os_spi_desc *desc, struct no_os_spi_msg *msgs, uint32_t len)
Iterate over head list and send all spi messages.
Definition: no_os_spi.c:185
uint32_t bytes_number
Definition: no_os_spi.h:106
void * extra
Definition: no_os_spi.h:212
uint32_t cs_change_delay
Definition: no_os_spi.h:113
uint32_t max_speed_hz
Definition: no_os_spi.h:144
struct no_os_spibus_desc * bus
Definition: no_os_spi.h:194
int32_t no_os_spi_transfer_dma_async(struct no_os_spi_desc *desc, struct no_os_spi_msg *msgs, uint32_t len, void(*callback)(void *), void *ctx)
Transfer a list of messages using DMA. The function will return after the first transfer is started....
Definition: no_os_spi.c:248
@ NO_OS_SPI_BIT_ORDER_LSB_FIRST
Definition: no_os_spi.h:78
@ NO_OS_SPI_BIT_ORDER_MSB_FIRST
Definition: no_os_spi.h:76
void * extra
Definition: no_os_spi.h:185
int32_t no_os_spi_remove(struct no_os_spi_desc *desc)
Free the resources allocated by no_os_spi_init().
Definition: no_os_spi.c:116
const struct no_os_spi_platform_ops * platform_ops
Definition: no_os_spi.h:208
no_os_spi_lanes
SPI configuration for number of lanes.
Definition: no_os_spi.h:85
struct no_os_platform_spi_delays platform_delays
Definition: no_os_spi.h:210
uint32_t max_speed_hz
Definition: no_os_spi.h:198
int32_t no_os_spi_init(struct no_os_spi_desc **desc, const struct no_os_spi_init_param *param)
Initialize the SPI communication peripheral.
Definition: no_os_spi.c:52
SPI bus descriptor.
Definition: no_os_spi.h:167
#define NO_OS_SPI_CPHA
Definition: no_os_spi.h:47
void no_os_spibus_remove(uint32_t bus_number)
Removes SPI bus instance.
Definition: no_os_spi.c:133
void * extra
Definition: no_os_spi.h:158
@ NO_OS_SPI_MODE_0
Definition: no_os_spi.h:61
enum no_os_spi_mode mode
Definition: no_os_spi.h:202
@ NO_OS_SPI_DUAL_LANE
Definition: no_os_spi.h:89
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140
int32_t no_os_spibus_init(const struct no_os_spi_init_param *param)
Initialize the SPI bus communication peripheral.
Definition: no_os_spi.c:88