no-OS
ad9508.h
Go to the documentation of this file.
1 /***************************************************************************/
39 #ifndef AD9508_H_
40 #define AD9508_H_
41 
42 /******************************************************************************/
43 /***************************** Include Files **********************************/
44 /******************************************************************************/
45 #include "no_os_spi.h"
46 
47 /******************************************************************************/
48 /********************** Macros and Constants Definitions **********************/
49 /******************************************************************************/
50 
51 #define AD9508_SPI_CONFIG 0x000
52 #define AD9508_PART_ID_LOW 0x00C
53 #define AD9508_PART_ID_HIGH 0x00D
54 #define AD9508_OUT1_DIV_RATIO_LOW 0x01B
55 #define AD9508_OUT1_DIV_RATIO_HIGH 0x01C
56 #define AD9508_OUT1_PHASE_LOW 0x01D
57 #define AD9508_OUT1_PHASE_HIGH 0x01E
58 #define AD9508_PART_ID_VALUE 0x005
59 #define AD9508_DIVIDE_RATIO_ONE 0x000
60 
61 /******************************************************************************/
62 /*************************** Types Declarations *******************************/
63 /******************************************************************************/
64 
66  /* SPI */
68 };
69 
70 struct ad9508_dev {
71  /* SPI */
73 };
74 
75 /******************************************************************************/
76 /************************ Functions Declarations ******************************/
77 /******************************************************************************/
78 
79 int32_t ad9508_reg_read(struct ad9508_dev *dev, uint16_t reg_addr,
80  uint8_t *reg_data);
81 
82 int32_t ad9508_reg_write(struct ad9508_dev *dev, uint16_t reg_addr,
83  uint8_t reg_data);
84 
85 int32_t ad9508_setup(struct ad9508_dev **device,
86  const struct ad9508_init_param *init_param);
87 
88 int32_t ad9508_remove(struct ad9508_dev *dev);
89 
90 #endif
no_os_alloc.h
ad9508_init_param
Definition: ad9508.h:65
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:165
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:90
AD9508_PART_ID_HIGH
#define AD9508_PART_ID_HIGH
Definition: ad9508.h:53
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:58
device
Definition: ad9361_util.h:75
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:115
ad9508_remove
int32_t ad9508_remove(struct ad9508_dev *dev)
Free the resources allocated by ad9508_setup().
Definition: ad9508.c:188
AD9508_SPI_CONFIG
#define AD9508_SPI_CONFIG
Definition: ad9508.h:51
no_os_mdelay
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: aducm3029_delay.c:132
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:90
AD9508_OUT1_PHASE_LOW
#define AD9508_OUT1_PHASE_LOW
Definition: ad9508.h:56
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:115
AD9508_OUT1_DIV_RATIO_HIGH
#define AD9508_OUT1_DIV_RATIO_HIGH
Definition: ad9508.h:55
ad9508_dev::spi_desc
struct no_os_spi_desc * spi_desc
Definition: ad9508.h:72
no_os_spi_desc
Structure holding SPI descriptor.
Definition: no_os_spi.h:177
AD9508_PART_ID_VALUE
#define AD9508_PART_ID_VALUE
Definition: ad9508.h:58
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:58
no_os_malloc
void * no_os_malloc(size_t size)
Allocate memory and return a pointer to it.
Definition: chibios_alloc.c:49
ad9508_remove
int32_t ad9508_remove(struct ad9508_dev *dev)
Free the resources allocated by ad9508_setup().
Definition: ad9508.c:188
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:75
ad9508_dev
Definition: ad9508.h:70
init_param
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:119
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:122
AD9508_OUT1_PHASE_HIGH
#define AD9508_OUT1_PHASE_HIGH
Definition: ad9508.h:57
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:58
ad9508_init_param::spi_init
struct no_os_spi_init_param spi_init
Definition: ad9508.h:67
AD9508_PART_ID_LOW
#define AD9508_PART_ID_LOW
Definition: ad9508.h:52
AD9508_OUT1_DIV_RATIO_LOW
#define AD9508_OUT1_DIV_RATIO_LOW
Definition: ad9508.h:54
no_os_spi_init_param
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:131
AD9508_DIVIDE_RATIO_ONE
#define AD9508_DIVIDE_RATIO_ONE
Definition: ad9508.h:59