no-OS
aducm3029_spi.h
Go to the documentation of this file.
1 /***************************************************************************/
34 #ifndef ADUCM3029_SPI_H
35 # define ADUCM3029_SPI_H
36 
37 /******************************************************************************/
38 /***************************** Include Files **********************************/
39 /******************************************************************************/
40 
41 #include "no_os_spi.h"
42 #include <drivers/spi/adi_spi.h>
43 
44 /******************************************************************************/
45 /*************************** Types Declarations *******************************/
46 /******************************************************************************/
47 
57 };
58 
65  uint8_t buffer[ADI_SPI_MEMORY_SIZE];
67  ADI_SPI_HANDLE spi_handle;
69  uint32_t ref_instances;
71  uint32_t bitrate;
73  uint8_t cs;
80 };
81 
98  bool dma;
99 };
100 
104 extern const struct no_os_spi_platform_ops aducm_spi_ops;
105 
116 };
117 
118 #endif // ADUCM3029_SPI_H
no_os_alloc.h
no_os_spi_mode
no_os_spi_mode
SPI configuration for clock phase and polarity.
Definition: no_os_spi.h:59
aducm_device_desc::master_mode
enum master_mode master_mode
Definition: aducm3029_spi.h:77
no_os_spi_desc::device_id
uint32_t device_id
Definition: no_os_spi.h:196
NO_OS_SPI_CPOL
#define NO_OS_SPI_CPOL
Definition: no_os_spi.h:48
aducm_device_desc::cs
uint8_t cs
Definition: aducm3029_spi.h:73
NB_SPI_DEVICES
#define NB_SPI_DEVICES
Definition: aducm3029_spi.c:45
no_os_spi.h
Header file of SPI Interface.
aducm_spi_init_param::continuous_mode
bool continuous_mode
Definition: aducm3029_spi.h:91
aducm_device_desc::buffer
uint8_t buffer[ADI_SPI_MEMORY_SIZE]
Definition: aducm3029_spi.h:65
no_os_spi_platform_ops
Structure holding SPI function pointers that point to the platform specific function.
Definition: no_os_spi.h:222
aducm_spi_desc
SPI specific descriptor for the ADuCM3029. The structure is available in the extra parameter from spi...
Definition: aducm3029_spi.h:111
no_os_max
#define no_os_max(x, y)
Definition: no_os_util.h:64
no_os_spi_init_param::mode
enum no_os_spi_mode mode
Definition: no_os_spi.h:148
aducm_spi_init_param
Configuration structure sent in the extra parameter from no_os_spi_init_param.
Definition: aducm3029_spi.h:87
no_os_calloc
void * no_os_calloc(size_t nitems, size_t size)
Allocate memory and return a pointer to it, set memory to 0.
Definition: chibios_alloc.c:54
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:222
no_os_spi_init_param::device_id
uint32_t device_id
Definition: no_os_spi.h:142
no_os_spi_init_param::chip_select
uint8_t chip_select
Definition: no_os_spi.h:146
no_os_spi_desc::chip_select
uint8_t chip_select
Definition: no_os_spi.h:200
no_os_error.h
Error codes definition.
MAX_CS_NUMBER
#define MAX_CS_NUMBER
Definition: aducm3029_spi.c:46
aducm_device_desc::spi_handle
ADI_SPI_HANDLE spi_handle
Definition: aducm3029_spi.h:67
aducm_spi_desc::dev
struct aducm_device_desc * dev
Definition: aducm3029_spi.h:115
aducm_device_desc::bitrate
uint32_t bitrate
Definition: aducm3029_spi.h:71
aducm_spi_init_param::dma
bool dma
Definition: aducm3029_spi.h:98
no_os_spi_desc
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
aducm_spi_ops
const struct no_os_spi_platform_ops aducm_spi_ops
ADuCM3029 platform specific SPI platform ops structure.
Definition: aducm3029_spi.c:282
no_os_spi_desc::extra
void * extra
Definition: no_os_spi.h:212
aducm_spi_init_param::master_mode
enum master_mode master_mode
Definition: aducm3029_spi.h:89
no_os_spi_init_param::max_speed_hz
uint32_t max_speed_hz
Definition: no_os_spi.h:144
aducm_device_desc::mode
enum no_os_spi_mode mode
Definition: aducm3029_spi.h:75
no_os_free
void no_os_free(void *ptr)
Deallocate memory previously allocated by a call to no_os_calloc or no_os_malloc.
Definition: chibios_alloc.c:69
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:121
NULL
#define NULL
Definition: wrapper.h:64
aducm_spi_init_param::half_duplex
bool half_duplex
Definition: aducm3029_spi.h:93
aducm_spi_ops
const struct no_os_spi_platform_ops aducm_spi_ops
ADuCM3029 specific SPI platform ops structure.
Definition: aducm3029_spi.c:282
SLAVE
@ SLAVE
Definition: aducm3029_spi.h:54
aducm_device_desc::ref_instances
uint32_t ref_instances
Definition: aducm3029_spi.h:69
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:191
aducm_device_desc
Structure describing the physical SPI devices.
Definition: aducm3029_spi.h:63
master_mode
master_mode
Available operations mode for a SPI channel.
Definition: aducm3029_spi.h:52
MASTER
@ MASTER
Definition: aducm3029_spi.h:56
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:198
aducm_spi_desc::aducm_conf
struct aducm_spi_init_param aducm_conf
Definition: aducm3029_spi.h:113
no_os_util.h
Header file of utility functions.
NO_OS_SPI_CPHA
#define NO_OS_SPI_CPHA
Definition: no_os_spi.h:47
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:224
no_os_spi_init_param::extra
void * extra
Definition: no_os_spi.h:158
no_os_spi_desc::mode
enum no_os_spi_mode mode
Definition: no_os_spi.h:202
aducm_device_desc::continuous_mode
bool continuous_mode
Definition: aducm3029_spi.h:79
no_os_spi_init_param
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140