no-OS
aducm3029_spi.h
Go to the documentation of this file.
1 /***************************************************************************/
40 #ifndef ADUCM3029_SPI_H
41 # define ADUCM3029_SPI_H
42 
43 /******************************************************************************/
44 /***************************** Include Files **********************************/
45 /******************************************************************************/
46 
47 #include "no_os_spi.h"
48 #include <drivers/spi/adi_spi.h>
49 
50 /******************************************************************************/
51 /*************************** Types Declarations *******************************/
52 /******************************************************************************/
53 
63 };
64 
71  uint8_t buffer[ADI_SPI_MEMORY_SIZE];
73  ADI_SPI_HANDLE spi_handle;
75  uint32_t ref_instances;
77  uint32_t bitrate;
79  uint8_t cs;
86 };
87 
104  bool dma;
105 };
106 
110 extern const struct no_os_spi_platform_ops aducm_spi_ops;
111 
122 };
123 
124 #endif // ADUCM3029_SPI_H
no_os_spi_mode
no_os_spi_mode
SPI configuration for clock phase and polarity.
Definition: no_os_spi.h:64
aducm_device_desc::master_mode
enum master_mode master_mode
Definition: aducm3029_spi.h:83
no_os_spi_desc::device_id
uint32_t device_id
Definition: no_os_spi.h:145
NO_OS_SPI_CPOL
#define NO_OS_SPI_CPOL
Definition: no_os_spi.h:54
aducm_device_desc::cs
uint8_t cs
Definition: aducm3029_spi.h:79
NB_SPI_DEVICES
#define NB_SPI_DEVICES
Definition: aducm3029_spi.c:50
no_os_spi.h
Header file of SPI Interface.
aducm_spi_init_param::continuous_mode
bool continuous_mode
Definition: aducm3029_spi.h:97
aducm_device_desc::buffer
uint8_t buffer[ADI_SPI_MEMORY_SIZE]
Definition: aducm3029_spi.h:71
no_os_spi_platform_ops
Structure holding SPI function pointers that point to the platform specific function.
Definition: no_os_spi.h:166
aducm_spi_desc
SPI specific descriptor for the ADuCM3029. The structure is available in the extra parameter from spi...
Definition: aducm3029_spi.h:117
no_os_max
#define no_os_max(x, y)
Definition: no_os_util.h:68
no_os_spi_init_param::mode
enum no_os_spi_mode mode
Definition: no_os_spi.h:129
aducm_spi_init_param
Configuration structure sent in the extra parameter from no_os_spi_init_param.
Definition: aducm3029_spi.h:93
aducm3029_spi_write_and_read
int32_t aducm3029_spi_write_and_read(struct no_os_spi_desc *desc, uint8_t *data, uint16_t bytes_number)
Write and read data to/from SPI. If bytes number is 0 the function will return failure.
Definition: aducm3029_spi.c:227
no_os_spi_init_param::device_id
uint32_t device_id
Definition: no_os_spi.h:123
no_os_spi_init_param::chip_select
uint8_t chip_select
Definition: no_os_spi.h:127
no_os_spi_desc::chip_select
uint8_t chip_select
Definition: no_os_spi.h:149
no_os_error.h
Error codes definition.
MAX_CS_NUMBER
#define MAX_CS_NUMBER
Definition: aducm3029_spi.c:51
aducm_device_desc::spi_handle
ADI_SPI_HANDLE spi_handle
Definition: aducm3029_spi.h:73
aducm_spi_desc::dev
struct aducm_device_desc * dev
Definition: aducm3029_spi.h:121
aducm_device_desc::bitrate
uint32_t bitrate
Definition: aducm3029_spi.h:77
aducm_spi_init_param::dma
bool dma
Definition: aducm3029_spi.h:104
no_os_spi_desc
Structure holding SPI descriptor.
Definition: no_os_spi.h:143
aducm_spi_ops
const struct no_os_spi_platform_ops aducm_spi_ops
ADuCM3029 platform specific SPI platform ops structure.
Definition: aducm3029_spi.c:287
no_os_spi_desc::extra
void * extra
Definition: no_os_spi.h:156
aducm_spi_init_param::master_mode
enum master_mode master_mode
Definition: aducm3029_spi.h:95
no_os_spi_init_param::max_speed_hz
uint32_t max_speed_hz
Definition: no_os_spi.h:125
aducm_device_desc::mode
enum no_os_spi_mode mode
Definition: aducm3029_spi.h:81
aducm3029_spi_init
int32_t aducm3029_spi_init(struct no_os_spi_desc **desc, const struct no_os_spi_init_param *param)
Initialize the SPI communication peripheral.
Definition: aducm3029_spi.c:126
NULL
#define NULL
Definition: wrapper.h:64
aducm_spi_init_param::half_duplex
bool half_duplex
Definition: aducm3029_spi.h:99
aducm_spi_ops
const struct no_os_spi_platform_ops aducm_spi_ops
ADuCM3029 specific SPI platform ops structure.
Definition: aducm3029_spi.c:287
SLAVE
@ SLAVE
Definition: aducm3029_spi.h:60
aducm_device_desc::ref_instances
uint32_t ref_instances
Definition: aducm3029_spi.h:75
aducm3029_spi_remove
int32_t aducm3029_spi_remove(struct no_os_spi_desc *desc)
Free the resources allocated by no_os_spi_init().
Definition: aducm3029_spi.c:196
aducm_device_desc
Structure describing the physical SPI devices.
Definition: aducm3029_spi.h:69
master_mode
master_mode
Available operations mode for a SPI channel.
Definition: aducm3029_spi.h:58
MASTER
@ MASTER
Definition: aducm3029_spi.h:62
aducm3029_spi.h
ADuCM302x specific header for SPI driver.
no_os_spi_desc::max_speed_hz
uint32_t max_speed_hz
Definition: no_os_spi.h:147
aducm_spi_desc::aducm_conf
struct aducm_spi_init_param aducm_conf
Definition: aducm3029_spi.h:119
no_os_util.h
Header file of utility functions.
NO_OS_SPI_CPHA
#define NO_OS_SPI_CPHA
Definition: no_os_spi.h:53
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:168
no_os_spi_init_param::extra
void * extra
Definition: no_os_spi.h:134
no_os_spi_desc::mode
enum no_os_spi_mode mode
Definition: no_os_spi.h:151
aducm_device_desc::continuous_mode
bool continuous_mode
Definition: aducm3029_spi.h:85
no_os_spi_init_param
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:121