no-OS
ad9508.h
Go to the documentation of this file.
1 /***************************************************************************/
33 #ifndef AD9508_H_
34 #define AD9508_H_
35 
36 /******************************************************************************/
37 /***************************** Include Files **********************************/
38 /******************************************************************************/
39 #include "no_os_spi.h"
40 
41 /******************************************************************************/
42 /********************** Macros and Constants Definitions **********************/
43 /******************************************************************************/
44 
45 #define AD9508_SPI_CONFIG 0x000
46 #define AD9508_PART_ID_LOW 0x00C
47 #define AD9508_PART_ID_HIGH 0x00D
48 #define AD9508_OUT1_DIV_RATIO_LOW 0x01B
49 #define AD9508_OUT1_DIV_RATIO_HIGH 0x01C
50 #define AD9508_OUT1_PHASE_LOW 0x01D
51 #define AD9508_OUT1_PHASE_HIGH 0x01E
52 #define AD9508_PART_ID_VALUE 0x005
53 #define AD9508_DIVIDE_RATIO_ONE 0x000
54 
55 /******************************************************************************/
56 /*************************** Types Declarations *******************************/
57 /******************************************************************************/
58 
60  /* SPI */
62 };
63 
64 struct ad9508_dev {
65  /* SPI */
67 };
68 
69 /******************************************************************************/
70 /************************ Functions Declarations ******************************/
71 /******************************************************************************/
72 
73 int32_t ad9508_reg_read(struct ad9508_dev *dev, uint16_t reg_addr,
74  uint8_t *reg_data);
75 
76 int32_t ad9508_reg_write(struct ad9508_dev *dev, uint16_t reg_addr,
77  uint8_t reg_data);
78 
79 int32_t ad9508_setup(struct ad9508_dev **device,
80  const struct ad9508_init_param *init_param);
81 
82 int32_t ad9508_remove(struct ad9508_dev *dev);
83 
84 #endif
no_os_alloc.h
ad9508_init_param
Definition: ad9508.h:59
no_os_spi_write_and_read
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
no_os_spi.h
Header file of SPI Interface.
no_os_delay.h
Header file of Delay functions.
ad9508_reg_write
int32_t ad9508_reg_write(struct ad9508_dev *dev, uint16_t reg_addr, uint8_t reg_data)
Write to the ad9508 that is conected to the SPI.
Definition: ad9508.c:84
AD9508_PART_ID_HIGH
#define AD9508_PART_ID_HIGH
Definition: ad9508.h:47
ad9508_reg_read
int32_t ad9508_reg_read(struct ad9508_dev *dev, uint16_t reg_addr, uint8_t *reg_data)
Reads from the ad9508 that is contected to the SPI.
Definition: ad9508.c:52
device
Definition: ad9361_util.h:69
ad9508_setup
int32_t ad9508_setup(struct ad9508_dev **device, const struct ad9508_init_param *init_param)
Setup the working parameters of the ad9508 chip.
Definition: ad9508.c:109
ad9508_remove
int32_t ad9508_remove(struct ad9508_dev *dev)
Free the resources allocated by ad9508_setup().
Definition: ad9508.c:182
AD9508_SPI_CONFIG
#define AD9508_SPI_CONFIG
Definition: ad9508.h:45
no_os_mdelay
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: aducm3029_delay.c:126
no_os_error.h
Error codes definition.
ad9508_reg_write
int32_t ad9508_reg_write(struct ad9508_dev *dev, uint16_t reg_addr, uint8_t reg_data)
Write to the ad9508 that is conected to the SPI.
Definition: ad9508.c:84
AD9508_OUT1_PHASE_LOW
#define AD9508_OUT1_PHASE_LOW
Definition: ad9508.h:50
ad9508_setup
int32_t ad9508_setup(struct ad9508_dev **device, const struct ad9508_init_param *init_param)
Setup the working parameters of the ad9508 chip.
Definition: ad9508.c:109
AD9508_OUT1_DIV_RATIO_HIGH
#define AD9508_OUT1_DIV_RATIO_HIGH
Definition: ad9508.h:49
ad9508_dev::spi_desc
struct no_os_spi_desc * spi_desc
Definition: ad9508.h:66
no_os_spi_desc
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
AD9508_PART_ID_VALUE
#define AD9508_PART_ID_VALUE
Definition: ad9508.h:52
ad9508_reg_read
int32_t ad9508_reg_read(struct ad9508_dev *dev, uint16_t reg_addr, uint8_t *reg_data)
Reads from the ad9508 that is contected to the SPI.
Definition: ad9508.c:52
no_os_malloc
void * no_os_malloc(size_t size)
Allocate memory and return a pointer to it.
Definition: chibios_alloc.c:43
ad9508_remove
int32_t ad9508_remove(struct ad9508_dev *dev)
Free the resources allocated by ad9508_setup().
Definition: ad9508.c:182
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
ad9508_dev
Definition: ad9508.h:64
init_param
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
ad9508.h
Header file of AD9508 Driver.
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
AD9508_OUT1_PHASE_HIGH
#define AD9508_OUT1_PHASE_HIGH
Definition: ad9508.h:51
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
ad9508_init_param::spi_init
struct no_os_spi_init_param spi_init
Definition: ad9508.h:61
AD9508_PART_ID_LOW
#define AD9508_PART_ID_LOW
Definition: ad9508.h:46
AD9508_OUT1_DIV_RATIO_LOW
#define AD9508_OUT1_DIV_RATIO_LOW
Definition: ad9508.h:48
no_os_spi_init_param
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140
AD9508_DIVIDE_RATIO_ONE
#define AD9508_DIVIDE_RATIO_ONE
Definition: ad9508.h:53