libwebsockets
Lightweight C library for HTML5 websockets
lws-spi.h File Reference
#include <stdint.h>
#include <stddef.h>
+ Include dependency graph for lws-spi.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  lws_spi_desc
 
struct  lws_spi_ops
 

Typedefs

typedef int(* lws_spi_cb_t) (void *opaque)
 
typedef struct lws_spi_desc lws_spi_desc_t
 
typedef struct lws_spi_ops lws_spi_ops_t
 

Enumerations

enum  {
  LWSSPIMODE_CPOL = (1 << 0) , LWSSPIMODE_CPHA = (1 << 1) , LWS_SPI_BUSMODE_CLK_IDLE_LOW_SAMP_RISING = 0 , LWS_SPI_BUSMODE_CLK_IDLE_HIGH_SAMP_RISING = LWSSPIMODE_CPOL ,
  LWS_SPI_BUSMODE_CLK_IDLE_LOW_SAMP_FALLING = LWSSPIMODE_CPHA , LWS_SPI_BUSMODE_CLK_IDLE_HIGH_SAMP_FALLING , LWS_SPI_TXN_HALF_DUPLEX_DISCRETE = 0 , LWS_SPI_FLAG_DATA_CONTINUE = (1 << 0) ,
  LWS_SPI_FLAG_DC_CMD_IS_HIGH = (1 << 1) , LWS_SPI_FLAG_DMA_BOUNCE_NOT_NEEDED = (1 << 2)
}
 

Functions

LWS_VISIBLE LWS_EXTERN int lws_spi_table_issue (const lws_spi_ops_t *spi_ops, uint32_t flags, const uint8_t *p, size_t len)
 
LWS_VISIBLE LWS_EXTERN int lws_spi_readback (const lws_spi_ops_t *spi_ops, uint32_t flags, const uint8_t *p, size_t len, uint8_t *rb, size_t rb_len)
 

Data Structure Documentation

◆ lws_spi_desc

struct lws_spi_desc

Definition at line 61 of file lws-spi.h.

+ Collaboration diagram for lws_spi_desc:
Data Fields
const uint8_t * src
const uint8_t * data
uint8_t * dest
void * opaque
lws_spi_cb_t completion_cb
uint16_t count_cmd
uint16_t count_write
uint16_t count_read
uint8_t txn_type
uint8_t channel
uint8_t flags

Typedef Documentation

◆ lws_spi_cb_t

typedef int(* lws_spi_cb_t) (void *opaque)

Definition at line 37 of file lws-spi.h.

◆ lws_spi_desc_t

typedef struct lws_spi_desc lws_spi_desc_t

◆ lws_spi_ops_t

typedef struct lws_spi_ops lws_spi_ops_t

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
LWSSPIMODE_CPOL 
LWSSPIMODE_CPHA 
LWS_SPI_BUSMODE_CLK_IDLE_LOW_SAMP_RISING 
LWS_SPI_BUSMODE_CLK_IDLE_HIGH_SAMP_RISING 
LWS_SPI_BUSMODE_CLK_IDLE_LOW_SAMP_FALLING 
LWS_SPI_BUSMODE_CLK_IDLE_HIGH_SAMP_FALLING 
LWS_SPI_TXN_HALF_DUPLEX_DISCRETE 

separate MISO and MOSI, but only either MISO or MOSI has data at one time... i2c style in SPI

LWS_SPI_FLAG_DATA_CONTINUE 

leave without finalizing the SPI transaction

LWS_SPI_FLAG_DC_CMD_IS_HIGH 

It's normally 0 for cmd phase, invert with this flag

LWS_SPI_FLAG_DMA_BOUNCE_NOT_NEEDED 

It's normally 0 for cmd phase, invert with this flag

Definition at line 39 of file lws-spi.h.

39  {
40  LWSSPIMODE_CPOL = (1 << 0),
41  LWSSPIMODE_CPHA = (1 << 1),
42 
48 
53  LWS_SPI_FLAG_DATA_CONTINUE = (1 << 0),
55  LWS_SPI_FLAG_DC_CMD_IS_HIGH = (1 << 1),
59 };
@ LWS_SPI_BUSMODE_CLK_IDLE_LOW_SAMP_RISING
Definition: lws-spi.h:43
@ LWS_SPI_FLAG_DMA_BOUNCE_NOT_NEEDED
Definition: lws-spi.h:57
@ LWS_SPI_FLAG_DC_CMD_IS_HIGH
Definition: lws-spi.h:55
@ LWSSPIMODE_CPOL
Definition: lws-spi.h:40
@ LWS_SPI_BUSMODE_CLK_IDLE_LOW_SAMP_FALLING
Definition: lws-spi.h:45
@ LWS_SPI_BUSMODE_CLK_IDLE_HIGH_SAMP_RISING
Definition: lws-spi.h:44
@ LWS_SPI_TXN_HALF_DUPLEX_DISCRETE
Definition: lws-spi.h:49
@ LWSSPIMODE_CPHA
Definition: lws-spi.h:41
@ LWS_SPI_FLAG_DATA_CONTINUE
Definition: lws-spi.h:53
@ LWS_SPI_BUSMODE_CLK_IDLE_HIGH_SAMP_FALLING
Definition: lws-spi.h:46

Function Documentation

◆ lws_spi_table_issue()

LWS_VISIBLE LWS_EXTERN int lws_spi_table_issue ( const lws_spi_ops_t spi_ops,
uint32_t  flags,
const uint8_t p,
size_t  len 
)

◆ lws_spi_readback()

LWS_VISIBLE LWS_EXTERN int lws_spi_readback ( const lws_spi_ops_t spi_ops,
uint32_t  flags,
const uint8_t p,
size_t  len,
uint8_t rb,
size_t  rb_len 
)