no-OS
demux_spi.h
Go to the documentation of this file.
1 /***************************************************************************/
40 #ifndef SRC_DEMUX_SPI_H_
41 #define SRC_DEMUX_SPI_H_
42 
43 /******************************************************************************/
44 /***************************** Include Files **********************************/
45 /******************************************************************************/
46 
47 #include "no_os_spi.h"
48 
49 /******************************************************************************/
50 /********************** Macros and Constants Definitions **********************/
51 /******************************************************************************/
52 
53 #define CS_OFFSET 0x80
54 
55 /******************************************************************************/
56 /*************************** Types Declarations *******************************/
57 /******************************************************************************/
58 
64 
65 /******************************************************************************/
66 /************************ Functions Declarations ******************************/
67 /******************************************************************************/
68 
69 /* Initialize the SPI communication peripheral. */
70 int32_t demux_spi_init(struct no_os_spi_desc **desc,
71  const struct no_os_spi_init_param *param);
72 
73 /* Free the resources allocated by no_os_spi_init(). */
74 int32_t demux_spi_remove(struct no_os_spi_desc *desc);
75 
76 /* Write and read data to/from SPI. */
77 int32_t demux_spi_write_and_read(struct no_os_spi_desc *desc, uint8_t *data,
78  uint16_t bytes_number);
79 
80 #endif /* SRC_DEMUX_SPI_H_ */
demux_spi_remove
int32_t demux_spi_remove(struct no_os_spi_desc *desc)
Free the resources allocated by demux_spi_init().
Definition: demux_spi.c:108
no_os_spi_write_and_read
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:82
no_os_spi.h
Header file of SPI Interface.
demux_spi_remove
int32_t demux_spi_remove(struct no_os_spi_desc *desc)
Free the resources allocated by demux_spi_init().
Definition: demux_spi.c:108
no_os_spi_platform_ops
Structure holding SPI function pointers that point to the platform specific function.
Definition: no_os_spi.h:153
no_os_spi_init_param::mode
enum no_os_spi_mode mode
Definition: no_os_spi.h:120
demux_spi_init
int32_t demux_spi_init(struct no_os_spi_desc **desc, const struct no_os_spi_init_param *param)
Initialize the SPI demux layer.
Definition: demux_spi.c:68
demux_spi.h
Header file of SPI Demux Interface.
CS_OFFSET
#define CS_OFFSET
Definition: demux_spi.h:53
no_os_spi_init_param::chip_select
uint8_t chip_select
Definition: no_os_spi.h:118
no_os_spi_desc::chip_select
uint8_t chip_select
Definition: no_os_spi.h:138
no_os_error.h
Error codes definition.
demux_spi_platform_ops
const struct no_os_spi_platform_ops demux_spi_platform_ops
Demux specific SPI platform ops structure.
Definition: demux_spi.c:56
no_os_spi_desc
Structure holding SPI descriptor.
Definition: no_os_spi.h:132
no_os_spi_desc::extra
void * extra
Definition: no_os_spi.h:145
no_os_spi_init_param::max_speed_hz
uint32_t max_speed_hz
Definition: no_os_spi.h:116
demux_spi_init
int32_t demux_spi_init(struct no_os_spi_desc **desc, const struct no_os_spi_init_param *param)
Initialize the SPI demux layer.
Definition: demux_spi.c:68
no_os_spi_remove
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:70
no_os_spi_desc::max_speed_hz
uint32_t max_speed_hz
Definition: no_os_spi.h:136
no_os_spi_init
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:51
demux_spi_write_and_read
int32_t demux_spi_write_and_read(struct no_os_spi_desc *desc, uint8_t *data, uint16_t bytes_number)
Write and read data to/from SPI demux layer.
Definition: demux_spi.c:128
no_os_spi_platform_ops::init
int32_t(* init)(struct no_os_spi_desc **, const struct no_os_spi_init_param *)
Definition: no_os_spi.h:155
no_os_spi_init_param::extra
void * extra
Definition: no_os_spi.h:125
no_os_spi_desc::mode
enum no_os_spi_mode mode
Definition: no_os_spi.h:140
demux_spi_write_and_read
int32_t demux_spi_write_and_read(struct no_os_spi_desc *desc, uint8_t *data, uint16_t bytes_number)
Write and read data to/from SPI demux layer.
Definition: demux_spi.c:128
demux_spi_platform_ops
const struct no_os_spi_platform_ops demux_spi_platform_ops
Demux specific SPI platform ops structure.
Definition: demux_spi.c:56
no_os_spi_init_param
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:112