Go to the documentation of this file.
48 #define AD7780_RDY_STATE(value) no_os_gpio_get_value(dev->gpio_miso, \
52 #define AD7780_PDRST_PIN_OUT no_os_gpio_direction_output(dev->gpio_pdrst, \
54 #define AD7780_PDRST_HIGH no_os_gpio_set_value(dev->gpio_pdrst, \
56 #define AD7780_PDRST_LOW no_os_gpio_set_value(dev->gpio_pdrst, \
60 #define AD7780_FILTER_PIN_OUT no_os_gpio_direction_output(dev->gpio_filter, \
62 #define AD7780_FILTER_HIGH no_os_gpio_set_value(dev->gpio_filter, \
64 #define AD7780_FILTER_LOW no_os_gpio_set_value(dev->gpio_filter, \
68 #define AD7780_GAIN_PIN_OUT no_os_gpio_direction_output(dev->gpio_gain, \
70 #define AD7780_GAIN_HIGH no_os_gpio_set_value(dev->gpio_gain, \
72 #define AD7780_GAIN_LOW no_os_gpio_set_value(dev->gpio_gain, \
76 #define AD7780_STAT_RDY (1 << 7) // Ready bit.
77 #define AD7780_STAT_FILTER (1 << 6) // Filter bit.
78 #define AD7780_STAT_ERR (1 << 5) // Error bit.
79 #define AD7780_STAT_ID1 (1 << 4) // ID bits.
80 #define AD7780_STAT_ID0 (1 << 3) // ID bits.
81 #define AD7780_STAT_GAIN (1 << 2) // Gain bit.
82 #define AD7780_STAT_PAT1 (1 << 1) // Status pattern bits.
83 #define AD7780_STAT_PAT0 (1 << 0) // Status pattern bits.
85 #define AD7780_ID_NUMBER 0x08
#define AD7780_PDRST_HIGH
Definition: ad7780.h:54
struct no_os_gpio_init_param gpio_filter
Definition: ad7780.h:107
uint32_t timeout
Definition: ad413x.c:49
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:79
#define AD7780_FILTER_PIN_OUT
Definition: ad7780.h:60
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:159
Header file of SPI Interface.
struct no_os_spi_init_param spi_init
Definition: ad7780.h:103
int32_t ad7780_read_sample(struct ad7780_dev *dev, uint8_t *p_status)
Reads a 24-bit sample from the ADC.
Definition: ad7780.c:163
struct no_os_gpio_init_param gpio_gain
Definition: ad7780.h:108
#define AD7780_RDY_STATE(value)
Definition: ad7780.h:48
Definition: ad9361_util.h:69
int8_t ad7780_init(struct ad7780_dev **device, struct ad7780_init_param init_param)
Initializes the communication peripheral and the initial Values for AD7780 Board and checks if the de...
Definition: ad7780.c:59
int32_t no_os_gpio_direction_input(struct no_os_gpio_desc *desc)
Enable the input direction of the specified GPIO.
Definition: no_os_gpio.c:124
int8_t ad7780_wait_rdy_go_low(struct ad7780_dev *dev)
Waits for DOUT/RDY pin to go low.
Definition: ad7780.c:139
#define AD7780_STAT_ID1
Definition: ad7780.h:79
struct no_os_gpio_init_param gpio_pdrst
Definition: ad7780.h:105
int8_t ad7780_init(struct ad7780_dev **device, struct ad7780_init_param init_param)
Initializes the communication peripheral and the initial Values for AD7780 Board and checks if the de...
Definition: ad7780.c:59
#define AD7780_GAIN_PIN_OUT
Definition: ad7780.h:68
int32_t ad7780_remove(struct ad7780_dev *dev)
Free the resources allocated by ad7780_init().
Definition: ad7780.c:114
struct no_os_gpio_desc * gpio_pdrst
Definition: ad7780.h:95
int32_t no_os_gpio_remove(struct no_os_gpio_desc *desc)
Free the resources allocated by no_os_gpio_get().
Definition: no_os_gpio.c:104
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
int32_t ad7780_remove(struct ad7780_dev *dev)
Free the resources allocated by ad7780_init().
Definition: ad7780.c:114
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:96
#define AD7780_FILTER_LOW
Definition: ad7780.h:64
int32_t no_os_gpio_get(struct no_os_gpio_desc **desc, const struct no_os_gpio_init_param *param)
Obtain the GPIO decriptor.
Definition: no_os_gpio.c:49
void * no_os_malloc(size_t size)
Allocate memory and return a pointer to it.
Definition: chibios_alloc.c:43
#define AD7780_ID_NUMBER
Definition: ad7780.h:85
int32_t ad7780_read_sample(struct ad7780_dev *dev, uint8_t *p_status)
Reads a 24-bit sample from the ADC.
Definition: ad7780.c:163
struct no_os_gpio_desc * gpio_gain
Definition: ad7780.h:98
#define AD7780_PDRST_LOW
Definition: ad7780.h:56
float ad7780_convert_to_voltage(uint32_t raw_sample, float v_ref, uint8_t gain)
Converts the 24-bit raw value to milivolts.
Definition: ad7780.c:189
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
struct no_os_spi_desc * spi_desc
Definition: ad7780.h:93
#define AD7780_STAT_ID0
Definition: ad7780.h:80
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
int8_t ad7780_wait_rdy_go_low(struct ad7780_dev *dev)
Waits for DOUT/RDY pin to go low.
Definition: ad7780.c:139
struct no_os_gpio_init_param gpio_miso
Definition: ad7780.h:106
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
float ad7780_convert_to_voltage(uint32_t raw_sample, float v_ref, uint8_t gain)
Converts the 24-bit raw value to milivolts.
Definition: ad7780.c:189
Header file of GPIO Interface.
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
#define AD7780_PDRST_PIN_OUT
Definition: ad7780.h:52
struct no_os_gpio_desc * gpio_filter
Definition: ad7780.h:97
struct no_os_gpio_desc * gpio_miso
Definition: ad7780.h:96
#define AD7780_GAIN_HIGH
Definition: ad7780.h:70
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140