no-OS
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
ad7303.h
Go to the documentation of this file.
1/***************************************************************************/
33#ifndef __AD7303_H__
34#define __AD7303_H__
35
36#include <stdint.h>
37#include "no_os_spi.h"
38
39/* Control Bits */
40#define AD7303_INT (0 << 7) // Selects internal reference.
41#define AD7303_EXT (1 << 7) // Selects external reference.
42#define AD7303_LDAC (1 << 5) // Load DAC bit.
43#define AD7303_PDB (1 << 4) // Power-down DAC B.
44#define AD7303_PDA (1 << 3) // Power-down DAC A.
45#define AD7303_A (0 << 2) // Address bit to select DAC A.
46#define AD7303_B (1 << 2) // Address bit to select DAC B.
47#define AD7303_CR1 (1 << 1) // Control Bit 1.
48#define AD7303_CR0 (1 << 0) // Control Bit 0.
49
50struct ad7303_dev {
51 /* SPI */
53};
54
56 /* SPI */
58};
59
61int8_t ad7303_init(struct ad7303_dev **device,
63
65int32_t ad7303_remove(struct ad7303_dev *dev);
66
68void ad7303_write(struct ad7303_dev *dev,
69 uint8_t control_reg,
70 uint8_t data_reg);
71
72#endif /* __AD7303_H__ */
int32_t ad7303_remove(struct ad7303_dev *dev)
Free the resources allocated by ad7303_init().
Definition ad7303.c:73
int8_t ad7303_init(struct ad7303_dev **device, struct ad7303_init_param init_param)
Initializes SPI communication.
Definition ad7303.c:49
void ad7303_write(struct ad7303_dev *dev, uint8_t control_reg, uint8_t data_reg)
Sends data to AD7303.
Definition ad7303.c:95
struct ad7616_init_param init_param
Definition ad7616_sdz.c:107
Header file of SPI Interface.
Definition ad7303.h:50
struct no_os_spi_desc * spi_desc
Definition ad7303.h:52
Definition ad7303.h:55
struct no_os_spi_init_param spi_init
Definition ad7303.h:57
Definition ad9361_util.h:63
Structure holding SPI descriptor.
Definition no_os_spi.h:180
Structure holding the parameters for SPI initialization.
Definition no_os_spi.h:128