no-OS
api_def.h
Go to the documentation of this file.
1 
13 #ifndef __API_DEF_H__
14 #define __API_DEF_H__
15 #include <stdint.h>
16 #define ADI_POW2_48 ((uint64_t)1u<<48)
17 #define ADI_MAXUINT48 (ADI_POW2_48 - 1)
18 
19 #define ADI_POW2_32 ((uint64_t)1u<<32)
20 #define ADI_MAXUINT32 (ADI_POW2_32 - 1)
21 #define ADI_MAXUINT24 (0xFFFFFF)
22 #define ADI_GET_BYTE(w, p) (uint8_t)(((w) >> (p)) & 0xFF)
23 #define ALL -1
24 
25 #define U64MSB 0x8000000000000000ull
26 
40 typedef int32_t(*spi_xfer_t)(void *user_data, uint8_t *indata, uint8_t *outdata,
41  int32_t size_bytes);
42 
55 typedef int32_t(*delay_us_t)(void *user_data, uint32_t us);
56 
73 typedef int(*hw_open_t)(void *user_data);
74 
91 typedef int(*hw_close_t)(void *user_data);
106 typedef int(*event_handler_t)(uint16_t event, uint8_t ref, void *data);
107 
126 typedef int(*tx_en_pin_ctrl_t)(void *user_data, uint8_t enable);
127 
145 typedef int(*reset_pin_ctrl_t)(void *user_data, uint8_t enable);
146 
148 struct adi_reg_data {
150  uint16_t reg;
152  uint8_t val;
153 };
154 
156 typedef struct {
158  uint8_t chip_type;
160  uint16_t prod_id;
162  uint8_t prod_grade;
164  uint8_t dev_revision;
165 } adi_chip_id_t;
166 
167 
169 typedef enum {
170  /* Keep this invalid value as 0, so the API can test for wrong setting.*/
171  SPI_NONE = 0,
172  /* Set SPI SDO (Serial Data Output) pin as active.
173  * This is in case the 4-wire SPI is needed.*/
174  SPI_SDO = 1,
175  /* Set SPI SDIO (Serial Data Input-Output) pin as active.
176  * This is in case the 3-wire SPI is needed.*/
177  SPI_SDIO = 2,
178  /* Keep it last. */
181 
183 typedef enum {
187 } signal_type_t;
188 
190 typedef enum {
195 
197 typedef enum {
198  JESD_LINK_0 = 0x0,
199  JESD_LINK_1 = 0x1,
201 } jesd_link_t;
202 
204 typedef enum {
205  SYNCOUTB_0 = 0x0,
206  SYNCOUTB_1 = 0x1,
207  SYNCOUTB_ALL = 0xFF
209 
211 typedef enum {
218 
220 typedef struct {
221  uint8_t jesd_L;
222  uint8_t jesd_F;
223  uint8_t jesd_M;
224  uint8_t jesd_S;
227  uint8_t jesd_HD;
228  uint8_t jesd_K;
229  uint8_t jesd_N;
230  uint8_t jesd_NP;
231  uint8_t jesd_CF;
232  uint8_t jesd_CS;
234  uint8_t jesd_DID;
235  uint8_t jesd_BID;
236  uint8_t jesd_LID0;
237  uint8_t jesd_JESDV;
238 } jesd_param_t;
239 
241 typedef enum {
248 
249 #endif /* !__API_DEF_H__ */
SYNCOUTB_0
@ SYNCOUTB_0
Definition: api_def.h:215
PRBS_NONE
@ PRBS_NONE
Definition: api_def.h:258
SPI_SDO
@ SPI_SDO
Definition: api_def.h:182
SIGNAL_CMOS
@ SIGNAL_CMOS
Definition: api_def.h:194
PRBS31
@ PRBS31
Definition: api_def.h:261
PRBS7
@ PRBS7
Definition: api_def.h:259
adi_reg_data
Definition: api_def.h:155
tx_en_pin_ctrl_t
int(* tx_en_pin_ctrl_t)(void *user_data, uint8_t enable)
TX_ENABLE PIN CONTROL FUNCTION.
Definition: api_def.h:133
SIGNAL_UNKNOWN
@ SIGNAL_UNKNOWN
Definition: api_def.h:196
signal_type_t
signal_type_t
Definition: api_def.h:193
COUPLING_DC
@ COUPLING_DC
Definition: api_def.h:202
SYSREF_CONT
@ SYSREF_CONT
Definition: api_def.h:224
adi_reg_data::val
uint8_t val
Definition: api_def.h:159
hw_close_t
int(* hw_close_t)(void *user_data)
Closes any platform hardware resources for the AD9164 Device.
Definition: api_def.h:98
SYNCOUTB_1
@ SYNCOUTB_1
Definition: api_def.h:216
JESD_LINK_0
@ JESD_LINK_0
Definition: api_def.h:208
event_handler_t
int(* event_handler_t)(uint16_t event, uint8_t ref, void *data)
Client Event Handler.
Definition: api_def.h:113
SIGNAL_LVDS
@ SIGNAL_LVDS
Definition: api_def.h:195
spi_sdo_config_t
spi_sdo_config_t
Definition: api_def.h:175
signal_coupling_t
signal_coupling_t
Definition: api_def.h:200
jesd_prbs_pattern_t
jesd_prbs_pattern_t
Definition: api_def.h:257
jesd_param_t
Definition: api_def.h:230
SYSREF_MODE_INVLD
@ SYSREF_MODE_INVLD
Definition: api_def.h:226
jesd_sysref_mode_t
jesd_sysref_mode_t
Definition: api_def.h:221
SPI_CONFIG_MAX
@ SPI_CONFIG_MAX
Definition: api_def.h:189
JESD_LINK_1
@ JESD_LINK_1
Definition: api_def.h:209
PRBS_MAX
@ PRBS_MAX
Definition: api_def.h:262
delay_us_t
int(* delay_us_t)(void *user_data, unsigned int us)
Delay for specified number of microseconds. Platform Dependant.
Definition: api_def.h:62
spi_xfer_t
int(* spi_xfer_t)(void *user_data, uint8_t *indata, uint8_t *outdata, int size_bytes)
Platform dependent SPI access functions.
Definition: api_def.h:47
COUPLING_UNKNOWN
@ COUPLING_UNKNOWN
Definition: api_def.h:203
reset_pin_ctrl_t
int(* reset_pin_ctrl_t)(void *user_data, uint8_t enable)
RESETB PIN CONTROL FUNCTION.
Definition: api_def.h:152
SYSREF_NONE
@ SYSREF_NONE
Definition: api_def.h:222
SYSREF_MON
@ SYSREF_MON
Definition: api_def.h:225
SYNCOUTB_ALL
@ SYNCOUTB_ALL
Definition: api_def.h:217
COUPLING_AC
@ COUPLING_AC
Definition: api_def.h:201
JESD_LINK_ALL
@ JESD_LINK_ALL
Definition: api_def.h:210
adi_chip_id_t
Definition: api_def.h:163
SPI_NONE
@ SPI_NONE
Definition: api_def.h:177
hw_open_t
int(* hw_open_t)(void *user_data)
Platform hardware initialisation for the AD9164 Device.
Definition: api_def.h:80
jesd_link_t
jesd_link_t
Definition: api_def.h:207
adi_reg_data::reg
uint16_t reg
Definition: api_def.h:157
PRBS15
@ PRBS15
Definition: api_def.h:260
SYSREF_ONESHOT
@ SYSREF_ONESHOT
Definition: api_def.h:223
SPI_SDIO
@ SPI_SDIO
Definition: api_def.h:187
jesd_syncoutb_t
jesd_syncoutb_t
Definition: api_def.h:214