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