no-OS
spi_extra.h
Go to the documentation of this file.
1 /***************************************************************************/
40 #ifndef SPI_EXTRA_H
41 # define SPI_EXTRA_H
42 
43 /******************************************************************************/
44 /***************************** Include Files **********************************/
45 /******************************************************************************/
46 
47 #include "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;
81  enum spi_mode mode;
86 };
87 
104  bool dma;
105 };
106 
117 };
118 
119 #endif // SPI_EXTRA_H_
IS_ERR_VALUE
#define IS_ERR_VALUE(x)
Definition: error.h:65
spi_init
int32_t spi_init(struct spi_desc **desc, const struct spi_init_param *param)
Initialize the SPI communication peripheral.
Definition: spi.c:124
spi_mode
spi_mode
SPI configuration for clock phase and polarity.
Definition: spi.h:64
spi_desc::max_speed_hz
uint32_t max_speed_hz
Definition: spi.h:136
aducm_device_desc::master_mode
enum master_mode master_mode
Definition: spi_extra.h:83
spi_desc::chip_select
uint8_t chip_select
Definition: spi.h:138
master_mode
master_mode
Available operations mode for a SPI channel.
Definition: spi_extra.h:58
aducm_device_desc::cs
uint8_t cs
Definition: spi_extra.h:79
spi_desc
Structure holding SPI descriptor.
Definition: spi.h:132
spi_platform_ops::transfer
int32_t(* transfer)(struct spi_desc *, struct spi_msg *, uint32_t)
Definition: spi.h:159
aducm_spi_init_param::continuous_mode
bool continuous_mode
Definition: spi_extra.h:97
spi.h
Header file of SPI Interface.
aducm_device_desc::buffer
uint8_t buffer[ADI_SPI_MEMORY_SIZE]
Definition: spi_extra.h:71
spi_init_param::extra
void * extra
Definition: spi.h:125
aducm_spi_desc
SPI specific descriptor for the ADuCM3029. The structure is available in the extra parameter from spi...
Definition: spi_extra.h:112
spi_init_param::max_speed_hz
uint32_t max_speed_hz
Definition: spi.h:116
spi_desc::platform_ops
const struct spi_platform_ops * platform_ops
Definition: spi.h:143
aducm_spi_init_param
Configuration structure sent in the extra parameter from spi_init_param.
Definition: spi_extra.h:93
SPI_CPHA
#define SPI_CPHA
Definition: spi.h:53
spi_msg
Definition: spi.h:90
SPI_CPOL
#define SPI_CPOL
Definition: spi.h:54
NB_SPI_DEVICES
#define NB_SPI_DEVICES
Definition: spi.c:50
spi_desc
struct spi_desc spi_desc
spi_extra.h
ADuCM302x specific header for SPI driver.
spi_write_and_read
int32_t spi_write_and_read(struct 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: spi.c:225
spi_desc::device_id
uint32_t device_id
Definition: spi.h:134
spi_platform_ops::remove
int32_t(* remove)(struct spi_desc *)
Definition: spi.h:161
spi_transfer
int32_t spi_transfer(struct spi_desc *desc, struct spi_msg *msgs, uint32_t len)
Iterate over head list and send all spi messages.
Definition: spi.c:96
aducm_device_desc::spi_handle
ADI_SPI_HANDLE spi_handle
Definition: spi_extra.h:73
spi_desc::mode
enum spi_mode mode
Definition: spi.h:140
aducm_spi_desc::dev
struct aducm_device_desc * dev
Definition: spi_extra.h:116
MASTER
@ MASTER
Definition: spi_extra.h:62
aducm_device_desc::bitrate
uint32_t bitrate
Definition: spi_extra.h:77
spi_init_param
Structure holding the parameters for SPI initialization.
Definition: spi.h:112
aducm_spi_init_param::dma
bool dma
Definition: spi_extra.h:104
error.h
Error codes definition.
spi_platform_ops::init
int32_t(* init)(struct spi_desc **, const struct spi_init_param *)
Definition: spi.h:155
spi_init_param::mode
enum spi_mode mode
Definition: spi.h:120
aducm_spi_init_param::master_mode
enum master_mode master_mode
Definition: spi_extra.h:95
spi_platform_ops::write_and_read
int32_t(* write_and_read)(struct spi_desc *, uint8_t *, uint16_t)
Definition: spi.h:157
spi_init_param::platform_ops
const struct spi_platform_ops * platform_ops
Definition: spi.h:123
NULL
#define NULL
Definition: wrapper.h:64
aducm_spi_init_param::half_duplex
bool half_duplex
Definition: spi_extra.h:99
SUCCESS
#define SUCCESS
Definition: error.h:52
aducm_device_desc::ref_instances
uint32_t ref_instances
Definition: spi_extra.h:75
max
#define max(x, y)
Definition: util.h:68
aducm_device_desc
Structure describing the physical SPI devices.
Definition: spi_extra.h:69
aducm_device_desc::mode
enum spi_mode mode
Definition: spi_extra.h:81
spi_init_param::chip_select
uint8_t chip_select
Definition: spi.h:118
spi_desc::extra
void * extra
Definition: spi.h:145
SLAVE
@ SLAVE
Definition: spi_extra.h:60
spi_remove
int32_t spi_remove(struct spi_desc *desc)
Free the resources allocated by spi_init().
Definition: spi.c:194
aducm_spi_desc::aducm_conf
struct aducm_spi_init_param aducm_conf
Definition: spi_extra.h:114
spi_init_param::device_id
uint32_t device_id
Definition: spi.h:114
MAX_CS_NUMBER
#define MAX_CS_NUMBER
Definition: spi.c:51
util.h
Implementation of utility functions.
FAILURE
#define FAILURE
Definition: error.h:56
aducm_device_desc::continuous_mode
bool continuous_mode
Definition: spi_extra.h:85