Go to the documentation of this file.
55 #define AD5460_NOP 0x00
56 #define AD5460_CH_FUNC_SETUP(x) (0x01 + (x * 6))
57 #define AD5460_OUTPUT_CONFIG(x) (0x02 + (x * 6))
58 #define AD5460_DAC_SLEW_CONFIG(x) (0x03 + (x * 6))
59 #define AD5460_DAC_CODE(x) (0x04 + (x * 6))
60 #define AD5460_DAC_CLR_CODE(x) (0x05 + (x * 6))
61 #define AD5460_DAC_ACTIVE(x) (0x06 + (x * 6))
62 #define AD5460_GPIO_CONFIG(x) (0x19 + x)
63 #define AD5460_WTD_CONFIG 0x1D
64 #define AD5460_DIAG_CONFIG 0x1E
65 #define AD5460_PWR_CONFIG 0x1F
66 #define AD5460_LIVE_STATUS 0x20
67 #define AD5460_DIGITAL_ALERT_STATUS 0x21
68 #define AD5460_ANALOG_ALERT_STATUS 0x22
69 #define AD5460_DIGITAL_ALERT_MSK 0x23
70 #define AD5460_ANALOG_ALERT_MSK 0x24
71 #define AD5460_READ_SELECT 0x73
72 #define AD5460_THERM_RST 0x74
73 #define AD5460_CMD_KEY 0x75
74 #define AD5460_BROADCAST_CMD_KEY 0x76
75 #define AD5460_SCRATCH(x) (0x77 + x)
76 #define AD5460_GENERIC_ID 0x7B
77 #define AD5460_SILICON_REV 0x7C
78 #define AD5460_SILICON_ID0 0x7D
79 #define AD5460_SILICON_ID1 0x7E
80 #define AD5460_SILICON_ID2 0x7F
83 #define AD5460_CMD_KEY_RESET_1 0x9A17
84 #define AD5460_CMD_KEY_RESET_2 0xE9C1
87 #define AD5460_CH_FUNC_SETUP_MSK NO_OS_GENMASK(3, 0)
90 #define AD5460_AVDD_SELECT_MSK NO_OS_GENMASK(13, 12)
91 #define AD5460_CLR_EN_MSK NO_OS_BIT(11)
92 #define AD5460_WAIT_LDAC_CMD_MSK NO_OS_BIT(10)
93 #define AD5460_IOUT_RANGE_MSK NO_OS_GENMASK(9, 8)
94 #define AD5460_I_LIMIT_MSK NO_OS_BIT(7)
95 #define AD5460_ALARM_DEG_PERIOD_MSK NO_OS_BIT(6)
96 #define AD5460_VOUT_RANGE_MSK NO_OS_BIT(5)
97 #define AD5460_VIOUT_DRV_EN_DLY_MSK NO_OS_GENMASK(4, 3)
98 #define AD5460_VOUT_4W_EN_MSK NO_OS_BIT(2)
99 #define AD5460_VIOUT_GLITCH_MSK NO_OS_GENMASK(1, 0)
102 #define AD5460_SLEW_EN_MSK NO_OS_GENMASK(5, 4)
103 #define AD5460_SLEW_LIN_STEP_MSK NO_OS_GENMASK(3, 2)
104 #define AD5460_SLEW_LIN_RATE_MSK NO_OS_GENMASK(1, 0)
107 #define AD5460_DAC_CODE_MSK NO_OS_GENMASK(15, 0)
110 #define AD5460_DAC_CLR_CODE_MSK NO_OS_GENMASK(15, 0)
113 #define AD5460_DAC_ACTIVE_MSK NO_OS_GENMASK(15, 0)
116 #define AD5460_GPI_DATA_MSK NO_OS_BIT(5)
117 #define AD5460_GPO_DATA_MSK NO_OS_BIT(4)
118 #define AD5460_GP_WK_PD_EN_MSK NO_OS_BIT(3)
119 #define AD5460_GPIO_SELECT_MSK NO_OS_GENMASK(2, 0)
122 #define AD5460_DIAG_SELECT_MSK NO_OS_GENMASK(4, 0)
125 #define AD5460_REF_EN_MSK NO_OS_BIT(0)
128 #define AD5460_TEMP_ALERT_STATUS_MSK NO_OS_BIT(9)
129 #define AD5460_SUPPLY_STATUS_MSK NO_OS_BIT(8)
130 #define AD5460_ANALOG_IO_SC_STATUS_D_MSK NO_OS_BIT(7)
131 #define AD5460_ANALOG_IO_SC_STATUS_C_MSK NO_OS_BIT(6)
132 #define AD5460_ANALOG_IO_SC_STATUS_B_MSK NO_OS_BIT(5)
133 #define AD5460_ANALOG_IO_SC_STATUS_A_MSK NO_OS_BIT(4)
134 #define AD5460_ANALOG_IO_OC_STATUS_D_MSK NO_OS_BIT(3)
135 #define AD5460_ANALOG_IO_OC_STATUS_C_MSK NO_OS_BIT(2)
136 #define AD5460_ANALOG_IO_OC_STATUS_B_MSK NO_OS_BIT(1)
137 #define AD5460_ANALOG_IO_OC_STATUS_A_MSK NO_OS_BIT(0)
140 #define AD5460_TEMP_ALERT_MSK NO_OS_BIT(4)
141 #define AD5460_CAL_MEM_ERR_MSK NO_OS_BIT(3)
142 #define AD5460_SPI_ERR_MSK NO_OS_BIT(2)
143 #define AD5460_WDT_RESET_OCCURRED_MSK NO_OS_BIT(1)
144 #define AD5460_RESET_OCCURRED_MSK NO_OS_BIT(0)
147 #define AD5460_AVDD_HI_ERR_MSK NO_OS_BIT(12)
148 #define AD5460_AVDD_LO_ERR_MSK NO_OS_BIT(11)
149 #define AD5460_AVCC_ERR_MSK NO_OS_BIT(10)
150 #define AD5460_IODVCC_ERR_MSK NO_OS_BIT(9)
151 #define AD5460_AVSS_ERR_MSK NO_OS_BIT(8)
152 #define AD5460_ANALOG_IO_SC_D_MSK NO_OS_BIT(7)
153 #define AD5460_ANALOG_IO_SC_C_MSK NO_OS_BIT(6)
154 #define AD5460_ANALOG_IO_SC_B_MSK NO_OS_BIT(5)
155 #define AD5460_ANALOG_IO_SC_A_MSK NO_OS_BIT(4)
156 #define AD5460_ANALOG_IO_OC_D_MSK NO_OS_BIT(3)
157 #define AD5460_ANALOG_IO_OC_C_MSK NO_OS_BIT(2)
158 #define AD5460_ANALOG_IO_OC_B_MSK NO_OS_BIT(1)
159 #define AD5460_ANALOG_IO_OC_A_MSK NO_OS_BIT(0)
162 #define AD5460_READBACK_SELECT_MODE_MSK NO_OS_GENMASK(8, 0)
163 #define AD5460_READBACK_ADDR_MSK NO_OS_GENMASK(8, 0)
166 #define AD5460_THERM_RST_MSK NO_OS_GENMASK(8, 0)
169 #define AD5460_CMD_KEY_MSK NO_OS_GENMASK(15, 0)
172 #define AD5460_BROADCAST_CMD_KEY_MSK NO_OS_GENMASK(15, 0)
175 #define AD5460_SCRATCH_BITS_MSK NO_OS_GENMASK(15, 0)
178 #define AD5460_GENERIC_ID_MSK NO_OS_GENMASK(2, 0)
181 #define AD5460_SILICON_REV_ID_MSK NO_OS_GENMASK(7, 0)
184 #define AD5460_LOT_MSK NO_OS_GENMASK(6, 0)
187 #define AD5460_Y_COORDS_MSK NO_OS_GENMASK(13, 7)
188 #define AD5460_X_COORDS_MSK NO_OS_GENMASK(6, 0)
191 #define AD5460_WAFER_NUM_MSK NO_OS_GENMASK(4, 0)
193 #define AD5460_FRAME_SIZE 5
194 #define AD5460_N_CHANNELS 4
195 #define AD5460_CH_A 0
196 #define AD5460_CH_B 1
197 #define AD5460_CH_C 2
198 #define AD5460_CH_D 3
199 #define AD5460_DAC_RANGE 12000
200 #define AD5460_DAC_CURRENT_RANGE_25MA 25000
201 #define AD5460_DAC_CURRENT_RANGE_20MA 20000
202 #define AD5460_DAC_CURRENT_RANGE_4MA 4000
203 #define AD5460_DAC_RESOLUTION 16
366 uint16_t *, uint32_t);
Header file of AD5460 Driver.
int ad5460_set_therm_rst(struct ad5460_desc *desc, bool enable)
Enable or disable the higher thermal reset.
Definition: ad5460.c:489
int ad5460_reg_write(struct ad5460_desc *desc, uint32_t addr, uint16_t val)
Write a register's value.
Definition: ad5460.c:196
#define AD5460_CMD_KEY_RESET_1
Definition: ad5460.h:83
void no_os_put_unaligned_be16(uint16_t val, uint8_t *buf)
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:85
int ad5460_reg_write(struct ad5460_desc *, uint32_t, uint16_t)
Write a register's value.
Definition: ad5460.c:196
#define AD5460_SLEW_LIN_STEP_MSK
Definition: ad5460.h:103
#define AD5460_GPI_DATA_MSK
Definition: ad5460.h:116
#define AD5460_CH_FUNC_SETUP(x)
Definition: ad5460.h:56
#define AD5460_FRAME_SIZE
Definition: ad5460.h:193
@ AD5460_VOUT_RANGE_NEG12_12V
Definition: ad5460.h:225
#define AD5460_CH_FUNC_SETUP_MSK
Definition: ad5460.h:87
enum ad5460_iout_range iout_range
Definition: ad5460.h:345
int ad5460_init(struct ad5460_desc **, struct ad5460_init_param *)
Initialize the device structure.
Definition: ad5460.c:560
int ad5460_set_diag(struct ad5460_desc *desc, uint32_t ch, enum ad5460_diag_mode diag_code)
Set which diagnostic value to be loaded in the DIAG_RESULT register.
Definition: ad5460.c:369
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
#define AD5460_READ_SELECT
Definition: ad5460.h:71
int ad5460_set_channel_function(struct ad5460_desc *, uint32_t, enum ad5460_op_mode)
Set the operation mode for a specific channel.
Definition: ad5460.c:261
int ad5460_set_channel_dac_code(struct ad5460_desc *, uint32_t, uint16_t)
Set and load a code for the DAC on a specific channel.
Definition: ad5460.c:356
AD5460 device descriptor.
Definition: ad5460.h:352
@ AD5460_DIAG_SENSE_AVDD_CH_A
Definition: ad5460.h:301
Bitfield struct which maps on the LIVE_STATUS register.
Definition: ad5460.h:310
int ad5460_remove(struct ad5460_desc *desc)
Free the device descriptor.
Definition: ad5460.c:613
int ad5460_set_therm_rst(struct ad5460_desc *, bool)
Enable or disable the higher thermal reset.
Definition: ad5460.c:489
Header file of SPI Interface.
int ad5460_set_channel_i_limit(struct ad5460_desc *, uint32_t, enum ad5460_i_limit)
Set the current limit for a specific DAC channel in vout mode.
Definition: ad5460.c:335
#define AD5460_DAC_CURRENT_RANGE_25MA
Definition: ad5460.h:200
int ad5460_gpio_get(struct ad5460_desc *desc, uint32_t ch, uint8_t *val)
Get the GPO value for a specific channel.
Definition: ad5460.c:415
uint8_t ANALOG_IO_OC_STATUS_B
Definition: ad5460.h:312
@ AD5460_IOUT_RANGE_4_20MA
Definition: ad5460.h:234
@ AD5460_DIAG_SENSE_N_CH_B
Definition: ad5460.h:288
Used to store the live status bit fields.
Definition: ad5460.h:326
int ad5460_set_channel_iout_range(struct ad5460_desc *, uint32_t, enum ad5460_iout_range)
Set the current range for a specific channel.
Definition: ad5460.c:313
@ AD5460_LIN_RATE_76KHZ8
Definition: ad5460.h:260
ad5460_slew_lin_step
The voltage step size of Full Scale DAC Voltage.
Definition: ad5460.h:248
uint8_t SUPPLY_STATUS
Definition: ad5460.h:319
ad5460_lin_rate
Possible update rates for a DAC when slew control is enabled.
Definition: ad5460.h:258
Header file of Delay functions.
@ AD5460_DIAG_NO_DIAG
Definition: ad5460.h:278
@ AD5460_GPIO_SEL_GPIO
Definition: ad5460.h:270
enum ad5460_i_limit i_limit
Definition: ad5460.h:346
uint8_t ANALOG_IO_OC_STATUS_C
Definition: ad5460.h:313
int ad5460_reg_read(struct ad5460_desc *, uint32_t, uint16_t *)
Read a register's value.
Definition: ad5460.c:211
uint8_t ANALOG_IO_SC_STATUS_D
Definition: ad5460.h:318
int ad5460_dac_slew_enable(struct ad5460_desc *, uint32_t, enum ad5460_slew_lin_step, enum ad5460_lin_rate)
Configure and enable slew rate control for a DAC on a specific channel.
Definition: ad5460.c:449
int ad5460_gpio_set(struct ad5460_desc *desc, uint32_t ch, uint8_t val)
Set the logic value of a GPO pin.
Definition: ad5460.c:396
@ AD5460_VOLTAGE_OUT
Definition: ad5460.h:214
int ad5460_set_channel_i_limit(struct ad5460_desc *desc, uint32_t ch, enum ad5460_i_limit i_limit)
Set the current limit for a specific DAC channel in vout mode.
Definition: ad5460.c:335
@ NO_OS_GPIO_HIGH
Definition: no_os_gpio.h:123
#define AD5460_CMD_KEY
Definition: ad5460.h:73
@ AD5460_STEP_0_8_PERCENT
Definition: ad5460.h:249
@ AD5460_DIAG_SENSE_P_CH_A
Definition: ad5460.h:283
struct no_os_spi_desc * spi_desc
Definition: ad5460.h:354
uint8_t ANALOG_IO_OC_STATUS_A
Definition: ad5460.h:311
#define AD77416H_DEV_ADDRESS_MSK
Definition: ad5460.c:55
@ AD5460_I_LIMIT1
Definition: ad5460.h:242
uint8_t ANALOG_IO_SC_STATUS_A
Definition: ad5460.h:315
void * no_os_calloc(size_t nitems, size_t size)
Allocate memory and return a pointer to it, set memory to 0.
Definition: chibios_alloc.c:60
@ AD5460_DIAG_SENSE_CH_B
Definition: ad5460.h:284
ad5460_iout_range
Possible current output ranges for the DAC.
Definition: ad5460.h:231
#define AD5460_I_LIMIT_MSK
Definition: ad5460.h:94
@ AD5460_IOUT_RANGE_0_20MA
Definition: ad5460.h:233
@ AD5460_STEP_22_2_PERCENT
Definition: ad5460.h:252
@ AD5460_LIN_RATE_4KHZ8
Definition: ad5460.h:259
@ NO_OS_GPIO_LOW
Definition: no_os_gpio.h:121
@ AD5460_DIAG_SENSE_AVDD_LO
Definition: ad5460.h:299
@ AD5460_DIAG_INT_BG_V
Definition: ad5460.h:282
@ AD5460_GPIO_SEL_HIGH_Z
Definition: ad5460.h:269
#define AD5460_N_CHANNELS
Definition: ad5460.h:194
int ad5460_remove(struct ad5460_desc *desc)
Free the device descriptor.
Definition: ad5460.c:613
NO_OS_DECLARE_CRC8_TABLE(_crc_table)
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: aducm3029_delay.c:132
uint32_t no_os_field_prep(uint32_t mask, uint32_t val)
int ad5460_set_channel_iout_range(struct ad5460_desc *desc, uint32_t ch, enum ad5460_iout_range iout_range)
Set the current range for a specific channel.
Definition: ad5460.c:313
struct no_os_gpio_desc * reset_gpio
Definition: ad5460.h:357
@ AD5460_DIAG_SENSE_AVDD_CH_B
Definition: ad5460.h:302
@ AD5460_DIAG_SENSE_DGND
Definition: ad5460.h:297
#define AD5460_DAC_CURRENT_RANGE_20MA
Definition: ad5460.h:201
int ad5460_get_live(struct ad5460_desc *, union ad5460_live_status *)
Read the live status bits.
Definition: ad5460.c:435
uint8_t dev_addr
Definition: ad5460.h:332
int ad5460_set_gpio_config(struct ad5460_desc *, uint32_t, enum ad5460_gpio_select)
Set the GPIO operation mode.
Definition: ad5460.c:382
void no_os_crc8_populate_msb(uint8_t *table, const uint8_t polynomial)
int ad5460_dac_slew_disable(struct ad5460_desc *, uint32_t)
Disable the slew rate control.
Definition: ad5460.c:475
ad5460_gpio_select
GPO operation modes.
Definition: ad5460.h:268
@ AD5460_VOUT_RANGE_0_12V
Definition: ad5460.h:224
#define AD5460_SLEW_LIN_RATE_MSK
Definition: ad5460.h:104
@ AD5460_DIAG_SENSE_P_CH_C
Definition: ad5460.h:285
#define AD5460_CRC_POLYNOMIAL
Definition: ad5460.c:53
int ad5460_reset(struct ad5460_desc *)
Perform software or hardware reset and wait for device reset time.
Definition: ad5460.c:499
#define AD5460_DAC_CODE(x)
Definition: ad5460.h:59
#define AD5460_GPIO_CONFIG(x)
Definition: ad5460.h:62
#define AD5460_GPO_DATA_MSK
Definition: ad5460.h:117
@ AD5460_DIAG_REFIN
Definition: ad5460.h:280
@ AD5460_LIN_RATE_230KHZ4
Definition: ad5460.h:262
@ AD5460_DIAG_PTAT
Definition: ad5460.h:279
enum ad5460_op_mode function
Definition: ad5460.h:343
struct no_os_spi_init_param spi_ip
Definition: ad5460.h:333
int ad5460_reset(struct ad5460_desc *desc)
Perform software or hardware reset and wait for device reset time.
Definition: ad5460.c:499
#define AD5460_DAC_CURRENT_RANGE_4MA
Definition: ad5460.h:202
@ AD5460_DIAG_SENSE_AGND3
Definition: ad5460.h:296
#define AD5460_THERM_RST
Definition: ad5460.h:72
uint8_t comm_buff[AD5460_FRAME_SIZE]
Definition: ad5460.h:355
uint8_t ANALOG_IO_SC_STATUS_C
Definition: ad5460.h:317
@ AD5460_DIAG_SENSE_AVCC
Definition: ad5460.h:291
#define AD5460_OUTPUT_CONFIG(x)
Definition: ad5460.h:57
uint8_t ANALOG_IO_OC_STATUS_D
Definition: ad5460.h:314
ad5460_diag_mode
Possible values to be loaded in the DIAG_RESULT register.
Definition: ad5460.h:277
int ad5460_set_diag(struct ad5460_desc *, uint32_t, enum ad5460_diag_mode)
Set which diagnostic value to be loaded in the DIAG_RESULT register.
Definition: ad5460.c:369
@ AD5460_CURRENT_OUT_HART
Definition: ad5460.h:216
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
#define AD5460_IOUT_RANGE_MSK
Definition: ad5460.h:93
Structure holding SPI descriptor.
Definition: no_os_spi.h:177
@ AD5460_DIAG_REFOUT
Definition: ad5460.h:281
@ AD5460_DIAG_SENSE_N_CH_C
Definition: ad5460.h:289
@ AD5460_DIAG_SENSE_DVCC
Definition: ad5460.h:293
#define AD5460_SLEW_EN_MSK
Definition: ad5460.h:102
int ad5460_reg_read_raw(struct ad5460_desc *, uint32_t, uint8_t *)
Read a raw communication frame.
Definition: ad5460.c:165
ad5460_i_limit
DAC Current limits in Vout mode.
Definition: ad5460.h:240
int ad5460_set_channel_vout_range(struct ad5460_desc *desc, uint32_t ch, enum ad5460_vout_range vout_range)
Set the voltage range for a specific channel.
Definition: ad5460.c:291
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:102
int ad5460_set_channel_vout_range(struct ad5460_desc *, uint32_t, enum ad5460_vout_range)
Set the voltage range for a specific channel.
Definition: ad5460.c:291
struct no_os_gpio_init_param * reset_gpio_param
Definition: ad5460.h:334
uint8_t dev_addr
Definition: ad5460.h:353
Device channel state.
Definition: ad5460.h:341
@ AD5460_CURRENT_OUT
Definition: ad5460.h:215
ad5460_vout_range
Possible voltage output ranges for the DAC.
Definition: ad5460.h:223
#define AD5460_LIVE_STATUS
Definition: ad5460.h:66
enum ad5460_vout_range vout_range
Definition: ad5460.h:344
int ad5460_dac_slew_enable(struct ad5460_desc *desc, uint32_t ch, enum ad5460_slew_lin_step step, enum ad5460_lin_rate rate)
Configure and enable slew rate control for a DAC on a specific channel.
Definition: ad5460.c:449
@ AD5460_GPIO_SEL_GPI
Definition: ad5460.h:271
uint32_t no_os_field_get(uint32_t mask, uint32_t word)
int ad5460_gpio_set(struct ad5460_desc *, uint32_t, uint8_t)
Set the logic value of a GPO pin.
Definition: ad5460.c:396
@ AD5460_DIAG_SENSE_AVSS
Definition: ad5460.h:300
@ AD5460_DIAG_SENSE_LDO
Definition: ad5460.h:292
int ad5460_reg_update(struct ad5460_desc *desc, uint32_t addr, uint16_t mask, uint16_t val)
Update a register's field.
Definition: ad5460.c:237
#define NO_OS_BIT(x)
Definition: no_os_util.h:51
@ AD5460_DIAG_SENSE_AVDD_CH_D
Definition: ad5460.h:304
uint8_t no_os_crc8(const uint8_t *table, const uint8_t *pdata, size_t nbytes, uint8_t crc)
@ AD5460_LIN_RATE_153KHZ6
Definition: ad5460.h:261
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
@ AD5460_STEP_1_5_PERCENT
Definition: ad5460.h:250
#define AD5460_SCRATCH(x)
Definition: ad5460.h:75
#define AD5460_VOUT_RANGE_MSK
Definition: ad5460.h:96
int ad5460_dac_current_to_code(struct ad5460_desc *desc, uint32_t uamps, uint16_t *code, uint32_t ch)
Convers a microamp value in the corresponding DAC 16 bit code.
Definition: ad5460.c:109
struct _ad5460_live_status status_bits
Definition: ad5460.h:327
@ AD5460_DIAG_SENSE_P_CH_D
Definition: ad5460.h:286
uint8_t ANALOG_IO_SC_STATUS_B
Definition: ad5460.h:316
@ AD5460_I_LIMIT0
Definition: ad5460.h:241
void no_os_udelay(uint32_t usecs)
Wait until usecs microseconds passed.
Definition: aducm3029_delay.c:120
#define NULL
Definition: wrapper.h:64
ad5460_op_mode
Operation modes of the device.
Definition: ad5460.h:212
bool enabled
Definition: ad5460.h:342
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
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:119
@ AD5460_DIAG_SENSE_N_CH_A
Definition: ad5460.h:287
int ad5460_reg_read_raw(struct ad5460_desc *desc, uint32_t addr, uint8_t *val)
Read a raw communication frame.
Definition: ad5460.c:165
int ad5460_dac_voltage_to_code(struct ad5460_desc *, int32_t, uint16_t *, uint32_t)
Converts a millivolt value in the corresponding DAC 16 bit code.
Definition: ad5460.c:74
#define AD5460_NOP
Definition: ad5460.h:55
#define AD5460_CMD_KEY_RESET_2
Definition: ad5460.h:84
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
Header file of GPIO Interface.
uint16_t value
Definition: ad5460.h:328
@ AD5460_DIAG_SENSE_AVDD_CH_C
Definition: ad5460.h:303
@ AD5460_DIAG_SENSE_AVDD_HI
Definition: ad5460.h:298
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
uint16_t no_os_get_unaligned_be16(uint8_t *buf)
@ AD5460_DIAG_SENSE_AGND1
Definition: ad5460.h:294
int ad5460_set_channel_function(struct ad5460_desc *desc, uint32_t ch, enum ad5460_op_mode ch_func)
Set the operation mode for a specific channel.
Definition: ad5460.c:261
@ AD5460_DIAG_SENSE_AGND2
Definition: ad5460.h:295
#define AD5460_DAC_RANGE
Definition: ad5460.h:199
int ad5460_dac_slew_disable(struct ad5460_desc *desc, uint32_t ch)
Disable the slew rate control.
Definition: ad5460.c:475
int ad5460_set_channel_dac_code(struct ad5460_desc *desc, uint32_t ch, uint16_t dac_code)
Set and load a code for the DAC on a specific channel.
Definition: ad5460.c:356
int ad5460_get_live(struct ad5460_desc *desc, union ad5460_live_status *status)
Read the live status bits.
Definition: ad5460.c:435
Header file of utility functions.
int ad5460_init(struct ad5460_desc **desc, struct ad5460_init_param *init_param)
Initialize the device structure.
Definition: ad5460.c:560
@ AD5460_HIGH_Z
Definition: ad5460.h:213
#define AD5460_GPIO_SELECT_MSK
Definition: ad5460.h:119
int ad5460_dac_voltage_to_code(struct ad5460_desc *desc, int32_t mvolts, uint16_t *code, uint32_t ch)
Converts a millivolt value in the corresponding DAC 16 bit code.
Definition: ad5460.c:74
@ AD5460_STEP_6_1_PERCENT
Definition: ad5460.h:251
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
int ad5460_set_gpio_config(struct ad5460_desc *desc, uint32_t ch, enum ad5460_gpio_select config)
Set the GPIO operation mode.
Definition: ad5460.c:382
int ad5460_reg_update(struct ad5460_desc *, uint32_t, uint16_t, uint16_t)
Update a register's field.
Definition: ad5460.c:237
int ad5460_gpio_get(struct ad5460_desc *, uint32_t, uint8_t *)
Get the GPO value for a specific channel.
Definition: ad5460.c:415
@ AD5460_DIAG_SENSE_N_CH_D
Definition: ad5460.h:290
int ad5460_reg_read(struct ad5460_desc *desc, uint32_t addr, uint16_t *val)
Read a register's value.
Definition: ad5460.c:211
Header file of CRC-8 computation.
struct ad5460_channel_config channel_configs[AD5460_N_CHANNELS]
Definition: ad5460.h:356
#define AD5460_DIAG_CONFIG
Definition: ad5460.h:64
#define AD5460_DAC_RESOLUTION
Definition: ad5460.h:203
int ad5460_dac_current_to_code(struct ad5460_desc *, uint32_t, uint16_t *, uint32_t)
Convers a microamp value in the corresponding DAC 16 bit code.
Definition: ad5460.c:109
@ AD5460_IOUT_RANGE_0_25MA
Definition: ad5460.h:232
uint8_t TEMP_ALERT_STATUS
Definition: ad5460.h:320
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:131
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