no-OS
adaq7980.h
Go to the documentation of this file.
1 /***************************************************************************/
33 #ifndef ADAQ7980_H_
34 #define ADAQ7980_H_
35 
36 /******************************************************************************/
37 /***************************** Include Files **********************************/
38 /******************************************************************************/
39 #include "spi_engine.h"
40 #include "no_os_pwm.h"
41 #include "no_os_gpio.h"
42 
43 /******************************************************************************/
44 /*************************** Types Declarations *******************************/
45 /******************************************************************************/
51  /* SPI */
53  /* SPI module offload init */
55  /* PWM generator init structure */
59 };
60 
65 struct adaq7980_dev {
66  /* SPI descriptor */
68  /* Trigger conversion PWM generator descriptor */
70  /* SPI module offload init */
74 };
75 
76 /******************************************************************************/
77 /************************ Functions Declarations ******************************/
78 /******************************************************************************/
79 /* Initialize the device. */
80 int32_t adaq7980_setup(struct adaq7980_dev **device,
82 
83 /* Read data from device */
84 int32_t ad7980_read_data(struct adaq7980_dev *dev,
85  uint16_t *buf,
86  uint16_t samples);
87 
88 #endif
no_os_alloc.h
no_os_gpio_init_param
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:79
spi_engine_offload_message::no_commands
uint32_t no_commands
Definition: spi_engine.h:165
no_os_pwm_init_param
Structure containing the init parameters needed by the PWM generator.
Definition: no_os_pwm.h:66
adaq7980_setup
int32_t adaq7980_setup(struct adaq7980_dev **device, struct adaq7980_init_param *init_param)
Definition: adaq7980.c:84
adaq7980_init_param
Structure containing the init parameters needed by the adaq7980 device.
Definition: adaq7980.h:50
adaq7980_init_param::gpio_pd_ldo
struct no_os_gpio_init_param * gpio_pd_ldo
Definition: adaq7980.h:58
adaq7980_init_param::offload_init_param
struct spi_engine_offload_init_param * offload_init_param
Definition: adaq7980.h:54
CS_LOW
#define CS_LOW
Definition: spi_engine.h:73
spi_engine_offload_init
int32_t spi_engine_offload_init(struct no_os_spi_desc *desc, const struct spi_engine_offload_init_param *param)
Initialize the SPI engine's offload module.
Definition: spi_engine.c:763
spi_engine_offload_message::commands_data
uint32_t * commands_data
Definition: spi_engine.h:167
no_os_delay.h
Header file of Delay functions.
spi_engine_offload_message
Structure representing an offload message.
Definition: spi_engine.h:158
device
Definition: ad9361_util.h:69
NO_OS_GPIO_HIGH
@ NO_OS_GPIO_HIGH
Definition: no_os_gpio.h:117
adaq7980_setup
int32_t adaq7980_setup(struct adaq7980_dev **device, struct adaq7980_init_param *init_param)
Definition: adaq7980.c:84
adaq7980_init_param::spi_init
struct no_os_spi_init_param * spi_init
Definition: adaq7980.h:52
NO_OS_ARRAY_SIZE
#define NO_OS_ARRAY_SIZE(x)
Definition: no_os_util.h:49
WRITE_READ
#define WRITE_READ(no_bytes)
Definition: spi_engine.h:65
NO_OS_GPIO_LOW
@ NO_OS_GPIO_LOW
Definition: no_os_gpio.h:115
adaq7980_dev::spi_desc
struct no_os_spi_desc * spi_desc
Definition: adaq7980.h:67
no_os_mdelay
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: aducm3029_delay.c:126
CS_HIGH
#define CS_HIGH
Definition: spi_engine.h:72
no_os_error.h
Error codes definition.
no_os_pwm_enable
int32_t no_os_pwm_enable(struct no_os_pwm_desc *desc)
Enable PWM signal generation.
Definition: no_os_pwm.c:98
ad7980_read_data
int32_t ad7980_read_data(struct adaq7980_dev *dev, uint16_t *buf, uint16_t samples)
Read from device. Enter register mode to read/write registers.
Definition: adaq7980.c:52
ad7616_init_param::offload_init_param
struct spi_engine_offload_init_param * offload_init_param
Definition: ad7616.h:205
adaq7980_dev::gpio_pd_ldo
struct no_os_gpio_desc * gpio_pd_ldo
Definition: adaq7980.h:73
ad7616_init_param::trigger_pwm_init
struct no_os_pwm_init_param * trigger_pwm_init
Definition: ad7616.h:207
spi_engine.h
adaq7980_init_param::trigger_pwm_init
struct no_os_pwm_init_param * trigger_pwm_init
Definition: adaq7980.h:56
ad7980_read_data
int32_t ad7980_read_data(struct adaq7980_dev *dev, uint16_t *buf, uint16_t samples)
Read from device. Enter register mode to read/write registers.
Definition: adaq7980.c:52
no_os_spi_desc
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
no_os_gpio_desc
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:96
spi_engine_offload_message::commands
uint32_t * commands
Definition: spi_engine.h:163
no_os_pwm_desc
Structure representing an PWM generator device.
Definition: no_os_pwm.h:93
no_os_pwm_init
int32_t no_os_pwm_init(struct no_os_pwm_desc **desc, const struct no_os_pwm_init_param *param)
Initialize the PWM peripheral.
Definition: no_os_pwm.c:51
no_os_malloc
void * no_os_malloc(size_t size)
Allocate memory and return a pointer to it.
Definition: chibios_alloc.c:43
adaq7980_dev::offload_init_param
struct spi_engine_offload_init_param * offload_init_param
Definition: adaq7980.h:71
no_os_pwm.h
Header file of PWM Interface.
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
no_os_gpio_set_value
int32_t no_os_gpio_set_value(struct no_os_gpio_desc *desc, uint8_t value)
Set the value of the specified GPIO.
Definition: no_os_gpio.c:197
init_param
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
spi_engine_offload_transfer
int32_t spi_engine_offload_transfer(struct no_os_spi_desc *desc, struct spi_engine_offload_message msg, uint32_t no_samples)
Initiate a SPI transfer in offload mode.
Definition: spi_engine.c:809
adaq7980_dev
Structure representing an adaq7980 device.
Definition: adaq7980.h:65
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:116
spi_engine_offload_init_param
Structure containing the init parameters needed by the offload module.
Definition: spi_engine.h:143
no_os_gpio.h
Header file of GPIO Interface.
adaq7980.h
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:52
spi_engine_offload_message::rx_addr
uint32_t rx_addr
Definition: spi_engine.h:171
no_os_gpio_direction_output
int32_t no_os_gpio_direction_output(struct no_os_gpio_desc *desc, uint8_t value)
Enable the output direction of the specified GPIO.
Definition: no_os_gpio.c:147
adaq7980_dev::trigger_pwm_desc
struct no_os_pwm_desc * trigger_pwm_desc
Definition: adaq7980.h:69
no_os_spi_init_param
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140
no_os_gpio_get_optional
int32_t no_os_gpio_get_optional(struct no_os_gpio_desc **desc, const struct no_os_gpio_init_param *param)
Get the value of an optional GPIO.
Definition: no_os_gpio.c:75