no-OS
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
ad7980.h
Go to the documentation of this file.
1/***************************************************************************/
33#ifndef __AD7980_H__
34#define __AD7980_H__
35
36#include <stdint.h>
37#include "no_os_gpio.h"
38#include "no_os_spi.h"
39
40/* AD74XX Chip Select Pin declaration */
41#define AD7980_CS_LOW no_os_gpio_set_value(dev->gpio_cs, \
42 NO_OS_GPIO_LOW)
43#define AD7980_CS_HIGH no_os_gpio_set_value(dev->gpio_cs, \
44 NO_OS_GPIO_HIGH)
45
46struct ad7980_dev {
47 /* SPI */
49 /* GPIO */
51};
52
54 /* SPI */
56 /* GPIO */
58};
59
61int8_t ad7980_init(struct ad7980_dev **device,
63
65int32_t ad7980_remove(struct ad7980_dev *dev);
66
68uint16_t ad7980_conversion(struct ad7980_dev *dev);
69
71float ad7980_convert_to_volts(uint16_t raw_sample, float v_ref);
72
73#endif /* __AD7980_H__ */
struct ad7616_init_param init_param
Definition ad7616_sdz.c:107
int32_t ad7980_remove(struct ad7980_dev *dev)
Free the resources allocated by ad7980_init().
Definition ad7980.c:80
float ad7980_convert_to_volts(uint16_t raw_sample, float v_ref)
Converts a 16-bit raw sample to volts.
Definition ad7980.c:130
int8_t ad7980_init(struct ad7980_dev **device, struct ad7980_init_param init_param)
Initializes the communication peripheral.
Definition ad7980.c:49
uint16_t ad7980_conversion(struct ad7980_dev *dev)
Initiates conversion and reads data.
Definition ad7980.c:100
Header file of GPIO Interface.
Header file of SPI Interface.
Definition ad7980.h:46
struct no_os_spi_desc * spi_desc
Definition ad7980.h:48
struct no_os_gpio_desc * gpio_cs
Definition ad7980.h:50
Definition ad7980.h:53
struct no_os_spi_init_param spi_init
Definition ad7980.h:55
struct no_os_gpio_init_param gpio_cs
Definition ad7980.h:57
Definition ad9361_util.h:63
Structure holding the GPIO descriptor.
Definition no_os_gpio.h:84
Structure holding the parameters for GPIO initialization.
Definition no_os_gpio.h:67
Structure holding SPI descriptor.
Definition no_os_spi.h:180
Structure holding the parameters for SPI initialization.
Definition no_os_spi.h:128