no-OS
ad469x.h
Go to the documentation of this file.
1 /***************************************************************************/
40 #ifndef SRC_AD469X_H_
41 #define SRC_AD469X_H_
42 
43 // **** Note for User: SPI Standard/Engine selection **** //
44 /* By default the SPI Engine Framework is used for communicating with eval board.
45  * Uncomment the "USE_STANDARD_SPI" macro to enable the standard SPI.
46  * framework.
47  * */
48 //#define USE_STANDARD_SPI
49 
50 /******************************************************************************/
51 /***************************** Include Files **********************************/
52 /******************************************************************************/
53 #include <stdbool.h>
54 
55 #if !defined(USE_STANDARD_SPI)
56 #include "spi_engine.h"
57 #include "clk_axi_clkgen.h"
58 #include "no_os_pwm.h"
59 #else
60 #include "no_os_spi.h"
61 #endif
62 
63 #include "no_os_gpio.h"
64 
65 /******************************************************************************/
66 /********************** Macros and Constants Definitions **********************/
67 /******************************************************************************/
68 /* AD469x registers */
69 #define AD469x_REG_IF_CONFIG_A 0x000
70 #define AD469x_REG_IF_CONFIG_B 0x001
71 #define AD469x_REG_DEVICE_TYPE 0x003
72 #define AD469x_REG_DEVICE_ID_L 0x004
73 #define AD469x_REG_DEVICE_ID_H 0x005
74 #define AD469x_REG_SCRATCH_PAD 0x00A
75 #define AD469x_REG_VENDOR_L 0x00C
76 #define AD469x_REG_VENDOR_H 0x00D
77 #define AD469x_REG_LOOP_MODE 0x00E
78 #define AD469x_REG_IF_CONFIG_C 0x010
79 #define AD469x_REG_IF_STATUS 0x011
80 #define AD469x_REG_STATUS 0x014
81 #define AD469x_REG_ALERT_STATUS1 0x015
82 #define AD469x_REG_ALERT_STATUS2 0x016
83 #define AD469x_REG_ALERT_STATUS3 0x017
84 #define AD469x_REG_ALERT_STATUS4 0x018
85 #define AD469x_REG_CLAMP_STATUS1 0x01A
86 #define AD469x_REG_CLAMP_STATUS2 0x01B
87 #define AD469x_REG_SETUP 0x020
88 #define AD469x_REG_REF_CTRL 0x021
89 #define AD469x_REG_SEQ_CTRL 0x022
90 #define AD469x_REG_AC_CTRL 0x023
91 #define AD469x_REG_STD_SEQ_CONFIG 0x024
92 #define AD469x_REG_GPIO_CTRL 0x026
93 #define AD469x_REG_GP_MODE 0x027
94 #define AD469x_REG_GPIO_STATE 0x028
95 #define AD469x_REG_TEMP_CTRL 0x029
96 #define AD469x_REG_CONFIG_IN(x) ((x & 0x0F) | 0x30)
97 #define AD469x_REG_THRESHOLD_UB(x) ((x << 1) | 0x40)
98 #define AD469x_REG_THRESHOLD_LB(x) ((x << 1) | 0x60)
99 #define AD469x_REG_HYST_IN(x) ((x << 1) | 0x80)
100 #define AD469x_REG_OFFSET_IN(x) ((x << 1) | 0xA0)
101 #define AD469x_REG_GAIN_IN(x) ((x << 1) | 0x0C0)
102 #define AD469x_REG_AS_SLOT(x) ((x & 0x7F) | 0x100)
103 
104 /* 5-bit SDI Conversion Mode Commands */
105 #define AD469x_CMD_REG_CONFIG_MODE (0x0A << 3)
106 #define AD469x_CMD_SEL_TEMP_SNSOR_CH (0x0F << 3)
107 #define AD469x_CMD_CONFIG_CH_SEL(x) ((0x10 | (0x0F & x)) << 3)
108 
109 /* Status Register Mask */
110 #define AD469x_REG_STATUS_RESET_MASK (0x01 << 5)
111 
112 /* AD469x_REG_SETUP */
113 #define AD469x_SETUP_IF_MODE_MASK (0x01 << 2)
114 #define AD469x_SETUP_IF_MODE_CONV (0x01 << 2)
115 #define AD469x_SETUP_CYC_CTRL_MASK (0x01 << 1)
116 #define AD469x_SETUP_CYC_CTRL_SINGLE(x) ((x & 0x01) << 1)
117 
118 /* AD469x_REG_REF_CTRL */
119 #define AD469x_REG_REF_VREF_SET_MASK (0x07 << 2)
120 #define AD469x_REG_REF_VREF_SET(x) ((x & 0x07) << 2)
121 #define AD469x_REG_REF_VREF_REFHIZ_MASK (0x07 << 1)
122 #define AD469x_REG_REF_VREF_REFHIZ(x) ((x & 0x01) << 1)
123 #define AD469x_REG_REF_VREF_REFBUF_MASK 0x01
124 #define AD469x_REG_REF_VREF_REFBUF(x) (x & 0x01)
125 
126 /* AD469x_REG_GP_MODE */
127 #define AD469x_GP_MODE_BUSY_GP_EN_MASK (0x01 << 1)
128 #define AD469x_GP_MODE_BUSY_GP_EN(x) ((x & 0x01) << 1)
129 #define AD469x_GP_MODE_BUSY_GP_SEL_MASK (0x01 << 4)
130 #define AD469x_GP_MODE_BUSY_GP_SEL(x) ((x & 0x01) << 4)
131 
132 /* AD469x_REG_SEQ_CTRL */
133 #define AD469x_SEQ_CTRL_STD_SEQ_EN_MASK (0x01 << 7)
134 #define AD469x_SEQ_CTRL_STD_SEQ_EN(x) ((x & 0x01) << 7)
135 #define AD469x_SEQ_CTRL_NUM_SLOTS_AS_MASK (0x7f << 0)
136 #define AD469x_SEQ_CTRL_NUM_SLOTS_AS(x) ((x & 0x7f) << 0)
137 
138 /* AD469x_REG_TEMP_CTRL */
139 #define AD469x_REG_TEMP_CTRL_TEMP_EN_MASK (0x01 << 0)
140 #define AD469x_REG_TEMP_CTRL_TEMP_EN(x) ((x & 0x01) << 0)
141 
142 /* AD469x_REG_AS_SLOT */
143 #define AD469x_REG_AS_SLOT_INX(x) ((x & 0x0f) << 0)
144 
145 /* AD469x_REG_IF_CONFIG_C */
146 #define AD469x_REG_IF_CONFIG_C_MB_STRICT_MASK (0x01 << 5)
147 #define AD469x_REG_IF_CONFIG_C_MB_STRICT(x) ((x & 0x01) << 5)
148 
149 /* AD469x_REG_CONFIG_INn */
150 #define AD469x_REG_CONFIG_IN_OSR_MASK (0x03 << 0)
151 #define AD469x_REG_CONFIG_IN_OSR(x) ((x & 0x03) << 0)
152 #define AD469x_REG_CONFIG_IN_HIZ_EN_MASK (0x01 << 3)
153 #define AD469x_REG_CONFIG_IN_HIZ_EN(x) ((x & 0x01) << 3)
154 #define AD469x_REG_CONFIG_IN_PAIR_MASK (0x03 << 4)
155 #define AD469x_REG_CONFIG_IN_PAIR(x) ((x & 0x03) << 4)
156 #define AD469x_REG_CONFIG_IN_MODE_MASK (0x01 << 6)
157 #define AD469x_REG_CONFIG_IN_MODE(x) ((x & 0x01) << 6)
158 #define AD469x_REG_CONFIG_IN_TD_EN_MASK (0x01 << 7)
159 #define AD469x_REG_CONFIG_IN_TD_EN(x) ((x & 0x01) << 7)
160 
161 #define AD469x_CHANNEL(x) (NO_OS_BIT(x) & 0xFFFF)
162 #define AD469x_CHANNEL_NO 16
163 #define AD469x_SLOTS_NO 0x80
164 
165 /******************************************************************************/
166 /*************************** Types Declarations *******************************/
167 /******************************************************************************/
181 };
182 
192 };
193 
201 };
202 
212 };
213 
223 };
224 
233 };
234 
245 };
246 
254 };
255 
261  /* SPI */
263 #if !defined(USE_STANDARD_SPI)
264  /* SPI module offload init */
266  /* PWM generator init structure */
268  /* Clock gen for hdl design init structure */
270  /* Clock generator rate */
271  uint32_t axi_clkgen_rate;
272 #endif
273 
279  /* Register access speed */
281  /* Register data width */
282  uint8_t reg_data_width;
283  /* Capture data width */
285  /* Device Settings */
287  /* Pin Pairing option in standard sequencer mode */
289  /* Channel sequencing mode */
298  void (*dcache_invalidate_range)(uint32_t address, uint32_t bytes_count);
300  uint8_t num_data_ch;
305 };
306 
311 struct ad469x_dev {
312  /* SPI descriptor */
314 #if !defined(USE_STANDARD_SPI)
315  /* Clock gen for hdl design structure */
317  /* Trigger conversion PWM generator descriptor */
319  /* SPI module offload init */
321 #endif
322  /* Register access speed */
324  /* Register data width */
325  uint8_t reg_data_width;
326  /* Capture data width */
328  /* Device Settings */
337  void (*dcache_invalidate_range)(uint32_t address, uint32_t bytes_count);
340  /* Pin Pairing option in standard sequencer mode */
353  uint8_t num_slots;
355  uint8_t num_data_ch;
356 };
357 
358 /******************************************************************************/
359 /************************ Functions Declarations ******************************/
360 /******************************************************************************/
361 /* Read device register. */
362 int32_t ad469x_spi_reg_read(struct ad469x_dev *dev,
363  uint16_t reg_addr,
364  uint8_t *reg_data);
365 
366 /* Write device register */
367 int32_t ad469x_spi_reg_write(struct ad469x_dev *dev,
368  uint16_t reg_addr,
369  uint8_t reg_data);
370 
371 /* Read from device using a mask */
372 int32_t ad469x_spi_read_mask(struct ad469x_dev *dev,
373  uint16_t reg_addr,
374  uint8_t mask,
375  uint8_t *data);
376 
377 /* Write to device using a mask */
378 int32_t ad469x_spi_write_mask(struct ad469x_dev *dev,
379  uint16_t reg_addr,
380  uint8_t mask,
381  uint8_t data);
382 
383 /* Read data from device */
384 int32_t ad469x_read_data(struct ad469x_dev *dev,
385  uint8_t channel,
386  uint32_t *buf,
387  uint16_t samples);
388 
389 /* Read from device when converter has the channel sequencer activated */
390 int32_t ad469x_seq_read_data(struct ad469x_dev *dev,
391  uint32_t *buf,
392  uint32_t samples);
393 
394 /* Set channel sequence */
395 int32_t ad469x_set_channel_sequence(struct ad469x_dev *dev,
396  enum ad469x_channel_sequencing seq);
397 
398 /* Configure standard sequencer enabled channels */
399 int32_t ad469x_std_sequence_ch(struct ad469x_dev *dev,
400  uint16_t ch_mask);
401 
402 /* Configure advanced sequencer number of slots */
404  uint8_t num_slots);
405 
406 /* Advanced sequencer, assign channel to a slot */
407 int32_t ad469x_adv_sequence_set_slot(struct ad469x_dev *dev,
408  uint8_t slot,
409  uint8_t channel);
410 
411 /* Enable temperature read at the end of the sequence, for standard and */
412 int32_t ad469x_sequence_enable_temp(struct ad469x_dev *dev);
413 
414 /* Disable temperature read at the end of the sequence, for standard and */
415 int32_t ad469x_sequence_disable_temp(struct ad469x_dev *dev);
416 
417 /* Configure over sampling ratio in advanced sequencer mode */
418 int32_t ad469x_adv_seq_osr(struct ad469x_dev *dev, uint16_t ch,
419  enum ad469x_osr_ratios ratio);
420 
421 /* Configure over sampling ratio in standard sequencer mode */
422 int32_t ad469x_std_seq_osr(struct ad469x_dev *dev,
423  enum ad469x_osr_ratios ratio);
424 
425 /* Configure the pairing option in standard sequencer mode */
426 int32_t ad469x_std_pin_pairing(struct ad469x_dev *dev,
427  enum ad469x_pin_pairing pin_pair);
428 
429 /* Configure the busy indicator to the output on specified pin */
430 int32_t ad469x_set_busy(struct ad469x_dev *dev,
431  enum ad469x_busy_gp_sel gp_sel);
432 
433 /* Enter conversion mode */
434 int32_t ad469x_enter_conversion_mode(struct ad469x_dev *dev);
435 
436 /* Exit conversion mode */
437 int32_t ad469x_exit_conversion_mode(struct ad469x_dev *dev);
438 
439 /* Reset with AD469x device */
440 int32_t ad469x_reset_dev(struct ad469x_dev *dev);
441 
442 /* Configures the AD469x device */
443 int32_t ad469x_config(struct ad469x_dev *dev,
444  struct ad469x_init_param *config_desc);
445 
446 /* Get Reference */
447 int32_t ad469x_get_reference(struct ad469x_dev *device,
448  enum ad469x_ref_set *ref_set);
449 
450 /* Set reference */
451 int32_t ad469x_set_reference(struct ad469x_dev *device,
452  enum ad469x_ref_set ref_set);
453 
454 /* Configure analog input high Z mode */
455 int32_t ad469x_configure_ain_high_z(struct ad469x_dev *dev,
456  uint8_t ch,
457  enum ad469x_ain_high_z status);
458 
459 /* Get the status of analog input high Z mode */
460 int32_t ad469x_get_ain_high_z_status(struct ad469x_dev *dev,
461  uint8_t ch,
462  enum ad469x_ain_high_z *status);
463 
464 /* Get the number of channels that are enabled */
465 int32_t ad469x_get_num_channels(struct ad469x_dev *dev,
466  uint8_t *num_channels);
467 
468 /* check if channel is a temperature channel */
469 bool ad469x_is_temp_channel(struct ad469x_dev *dev,
470  uint8_t channel);
471 
472 /* Initialize the device. */
473 int32_t ad469x_init(struct ad469x_dev **device,
474  struct ad469x_init_param *init_param);
475 
476 /* Remove the device and release resources. */
477 int32_t ad469x_remove(struct ad469x_dev *dev);
478 
479 #endif /* SRC_AD469X_H_ */
axi_clkgen_init::name
const char * name
Definition: clk_axi_clkgen.h:57
ID_AD4696
@ ID_AD4696
Definition: ad469x.h:209
ad469x_init_param::axi_clkgen_rate
uint32_t axi_clkgen_rate
Definition: ad469x.h:271
ad469x_init
int32_t ad469x_init(struct ad469x_dev **device, struct ad469x_init_param *init_param)
Definition: ad469x.c:1071
AD469x_REG_TEMP_CTRL_TEMP_EN_MASK
#define AD469x_REG_TEMP_CTRL_TEMP_EN_MASK
Definition: ad469x.h:139
ad469x_dev::dcache_invalidate_range
void(* dcache_invalidate_range)(uint32_t address, uint32_t bytes_count)
Definition: ad469x.h:337
AD469x_two_cycle
@ AD469x_two_cycle
Definition: ad469x.h:176
ad469x_channel_sequencing
ad469x_channel_sequencing
Channel sequencing modes.
Definition: ad469x.h:172
ID_AD4697
@ ID_AD4697
Definition: ad469x.h:210
ad469x_init_param::dcache_invalidate_range
void(* dcache_invalidate_range)(uint32_t address, uint32_t bytes_count)
Definition: ad469x.h:298
no_os_alloc.h
no_os_gpio_init_param
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:85
spi_engine_offload_message::no_commands
uint32_t no_commands
Definition: spi_engine.h:167
no_os_pwm_init_param
Structure containing the init parameters needed by the PWM generator.
Definition: no_os_pwm.h:72
ad469x_std_sequence_ch
int32_t ad469x_std_sequence_ch(struct ad469x_dev *dev, uint16_t ch_mask)
Configure standard sequencer channels.
Definition: ad469x.c:563
ad469x_init_param::ch_sequence
enum ad469x_channel_sequencing ch_sequence
Definition: ad469x.h:290
AD469x_3P25_3P75
@ AD469x_3P25_3P75
Definition: ad469x.h:242
ad469x_init_param::temp_enabled
bool temp_enabled
Definition: ad469x.h:302
ad469x_set_reference
int32_t ad469x_set_reference(struct ad469x_dev *device, enum ad469x_ref_set ref_set)
Set the value of reference.
Definition: ad469x.c:909
ad469x_dev::reg_access_speed
uint32_t reg_access_speed
Definition: ad469x.h:323
ad469x_sequence_enable_temp
int32_t ad469x_sequence_enable_temp(struct ad469x_dev *dev)
Enable temperature read at the end of the sequence, for standard and advanced sequencer.
Definition: ad469x.c:590
ad469x_enter_conversion_mode
int32_t ad469x_enter_conversion_mode(struct ad469x_dev *dev)
Enter conversion mode. To exit conversion mode send a 5 bit conversion mode command AD469x_CMD_REG_CO...
Definition: ad469x.c:665
AD469x_INx_COM
@ AD469x_INx_COM
Definition: ad469x.h:231
ad469x_init_param::trigger_pwm_init
struct no_os_pwm_init_param * trigger_pwm_init
Definition: ad469x.h:267
ad469x_supported_dev_ids
ad469x_supported_dev_ids
Supported devices.
Definition: ad469x.h:207
ad469x_dev::adv_seq_osr_resol
enum ad469x_osr_ratios adv_seq_osr_resol[AD469x_CHANNEL_NO]
Definition: ad469x.h:347
ad469x_exit_conversion_mode
int32_t ad469x_exit_conversion_mode(struct ad469x_dev *dev)
Exit conversion mode. Enter register mode to read/write registers.
Definition: ad469x.c:679
ad469x_adv_sequence_set_num_slots
int32_t ad469x_adv_sequence_set_num_slots(struct ad469x_dev *dev, uint8_t num_slots)
Configure advanced sequencer number of slots, temp channel not included.
Definition: ad469x.c:513
ad469x_config_extended
int32_t ad469x_config_extended(struct ad469x_dev *dev, struct ad469x_init_param *config_desc)
Definition: ad469x.c:967
ad469x_set_busy
int32_t ad469x_set_busy(struct ad469x_dev *dev, enum ad469x_busy_gp_sel gp_sel)
Configure converter busy indicator to the output of the specified port.
Definition: ad469x.c:634
NO_OS_GENMASK
#define NO_OS_GENMASK(h, l)
Definition: no_os_util.h:86
AD469x_SEQ_CTRL_STD_SEQ_EN
#define AD469x_SEQ_CTRL_STD_SEQ_EN(x)
Definition: ad469x.h:134
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
ad469x_sequence_disable_temp
int32_t ad469x_sequence_disable_temp(struct ad469x_dev *dev)
Disable temperature read at the end of the sequence, for standard and advanced sequencer.
Definition: ad469x.c:612
ad469x_ain_high_z
ad469x_ain_high_z
Analog input high impedance mode.
Definition: ad469x.h:251
ad469x_dev::clkgen
struct axi_clkgen * clkgen
Definition: ad469x.h:316
CS_LOW
#define CS_LOW
Definition: spi_engine.h:79
ad469x_remove
int32_t ad469x_remove(struct ad469x_dev *dev)
Free the memory allocated by ad469x_init().
Definition: ad469x.c:1200
no_os_spi.h
Header file of SPI Interface.
ad469x_configure_ain_high_z
int32_t ad469x_configure_ain_high_z(struct ad469x_dev *dev, uint8_t ch, enum ad469x_ain_high_z status)
Configure analog input high Z mode.
Definition: ad469x.c:1030
ad469x_init_param::reg_access_speed
uint32_t reg_access_speed
Definition: ad469x.h:280
ad469x_sequence_disable_temp
int32_t ad469x_sequence_disable_temp(struct ad469x_dev *dev)
Disable temperature read at the end of the sequence, for standard and advanced sequencer.
Definition: ad469x.c:612
spi_engine_offload_init
int32_t spi_engine_offload_init(struct no_os_spi_desc *desc, const struct spi_engine_offload_init_param *param)
Initialize the SPI engine's offload module.
Definition: spi_engine.c:759
ad469x_read_data
int32_t ad469x_read_data(struct ad469x_dev *dev, uint8_t channel, uint32_t *buf, uint16_t samples)
Read from device. Enter register mode to read/write registers.
Definition: ad469x.c:799
no_os_pwm_remove
int32_t no_os_pwm_remove(struct no_os_pwm_desc *desc)
Free the resources allocated by no_os_pwm_init().
Definition: no_os_pwm.c:85
ad469x_get_reference
int32_t ad469x_get_reference(struct ad469x_dev *device, enum ad469x_ref_set *ref_set)
Get the value of reference.
Definition: ad469x.c:885
ad469x_set_channel_sequence
int32_t ad469x_set_channel_sequence(struct ad469x_dev *dev, enum ad469x_channel_sequencing seq)
Set channel sequence.
Definition: ad469x.c:408
AD469x_REG_CONFIG_IN_MODE
#define AD469x_REG_CONFIG_IN_MODE(x)
Definition: ad469x.h:157
ad469x_set_reg_access_mode
int32_t ad469x_set_reg_access_mode(struct ad469x_dev *dev, enum ad469x_reg_access access)
Configure register access mode.
Definition: ad469x.c:224
AD469x_TEST_DATA
#define AD469x_TEST_DATA
Definition: ad469x.c:58
ad469x_dev::trigger_pwm_desc
struct no_os_pwm_desc * trigger_pwm_desc
Definition: ad469x.h:318
clk_axi_clkgen.h
Driver for the Analog Devices AXI CLKGEN.
ad469x_pin_pairing
ad469x_pin_pairing
Channel pin pairing options.
Definition: ad469x.h:229
ad469x_get_ain_high_z_status
int32_t ad469x_get_ain_high_z_status(struct ad469x_dev *dev, uint8_t ch, enum ad469x_ain_high_z *status)
Get the status of analog input high Z mode.
Definition: ad469x.c:1046
spi_engine_offload_message::commands_data
uint32_t * commands_data
Definition: spi_engine.h:169
ad469x_reset_dev
int32_t ad469x_reset_dev(struct ad469x_dev *dev)
Resets the ad469x device.
Definition: ad469x.c:852
ad469x_adv_seq_osr
int32_t ad469x_adv_seq_osr(struct ad469x_dev *dev, uint16_t ch, enum ad469x_osr_ratios ratio)
Configure over sampling ratio in advanced sequencer mode.
Definition: ad469x.c:306
no_os_pwm_init_param::period_ns
uint32_t period_ns
Definition: no_os_pwm.h:76
no_os_delay.h
Header file of Delay functions.
ad469x_get_num_channels
int32_t ad469x_get_num_channels(struct ad469x_dev *dev, uint8_t *num_channels)
Definition: ad469x.c:272
AD469x_GP_MODE_BUSY_GP_EN_MASK
#define AD469x_GP_MODE_BUSY_GP_EN_MASK
Definition: ad469x.h:127
axi_clkgen_init
Definition: clk_axi_clkgen.h:56
ad469x_device_info
Definition: ad469x.c:70
ad469x_dev::ch_sequence
enum ad469x_channel_sequencing ch_sequence
Definition: ad469x.h:339
axi_clkgen_set_rate
int32_t axi_clkgen_set_rate(struct axi_clkgen *clkgen, uint32_t rate)
axi_clkgen_set_rate
Definition: clk_axi_clkgen.c:419
AD469x_REG_CONFIG_IN_OSR_MASK
#define AD469x_REG_CONFIG_IN_OSR_MASK
Definition: ad469x.h:150
ad469x_enter_conversion_mode
int32_t ad469x_enter_conversion_mode(struct ad469x_dev *dev)
Enter conversion mode. To exit conversion mode send a 5 bit conversion mode command AD469x_CMD_REG_CO...
Definition: ad469x.c:665
ad469x_reset_dev
int32_t ad469x_reset_dev(struct ad469x_dev *dev)
Resets the ad469x device.
Definition: ad469x.c:852
ad469x_init_param::spi_init
struct no_os_spi_init_param * spi_init
Definition: ad469x.h:262
spi_engine_offload_message
Structure representing an offload message.
Definition: spi_engine.h:160
AD469x_GP_MODE_BUSY_GP_SEL_MASK
#define AD469x_GP_MODE_BUSY_GP_SEL_MASK
Definition: ad469x.h:129
device
Definition: ad9361_util.h:75
ad469x_spi_write_mask
int32_t ad469x_spi_write_mask(struct ad469x_dev *dev, uint16_t reg_addr, uint8_t mask, uint8_t data)
Definition: ad469x.c:200
NO_OS_GPIO_HIGH
@ NO_OS_GPIO_HIGH
Definition: no_os_gpio.h:123
ad469x_dev::gpio_resetn
struct no_os_gpio_desc * gpio_resetn
Definition: ad469x.h:331
ad469x_dev::std_seq_pin_pairing
enum ad469x_pin_pairing std_seq_pin_pairing
Definition: ad469x.h:341
AD469x_advanced_seq
@ AD469x_advanced_seq
Definition: ad469x.h:180
axi_clkgen_init
int32_t axi_clkgen_init(struct axi_clkgen **clk, const struct axi_clkgen_init *init)
axi_clkgen_init
Definition: clk_axi_clkgen.c:525
AD469x_REG_IF_CONFIG_C_MB_STRICT
#define AD469x_REG_IF_CONFIG_C_MB_STRICT(x)
Definition: ad469x.h:147
axi_clkgen
Definition: clk_axi_clkgen.h:50
ad469x_set_reference
int32_t ad469x_set_reference(struct ad469x_dev *device, enum ad469x_ref_set ref_set)
Set the value of reference.
Definition: ad469x.c:909
NO_OS_ARRAY_SIZE
#define NO_OS_ARRAY_SIZE(x)
Definition: no_os_util.h:53
ad469x_std_sequence_ch
int32_t ad469x_std_sequence_ch(struct ad469x_dev *dev, uint16_t ch_mask)
Configure standard sequencer channels.
Definition: ad469x.c:563
no_os_gpio_direction_input
int32_t no_os_gpio_direction_input(struct no_os_gpio_desc *desc)
Enable the input direction of the specified GPIO.
Definition: no_os_gpio.c:130
ad469x_init_param::dev_id
enum ad469x_supported_dev_ids dev_id
Definition: ad469x.h:286
ad469x_std_pin_pairing
int32_t ad469x_std_pin_pairing(struct ad469x_dev *dev, enum ad469x_pin_pairing pin_pair)
Configure the pin pairing option in standard sequencer mode.
Definition: ad469x.c:391
AD469x_CMD_CONFIG_CH_SEL
#define AD469x_CMD_CONFIG_CH_SEL(x)
Definition: ad469x.h:107
ad469x_spi_reg_read
int32_t ad469x_spi_reg_read(struct ad469x_dev *dev, uint16_t reg_addr, uint8_t *reg_data)
Definition: ad469x.c:93
ad469x_init_param::gpio_convst
struct no_os_gpio_init_param * gpio_convst
Definition: ad469x.h:276
ID_AD4698
@ ID_AD4698
Definition: ad469x.h:211
ad469x_spi_read_mask
int32_t ad469x_spi_read_mask(struct ad469x_dev *dev, uint16_t reg_addr, uint8_t mask, uint8_t *data)
Definition: ad469x.c:175
WRITE_READ
#define WRITE_READ(no_bytes)
Definition: spi_engine.h:71
ad469x_device_resol
const uint8_t ad469x_device_resol[]
Device resolution.
Definition: ad469x.c:63
NO_OS_GPIO_LOW
@ NO_OS_GPIO_LOW
Definition: no_os_gpio.h:121
AD469x_AIN_HIGH_Z_DISABLE
@ AD469x_AIN_HIGH_Z_DISABLE
Definition: ad469x.h:252
ad7616_init_param::reg_access_speed
uint32_t reg_access_speed
Definition: ad7616.h:218
ad469x_get_reference
int32_t ad469x_get_reference(struct ad469x_dev *device, enum ad469x_ref_set *ref_set)
Get the value of reference.
Definition: ad469x.c:885
ad469x_init_param::gpio_resetn
struct no_os_gpio_init_param * gpio_resetn
Definition: ad469x.h:274
no_os_mdelay
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: aducm3029_delay.c:132
no_os_field_prep
uint32_t no_os_field_prep(uint32_t mask, uint32_t val)
AD469x_4P5_5P1
@ AD469x_4P5_5P1
Definition: ad469x.h:244
AD469x_SEQ_CTRL_NUM_SLOTS_AS
#define AD469x_SEQ_CTRL_NUM_SLOTS_AS(x)
Definition: ad469x.h:136
ad469x_std_seq_osr
int32_t ad469x_std_seq_osr(struct ad469x_dev *dev, enum ad469x_osr_ratios ratio)
Configure over sampling ratio in standard sequencer mode.
Definition: ad469x.c:363
AD469x_3P75_4P5
@ AD469x_3P75_4P5
Definition: ad469x.h:243
CS_HIGH
#define CS_HIGH
Definition: spi_engine.h:78
spi_engine_set_speed
void spi_engine_set_speed(struct no_os_spi_desc *desc, uint32_t speed_hz)
Set SPI engine clock frequency.
Definition: spi_engine.c:152
AD469x_SETUP_CYC_CTRL_MASK
#define AD469x_SETUP_CYC_CTRL_MASK
Definition: ad469x.h:115
AD469x_busy_gp3
@ AD469x_busy_gp3
Definition: ad469x.h:191
AD469x_REG_CONFIG_IN_HIZ_EN_MASK
#define AD469x_REG_CONFIG_IN_HIZ_EN_MASK
Definition: ad469x.h:152
ad469x_dev::dev_id
enum ad469x_supported_dev_ids dev_id
Definition: ad469x.h:329
ad469x_read_data
int32_t ad469x_read_data(struct ad469x_dev *dev, uint8_t channel, uint32_t *buf, uint16_t samples)
Read from device. Enter register mode to read/write registers.
Definition: ad469x.c:799
no_os_error.h
Error codes definition.
no_os_pwm_enable
int32_t no_os_pwm_enable(struct no_os_pwm_desc *desc)
Enable PWM signal generation.
Definition: no_os_pwm.c:104
ad469x_adv_sequence_set_num_slots
int32_t ad469x_adv_sequence_set_num_slots(struct ad469x_dev *dev, uint8_t num_slots)
Configure advanced sequencer number of slots, temp channel not included.
Definition: ad469x.c:513
NO_OS_DIV_ROUND_UP
#define NO_OS_DIV_ROUND_UP(x, y)
Definition: no_os_util.h:56
AD469x_REG_GP_MODE
#define AD469x_REG_GP_MODE
Definition: ad469x.h:93
AD469x_REG_TEMP_CTRL_TEMP_EN
#define AD469x_REG_TEMP_CTRL_TEMP_EN(x)
Definition: ad469x.h:140
spi_engine_set_transfer_width
int32_t spi_engine_set_transfer_width(struct no_os_spi_desc *desc, uint8_t data_wdith)
Set width of the transfered word over SPI.
Definition: spi_engine.c:131
ad469x_is_temp_channel
bool ad469x_is_temp_channel(struct ad469x_dev *dev, uint8_t channel)
Definition: ad469x.c:285
AD469x_REG_REF_CTRL
#define AD469x_REG_REF_CTRL
Definition: ad469x.h:88
ad7616_init_param::offload_init_param
struct spi_engine_offload_init_param * offload_init_param
Definition: ad7616.h:211
ad469x_init_param::reg_data_width
uint8_t reg_data_width
Definition: ad469x.h:282
AD469x_CMD_SEL_TEMP_SNSOR_CH
#define AD469x_CMD_SEL_TEMP_SNSOR_CH
Definition: ad469x.h:106
ad7616_init_param::trigger_pwm_init
struct no_os_pwm_init_param * trigger_pwm_init
Definition: ad7616.h:213
no_os_pwm_disable
int32_t no_os_pwm_disable(struct no_os_pwm_desc *desc)
Disable PWM signal generation.
Definition: no_os_pwm.c:121
ad469x_set_channel_sequence
int32_t ad469x_set_channel_sequence(struct ad469x_dev *dev, enum ad469x_channel_sequencing seq)
Set channel sequence.
Definition: ad469x.c:408
spi_engine.h
ad469x_reg_access
ad469x_reg_access
Register access modes.
Definition: ad469x.h:198
AD469x_REG_CONFIG_IN
#define AD469x_REG_CONFIG_IN(x)
Definition: ad469x.h:96
AD469x_AIN_HIGH_Z_ENABLE
@ AD469x_AIN_HIGH_Z_ENABLE
Definition: ad469x.h:253
ad469x_init_param::enable_extended_init
bool enable_extended_init
Definition: ad469x.h:304
ad469x_dev::capture_data_width
uint8_t capture_data_width
Definition: ad469x.h:327
ID_AD4695
@ ID_AD4695
Definition: ad469x.h:208
ad469x_busy_gp_sel
ad469x_busy_gp_sel
Busy state, possible general purpose pin selections.
Definition: ad469x.h:187
AD469x_single_cycle
@ AD469x_single_cycle
Definition: ad469x.h:174
ad469x_dev::std_seq_osr
enum ad469x_osr_ratios std_seq_osr
Definition: ad469x.h:344
ad469x_spi_write_mask
int32_t ad469x_spi_write_mask(struct ad469x_dev *dev, uint16_t reg_addr, uint8_t mask, uint8_t data)
Definition: ad469x.c:200
ad469x_dev::offload_init_param
struct spi_engine_offload_init_param * offload_init_param
Definition: ad469x.h:320
ad469x_set_busy
int32_t ad469x_set_busy(struct ad469x_dev *dev, enum ad469x_busy_gp_sel gp_sel)
Configure converter busy indicator to the output of the specified port.
Definition: ad469x.c:634
ad469x_dev::num_slots
uint8_t num_slots
Definition: ad469x.h:353
AD469x_SETUP_IF_MODE_CONV
#define AD469x_SETUP_IF_MODE_CONV
Definition: ad469x.h:114
ad469x_adv_seq_osr
int32_t ad469x_adv_seq_osr(struct ad469x_dev *dev, uint16_t ch, enum ad469x_osr_ratios ratio)
Configure over sampling ratio in advanced sequencer mode.
Definition: ad469x.c:306
AD469x_GP_MODE_BUSY_GP_SEL
#define AD469x_GP_MODE_BUSY_GP_SEL(x)
Definition: ad469x.h:130
no_os_hweight16
unsigned int no_os_hweight16(uint16_t word)
ad469x_ref_set
ad469x_ref_set
Reference input range control.
Definition: ad469x.h:239
ad469x.h
Header file for ad469x Driver.
AD469x_REG_SEQ_CTRL
#define AD469x_REG_SEQ_CTRL
Definition: ad469x.h:89
no_os_gpio_remove
int32_t no_os_gpio_remove(struct no_os_gpio_desc *desc)
Free the resources allocated by no_os_gpio_get().
Definition: no_os_gpio.c:110
AD469x_REG_CONFIG_IN_MODE_MASK
#define AD469x_REG_CONFIG_IN_MODE_MASK
Definition: ad469x.h:156
AD469x_REG_STD_SEQ_CONFIG
#define AD469x_REG_STD_SEQ_CONFIG
Definition: ad469x.h:91
no_os_spi_desc
Structure holding SPI descriptor.
Definition: no_os_spi.h:177
AD469x_REG_IF_CONFIG_C_MB_STRICT_MASK
#define AD469x_REG_IF_CONFIG_C_MB_STRICT_MASK
Definition: ad469x.h:146
num_channels
num_channels
Definition: ad3552r.h:248
ad469x_adv_sequence_set_slot
int32_t ad469x_adv_sequence_set_slot(struct ad469x_dev *dev, uint8_t slot, uint8_t channel)
Advanced sequencer, assign channel to a slot.
Definition: ad469x.c:541
dev_info
struct ad469x_device_info dev_info[]
Definition: ad469x.c:75
AD469x_REG_TEMP_CTRL
#define AD469x_REG_TEMP_CTRL
Definition: ad469x.h:95
AD469x_REG_AS_SLOT_INX
#define AD469x_REG_AS_SLOT_INX(x)
Definition: ad469x.h:143
no_os_gpio_desc
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:102
ad469x_init_param::std_seq_pin_pairing
enum ad469x_pin_pairing std_seq_pin_pairing
Definition: ad469x.h:288
ad469x_config
int32_t ad469x_config(struct ad469x_dev *dev, struct ad469x_init_param *config_desc)
Definition: ad469x.c:925
AD469x_SEQ_CTRL_STD_SEQ_EN_MASK
#define AD469x_SEQ_CTRL_STD_SEQ_EN_MASK
Definition: ad469x.h:133
ad469x_remove
int32_t ad469x_remove(struct ad469x_dev *dev)
Free the memory allocated by ad469x_init().
Definition: ad469x.c:1200
spi_engine_offload_message::commands
uint32_t * commands
Definition: spi_engine.h:165
no_os_pwm_desc
Structure representing an PWM generator device.
Definition: no_os_pwm.h:99
ad469x_dev
Structure representing an ad469x device.
Definition: ad469x.h:311
ad469x_init
int32_t ad469x_init(struct ad469x_dev **device, struct ad469x_init_param *init_param)
Definition: ad469x.c:1071
no_os_pwm_init
int32_t no_os_pwm_init(struct no_os_pwm_desc **desc, const struct no_os_pwm_init_param *param)
Initialize the PWM peripheral.
Definition: no_os_pwm.c:57
AD469x_REG_CONFIG_IN_OSR
#define AD469x_REG_CONFIG_IN_OSR(x)
Definition: ad469x.h:151
ad7616_init_param::dcache_invalidate_range
void(* dcache_invalidate_range)(uint32_t address, uint32_t bytes_count)
Definition: ad7616.h:236
ad7616_init_param::axi_clkgen_rate
uint32_t axi_clkgen_rate
Definition: ad7616.h:217
ad469x_device_info::max_data_ch
uint8_t max_data_ch
Definition: ad469x.c:71
AD469x_INx_REF_GND
@ AD469x_INx_REF_GND
Definition: ad469x.h:230
AD469x_SLOTS_NO
#define AD469x_SLOTS_NO
Definition: ad469x.h:163
no_os_malloc
void * no_os_malloc(size_t size)
Allocate memory and return a pointer to it.
Definition: chibios_alloc.c:49
AD469x_OSR_64
@ AD469x_OSR_64
Definition: ad469x.h:222
AD469x_REG_SCRATCH_PAD
#define AD469x_REG_SCRATCH_PAD
Definition: ad469x.h:74
ad469x_dev::gpio_busy
struct no_os_gpio_desc * gpio_busy
Definition: ad469x.h:335
no_os_pwm.h
Header file of PWM Interface.
AD469x_BYTE_ACCESS
@ AD469x_BYTE_ACCESS
Definition: ad469x.h:199
ad469x_std_seq_osr
int32_t ad469x_std_seq_osr(struct ad469x_dev *dev, enum ad469x_osr_ratios ratio)
Configure over sampling ratio in standard sequencer mode.
Definition: ad469x.c:363
ad469x_sequence_enable_temp
int32_t ad469x_sequence_enable_temp(struct ad469x_dev *dev)
Enable temperature read at the end of the sequence, for standard and advanced sequencer.
Definition: ad469x.c:590
AD469x_OSR_16
@ AD469x_OSR_16
Definition: ad469x.h:221
ad469x_osr_ratios
ad469x_osr_ratios
Supported oversampling ratios.
Definition: ad469x.h:218
no_os_field_get
uint32_t no_os_field_get(uint32_t mask, uint32_t word)
AD469x_2P75_3P25
@ AD469x_2P75_3P25
Definition: ad469x.h:241
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
AD469x_REG_IF_CONFIG_C
#define AD469x_REG_IF_CONFIG_C
Definition: ad469x.h:78
AD469x_busy_gp0
@ AD469x_busy_gp0
Definition: ad469x.h:189
ad469x_spi_reg_read
int32_t ad469x_spi_reg_read(struct ad469x_dev *dev, uint16_t reg_addr, uint8_t *reg_data)
Definition: ad469x.c:93
AD469x_REG_CONFIG_IN_HIZ_EN
#define AD469x_REG_CONFIG_IN_HIZ_EN(x)
Definition: ad469x.h:153
ad469x_is_temp_channel
bool ad469x_is_temp_channel(struct ad469x_dev *dev, uint8_t channel)
Definition: ad469x.c:285
ad469x_std_pin_pairing
int32_t ad469x_std_pin_pairing(struct ad469x_dev *dev, enum ad469x_pin_pairing pin_pair)
Configure the pin pairing option in standard sequencer mode.
Definition: ad469x.c:391
AD469x_OSR_4
@ AD469x_OSR_4
Definition: ad469x.h:220
AD469x_REG_REF_VREF_SET_MASK
#define AD469x_REG_REF_VREF_SET_MASK
Definition: ad469x.h:119
AD469x_OSR_1
@ AD469x_OSR_1
Definition: ad469x.h:219
ad469x_spi_reg_write
int32_t ad469x_spi_reg_write(struct ad469x_dev *dev, uint16_t reg_addr, uint8_t reg_data)
Definition: ad469x.c:134
AD469x_GP_MODE_BUSY_GP_EN
#define AD469x_GP_MODE_BUSY_GP_EN(x)
Definition: ad469x.h:128
ad469x_dev::gpio_convst
struct no_os_gpio_desc * gpio_convst
Definition: ad469x.h:333
ad469x_init_param::num_data_ch
uint8_t num_data_ch
Definition: ad469x.h:300
no_os_gpio_set_value
int32_t no_os_gpio_set_value(struct no_os_gpio_desc *desc, uint8_t value)
Set the value of the specified GPIO.
Definition: no_os_gpio.c:203
init_param
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:119
ad7616_init_param::clkgen_init
struct axi_clkgen_init * clkgen_init
Definition: ad7616.h:215
ad469x_seq_read_data
int32_t ad469x_seq_read_data(struct ad469x_dev *dev, uint32_t *buf, uint32_t samples)
Read from device when converter has the channel sequencer activated. Enter register mode to read/writ...
Definition: ad469x.c:765
AD469x_2P4_2P75
@ AD469x_2P4_2P75
Definition: ad469x.h:240
ad469x_adv_sequence_set_slot
int32_t ad469x_adv_sequence_set_slot(struct ad469x_dev *dev, uint8_t slot, uint8_t channel)
Advanced sequencer, assign channel to a slot.
Definition: ad469x.c:541
AD469x_SETUP_CYC_CTRL_SINGLE
#define AD469x_SETUP_CYC_CTRL_SINGLE(x)
Definition: ad469x.h:116
ad469x_dev::spi_desc
struct no_os_spi_desc * spi_desc
Definition: ad469x.h:313
ad469x_dev::num_data_ch
uint8_t num_data_ch
Definition: ad469x.h:355
AD469x_WORD_ACCESS
@ AD469x_WORD_ACCESS
Definition: ad469x.h:200
AD469x_CMD_REG_CONFIG_MODE
#define AD469x_CMD_REG_CONFIG_MODE
Definition: ad469x.h:105
AD469x_SETUP_IF_MODE_MASK
#define AD469x_SETUP_IF_MODE_MASK
Definition: ad469x.h:113
ad469x_init_param::clkgen_init
struct axi_clkgen_init * clkgen_init
Definition: ad469x.h:269
ad469x_init_param::capture_data_width
uint8_t capture_data_width
Definition: ad469x.h:284
spi_engine_offload_transfer
int32_t spi_engine_offload_transfer(struct no_os_spi_desc *desc, struct spi_engine_offload_message msg, uint32_t no_samples)
Initiate a SPI transfer in offload mode.
Definition: spi_engine.c:805
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
AD469x_REG_AS_SLOT
#define AD469x_REG_AS_SLOT(x)
Definition: ad469x.h:102
spi_engine_offload_init_param
Structure containing the init parameters needed by the offload module.
Definition: spi_engine.h:145
no_os_gpio.h
Header file of GPIO Interface.
ad469x_config
int32_t ad469x_config(struct ad469x_dev *dev, struct ad469x_init_param *config_desc)
Definition: ad469x.c:925
AD469x_CHANNEL_NO
#define AD469x_CHANNEL_NO
Definition: ad469x.h:162
no_os_spi_desc::max_speed_hz
uint32_t max_speed_hz
Definition: no_os_spi.h:183
ad469x_init_param::gpio_busy
struct no_os_gpio_init_param * gpio_busy
Definition: ad469x.h:278
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
ad469x_get_num_channels
int32_t ad469x_get_num_channels(struct ad469x_dev *dev, uint8_t *num_channels)
Definition: ad469x.c:272
ad469x_init_param::std_seq_osr
enum ad469x_osr_ratios std_seq_osr
Definition: ad469x.h:293
AD469x_REG_STATUS_RESET_MASK
#define AD469x_REG_STATUS_RESET_MASK
Definition: ad469x.h:110
axi_clkgen_remove
int32_t axi_clkgen_remove(struct axi_clkgen *clkgen)
axi_clkgen_remove
Definition: clk_axi_clkgen.c:546
no_os_util.h
Header file of utility functions.
ad469x_spi_reg_write
int32_t ad469x_spi_reg_write(struct ad469x_dev *dev, uint16_t reg_addr, uint8_t reg_data)
Definition: ad469x.c:134
ad469x_device_info::max_rate_ksps
uint32_t max_rate_ksps
Definition: ad469x.c:72
ad469x_init_param::adv_seq_osr_resol
enum ad469x_osr_ratios adv_seq_osr_resol[AD469x_CHANNEL_NO]
Definition: ad469x.h:296
ad469x_configure_ain_high_z
int32_t ad469x_configure_ain_high_z(struct ad469x_dev *dev, uint8_t ch, enum ad469x_ain_high_z status)
Configure analog input high Z mode.
Definition: ad469x.c:1030
spi_engine_offload_message::rx_addr
uint32_t rx_addr
Definition: spi_engine.h:173
AD469x_INx_EVEN_ODD
@ AD469x_INx_EVEN_ODD
Definition: ad469x.h:232
AD469x_SEQ_CTRL_NUM_SLOTS_AS_MASK
#define AD469x_SEQ_CTRL_NUM_SLOTS_AS_MASK
Definition: ad469x.h:135
ad469x_spi_read_mask
int32_t ad469x_spi_read_mask(struct ad469x_dev *dev, uint16_t reg_addr, uint8_t mask, uint8_t *data)
Definition: ad469x.c:175
no_os_gpio_direction_output
int32_t no_os_gpio_direction_output(struct no_os_gpio_desc *desc, uint8_t value)
Enable the output direction of the specified GPIO.
Definition: no_os_gpio.c:153
ad469x_exit_conversion_mode
int32_t ad469x_exit_conversion_mode(struct ad469x_dev *dev)
Exit conversion mode. Enter register mode to read/write registers.
Definition: ad469x.c:679
ad469x_init_param::offload_init_param
struct spi_engine_offload_init_param * offload_init_param
Definition: ad469x.h:265
ad469x_dev::ch_slots
uint8_t ch_slots[AD469x_SLOTS_NO]
Definition: ad469x.h:349
ad469x_init_param
Structure containing the init parameters needed by the ad469x device.
Definition: ad469x.h:260
AD469x_standard_seq
@ AD469x_standard_seq
Definition: ad469x.h:178
ad469x_dev::temp_enabled
bool temp_enabled
Definition: ad469x.h:351
ad469x_get_ain_high_z_status
int32_t ad469x_get_ain_high_z_status(struct ad469x_dev *dev, uint8_t ch, enum ad469x_ain_high_z *status)
Get the status of analog input high Z mode.
Definition: ad469x.c:1046
ad469x_seq_read_data
int32_t ad469x_seq_read_data(struct ad469x_dev *dev, uint32_t *buf, uint32_t samples)
Read from device when converter has the channel sequencer activated. Enter register mode to read/writ...
Definition: ad469x.c:765
AD469x_REG_STATUS
#define AD469x_REG_STATUS
Definition: ad469x.h:80
AD469x_REG_SETUP
#define AD469x_REG_SETUP
Definition: ad469x.h:87
ad469x_dev::reg_data_width
uint8_t reg_data_width
Definition: ad469x.h:325
no_os_spi_init_param
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:131
no_os_gpio_get_optional
int32_t no_os_gpio_get_optional(struct no_os_gpio_desc **desc, const struct no_os_gpio_init_param *param)
Get the value of an optional GPIO.
Definition: no_os_gpio.c:81