Go to the documentation of this file.
49 #define AD5460_NOP 0x00
50 #define AD5460_CH_FUNC_SETUP(x) (0x01 + (x * 6))
51 #define AD5460_OUTPUT_CONFIG(x) (0x02 + (x * 6))
52 #define AD5460_DAC_SLEW_CONFIG(x) (0x03 + (x * 6))
53 #define AD5460_DAC_CODE(x) (0x04 + (x * 6))
54 #define AD5460_DAC_CLR_CODE(x) (0x05 + (x * 6))
55 #define AD5460_DAC_ACTIVE(x) (0x06 + (x * 6))
56 #define AD5460_GPIO_CONFIG(x) (0x19 + x)
57 #define AD5460_WTD_CONFIG 0x1D
58 #define AD5460_DIAG_CONFIG 0x1E
59 #define AD5460_PWR_CONFIG 0x1F
60 #define AD5460_LIVE_STATUS 0x20
61 #define AD5460_DIGITAL_ALERT_STATUS 0x21
62 #define AD5460_ANALOG_ALERT_STATUS 0x22
63 #define AD5460_DIGITAL_ALERT_MSK 0x23
64 #define AD5460_ANALOG_ALERT_MSK 0x24
65 #define AD5460_READ_SELECT 0x73
66 #define AD5460_THERM_RST 0x74
67 #define AD5460_CMD_KEY 0x75
68 #define AD5460_BROADCAST_CMD_KEY 0x76
69 #define AD5460_SCRATCH(x) (0x77 + x)
70 #define AD5460_GENERIC_ID 0x7B
71 #define AD5460_SILICON_REV 0x7C
72 #define AD5460_SILICON_ID0 0x7D
73 #define AD5460_SILICON_ID1 0x7E
74 #define AD5460_SILICON_ID2 0x7F
77 #define AD5460_CMD_KEY_RESET_1 0x9A17
78 #define AD5460_CMD_KEY_RESET_2 0xE9C1
81 #define AD5460_CH_FUNC_SETUP_MSK NO_OS_GENMASK(3, 0)
84 #define AD5460_AVDD_SELECT_MSK NO_OS_GENMASK(13, 12)
85 #define AD5460_CLR_EN_MSK NO_OS_BIT(11)
86 #define AD5460_WAIT_LDAC_CMD_MSK NO_OS_BIT(10)
87 #define AD5460_IOUT_RANGE_MSK NO_OS_GENMASK(9, 8)
88 #define AD5460_I_LIMIT_MSK NO_OS_BIT(7)
89 #define AD5460_ALARM_DEG_PERIOD_MSK NO_OS_BIT(6)
90 #define AD5460_VOUT_RANGE_MSK NO_OS_BIT(5)
91 #define AD5460_VIOUT_DRV_EN_DLY_MSK NO_OS_GENMASK(4, 3)
92 #define AD5460_VOUT_4W_EN_MSK NO_OS_BIT(2)
93 #define AD5460_VIOUT_GLITCH_MSK NO_OS_GENMASK(1, 0)
96 #define AD5460_SLEW_EN_MSK NO_OS_GENMASK(5, 4)
97 #define AD5460_SLEW_LIN_STEP_MSK NO_OS_GENMASK(3, 2)
98 #define AD5460_SLEW_LIN_RATE_MSK NO_OS_GENMASK(1, 0)
101 #define AD5460_DAC_CODE_MSK NO_OS_GENMASK(15, 0)
104 #define AD5460_DAC_CLR_CODE_MSK NO_OS_GENMASK(15, 0)
107 #define AD5460_DAC_ACTIVE_MSK NO_OS_GENMASK(15, 0)
110 #define AD5460_GPI_DATA_MSK NO_OS_BIT(5)
111 #define AD5460_GPO_DATA_MSK NO_OS_BIT(4)
112 #define AD5460_GP_WK_PD_EN_MSK NO_OS_BIT(3)
113 #define AD5460_GPIO_SELECT_MSK NO_OS_GENMASK(2, 0)
116 #define AD5460_DIAG_SELECT_MSK NO_OS_GENMASK(4, 0)
119 #define AD5460_REF_EN_MSK NO_OS_BIT(0)
122 #define AD5460_TEMP_ALERT_STATUS_MSK NO_OS_BIT(9)
123 #define AD5460_SUPPLY_STATUS_MSK NO_OS_BIT(8)
124 #define AD5460_ANALOG_IO_SC_STATUS_D_MSK NO_OS_BIT(7)
125 #define AD5460_ANALOG_IO_SC_STATUS_C_MSK NO_OS_BIT(6)
126 #define AD5460_ANALOG_IO_SC_STATUS_B_MSK NO_OS_BIT(5)
127 #define AD5460_ANALOG_IO_SC_STATUS_A_MSK NO_OS_BIT(4)
128 #define AD5460_ANALOG_IO_OC_STATUS_D_MSK NO_OS_BIT(3)
129 #define AD5460_ANALOG_IO_OC_STATUS_C_MSK NO_OS_BIT(2)
130 #define AD5460_ANALOG_IO_OC_STATUS_B_MSK NO_OS_BIT(1)
131 #define AD5460_ANALOG_IO_OC_STATUS_A_MSK NO_OS_BIT(0)
134 #define AD5460_TEMP_ALERT_MSK NO_OS_BIT(4)
135 #define AD5460_CAL_MEM_ERR_MSK NO_OS_BIT(3)
136 #define AD5460_SPI_ERR_MSK NO_OS_BIT(2)
137 #define AD5460_WDT_RESET_OCCURRED_MSK NO_OS_BIT(1)
138 #define AD5460_RESET_OCCURRED_MSK NO_OS_BIT(0)
141 #define AD5460_AVDD_HI_ERR_MSK NO_OS_BIT(12)
142 #define AD5460_AVDD_LO_ERR_MSK NO_OS_BIT(11)
143 #define AD5460_AVCC_ERR_MSK NO_OS_BIT(10)
144 #define AD5460_IODVCC_ERR_MSK NO_OS_BIT(9)
145 #define AD5460_AVSS_ERR_MSK NO_OS_BIT(8)
146 #define AD5460_ANALOG_IO_SC_D_MSK NO_OS_BIT(7)
147 #define AD5460_ANALOG_IO_SC_C_MSK NO_OS_BIT(6)
148 #define AD5460_ANALOG_IO_SC_B_MSK NO_OS_BIT(5)
149 #define AD5460_ANALOG_IO_SC_A_MSK NO_OS_BIT(4)
150 #define AD5460_ANALOG_IO_OC_D_MSK NO_OS_BIT(3)
151 #define AD5460_ANALOG_IO_OC_C_MSK NO_OS_BIT(2)
152 #define AD5460_ANALOG_IO_OC_B_MSK NO_OS_BIT(1)
153 #define AD5460_ANALOG_IO_OC_A_MSK NO_OS_BIT(0)
156 #define AD5460_READBACK_SELECT_MODE_MSK NO_OS_GENMASK(8, 0)
157 #define AD5460_READBACK_ADDR_MSK NO_OS_GENMASK(8, 0)
160 #define AD5460_THERM_RST_MSK NO_OS_GENMASK(8, 0)
163 #define AD5460_CMD_KEY_MSK NO_OS_GENMASK(15, 0)
166 #define AD5460_BROADCAST_CMD_KEY_MSK NO_OS_GENMASK(15, 0)
169 #define AD5460_SCRATCH_BITS_MSK NO_OS_GENMASK(15, 0)
172 #define AD5460_GENERIC_ID_MSK NO_OS_GENMASK(2, 0)
175 #define AD5460_SILICON_REV_ID_MSK NO_OS_GENMASK(7, 0)
178 #define AD5460_LOT_MSK NO_OS_GENMASK(6, 0)
181 #define AD5460_Y_COORDS_MSK NO_OS_GENMASK(13, 7)
182 #define AD5460_X_COORDS_MSK NO_OS_GENMASK(6, 0)
185 #define AD5460_WAFER_NUM_MSK NO_OS_GENMASK(4, 0)
187 #define AD5460_FRAME_SIZE 5
188 #define AD5460_N_CHANNELS 4
189 #define AD5460_CH_A 0
190 #define AD5460_CH_B 1
191 #define AD5460_CH_C 2
192 #define AD5460_CH_D 3
193 #define AD5460_DAC_RANGE 12000
194 #define AD5460_DAC_CURRENT_RANGE_25MA 25000
195 #define AD5460_DAC_CURRENT_RANGE_20MA 20000
196 #define AD5460_DAC_CURRENT_RANGE_4MA 4000
197 #define AD5460_DAC_RESOLUTION 16
360 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:483
int ad5460_reg_write(struct ad5460_desc *desc, uint32_t addr, uint16_t val)
Write a register's value.
Definition: ad5460.c:190
#define AD5460_CMD_KEY_RESET_1
Definition: ad5460.h:77
void no_os_put_unaligned_be16(uint16_t val, uint8_t *buf)
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:79
int ad5460_reg_write(struct ad5460_desc *, uint32_t, uint16_t)
Write a register's value.
Definition: ad5460.c:190
#define AD5460_SLEW_LIN_STEP_MSK
Definition: ad5460.h:97
#define AD5460_GPI_DATA_MSK
Definition: ad5460.h:110
#define AD5460_CH_FUNC_SETUP(x)
Definition: ad5460.h:50
#define AD5460_FRAME_SIZE
Definition: ad5460.h:187
@ AD5460_VOUT_RANGE_NEG12_12V
Definition: ad5460.h:219
#define AD5460_CH_FUNC_SETUP_MSK
Definition: ad5460.h:81
enum ad5460_iout_range iout_range
Definition: ad5460.h:339
int ad5460_init(struct ad5460_desc **, struct ad5460_init_param *)
Initialize the device structure.
Definition: ad5460.c:554
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:363
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
#define AD5460_READ_SELECT
Definition: ad5460.h:65
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:255
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:350
AD5460 device descriptor.
Definition: ad5460.h:346
@ AD5460_DIAG_SENSE_AVDD_CH_A
Definition: ad5460.h:295
Bitfield struct which maps on the LIVE_STATUS register.
Definition: ad5460.h:304
int ad5460_remove(struct ad5460_desc *desc)
Free the device descriptor.
Definition: ad5460.c:607
int ad5460_set_therm_rst(struct ad5460_desc *, bool)
Enable or disable the higher thermal reset.
Definition: ad5460.c:483
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:329
#define AD5460_DAC_CURRENT_RANGE_25MA
Definition: ad5460.h:194
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:409
uint8_t ANALOG_IO_OC_STATUS_B
Definition: ad5460.h:306
@ AD5460_IOUT_RANGE_4_20MA
Definition: ad5460.h:228
@ AD5460_DIAG_SENSE_N_CH_B
Definition: ad5460.h:282
Used to store the live status bit fields.
Definition: ad5460.h:320
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:307
@ AD5460_LIN_RATE_76KHZ8
Definition: ad5460.h:254
ad5460_slew_lin_step
The voltage step size of Full Scale DAC Voltage.
Definition: ad5460.h:242
uint8_t SUPPLY_STATUS
Definition: ad5460.h:313
ad5460_lin_rate
Possible update rates for a DAC when slew control is enabled.
Definition: ad5460.h:252
Header file of Delay functions.
@ AD5460_DIAG_NO_DIAG
Definition: ad5460.h:272
@ AD5460_GPIO_SEL_GPIO
Definition: ad5460.h:264
enum ad5460_i_limit i_limit
Definition: ad5460.h:340
uint8_t ANALOG_IO_OC_STATUS_C
Definition: ad5460.h:307
int ad5460_reg_read(struct ad5460_desc *, uint32_t, uint16_t *)
Read a register's value.
Definition: ad5460.c:205
uint8_t ANALOG_IO_SC_STATUS_D
Definition: ad5460.h:312
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:443
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:390
@ AD5460_VOLTAGE_OUT
Definition: ad5460.h:208
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:329
@ NO_OS_GPIO_HIGH
Definition: no_os_gpio.h:117
#define AD5460_CMD_KEY
Definition: ad5460.h:67
@ AD5460_STEP_0_8_PERCENT
Definition: ad5460.h:243
@ AD5460_DIAG_SENSE_P_CH_A
Definition: ad5460.h:277
struct no_os_spi_desc * spi_desc
Definition: ad5460.h:348
uint8_t ANALOG_IO_OC_STATUS_A
Definition: ad5460.h:305
#define AD77416H_DEV_ADDRESS_MSK
Definition: ad5460.c:49
@ AD5460_I_LIMIT1
Definition: ad5460.h:236
uint8_t ANALOG_IO_SC_STATUS_A
Definition: ad5460.h:309
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:54
@ AD5460_DIAG_SENSE_CH_B
Definition: ad5460.h:278
ad5460_iout_range
Possible current output ranges for the DAC.
Definition: ad5460.h:225
#define AD5460_I_LIMIT_MSK
Definition: ad5460.h:88
@ AD5460_IOUT_RANGE_0_20MA
Definition: ad5460.h:227
@ AD5460_STEP_22_2_PERCENT
Definition: ad5460.h:246
@ AD5460_LIN_RATE_4KHZ8
Definition: ad5460.h:253
@ NO_OS_GPIO_LOW
Definition: no_os_gpio.h:115
@ AD5460_DIAG_SENSE_AVDD_LO
Definition: ad5460.h:293
@ AD5460_DIAG_INT_BG_V
Definition: ad5460.h:276
@ AD5460_GPIO_SEL_HIGH_Z
Definition: ad5460.h:263
#define AD5460_N_CHANNELS
Definition: ad5460.h:188
int ad5460_remove(struct ad5460_desc *desc)
Free the device descriptor.
Definition: ad5460.c:607
NO_OS_DECLARE_CRC8_TABLE(_crc_table)
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: aducm3029_delay.c:126
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:307
struct no_os_gpio_desc * reset_gpio
Definition: ad5460.h:351
@ AD5460_DIAG_SENSE_AVDD_CH_B
Definition: ad5460.h:296
@ AD5460_DIAG_SENSE_DGND
Definition: ad5460.h:291
#define AD5460_DAC_CURRENT_RANGE_20MA
Definition: ad5460.h:195
int ad5460_get_live(struct ad5460_desc *, union ad5460_live_status *)
Read the live status bits.
Definition: ad5460.c:429
uint8_t dev_addr
Definition: ad5460.h:326
int ad5460_set_gpio_config(struct ad5460_desc *, uint32_t, enum ad5460_gpio_select)
Set the GPIO operation mode.
Definition: ad5460.c:376
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:469
ad5460_gpio_select
GPO operation modes.
Definition: ad5460.h:262
@ AD5460_VOUT_RANGE_0_12V
Definition: ad5460.h:218
#define AD5460_SLEW_LIN_RATE_MSK
Definition: ad5460.h:98
@ AD5460_DIAG_SENSE_P_CH_C
Definition: ad5460.h:279
#define AD5460_CRC_POLYNOMIAL
Definition: ad5460.c:47
int ad5460_reset(struct ad5460_desc *)
Perform software or hardware reset and wait for device reset time.
Definition: ad5460.c:493
#define AD5460_DAC_CODE(x)
Definition: ad5460.h:53
#define AD5460_GPIO_CONFIG(x)
Definition: ad5460.h:56
#define AD5460_GPO_DATA_MSK
Definition: ad5460.h:111
@ AD5460_DIAG_REFIN
Definition: ad5460.h:274
@ AD5460_LIN_RATE_230KHZ4
Definition: ad5460.h:256
@ AD5460_DIAG_PTAT
Definition: ad5460.h:273
enum ad5460_op_mode function
Definition: ad5460.h:337
struct no_os_spi_init_param spi_ip
Definition: ad5460.h:327
int ad5460_reset(struct ad5460_desc *desc)
Perform software or hardware reset and wait for device reset time.
Definition: ad5460.c:493
#define AD5460_DAC_CURRENT_RANGE_4MA
Definition: ad5460.h:196
@ AD5460_DIAG_SENSE_AGND3
Definition: ad5460.h:290
#define AD5460_THERM_RST
Definition: ad5460.h:66
uint8_t comm_buff[AD5460_FRAME_SIZE]
Definition: ad5460.h:349
uint8_t ANALOG_IO_SC_STATUS_C
Definition: ad5460.h:311
@ AD5460_DIAG_SENSE_AVCC
Definition: ad5460.h:285
#define AD5460_OUTPUT_CONFIG(x)
Definition: ad5460.h:51
uint8_t ANALOG_IO_OC_STATUS_D
Definition: ad5460.h:308
ad5460_diag_mode
Possible values to be loaded in the DIAG_RESULT register.
Definition: ad5460.h:271
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:363
@ AD5460_CURRENT_OUT_HART
Definition: ad5460.h:210
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
#define AD5460_IOUT_RANGE_MSK
Definition: ad5460.h:87
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
@ AD5460_DIAG_REFOUT
Definition: ad5460.h:275
@ AD5460_DIAG_SENSE_N_CH_C
Definition: ad5460.h:283
@ AD5460_DIAG_SENSE_DVCC
Definition: ad5460.h:287
#define AD5460_SLEW_EN_MSK
Definition: ad5460.h:96
int ad5460_reg_read_raw(struct ad5460_desc *, uint32_t, uint8_t *)
Read a raw communication frame.
Definition: ad5460.c:159
ad5460_i_limit
DAC Current limits in Vout mode.
Definition: ad5460.h:234
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:285
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:96
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:285
struct no_os_gpio_init_param * reset_gpio_param
Definition: ad5460.h:328
uint8_t dev_addr
Definition: ad5460.h:347
Device channel state.
Definition: ad5460.h:335
@ AD5460_CURRENT_OUT
Definition: ad5460.h:209
ad5460_vout_range
Possible voltage output ranges for the DAC.
Definition: ad5460.h:217
#define AD5460_LIVE_STATUS
Definition: ad5460.h:60
enum ad5460_vout_range vout_range
Definition: ad5460.h:338
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:443
@ AD5460_GPIO_SEL_GPI
Definition: ad5460.h:265
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:390
@ AD5460_DIAG_SENSE_AVSS
Definition: ad5460.h:294
@ AD5460_DIAG_SENSE_LDO
Definition: ad5460.h:286
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:231
#define NO_OS_BIT(x)
Definition: no_os_util.h:45
@ AD5460_DIAG_SENSE_AVDD_CH_D
Definition: ad5460.h:298
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:255
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
@ AD5460_STEP_1_5_PERCENT
Definition: ad5460.h:244
#define AD5460_SCRATCH(x)
Definition: ad5460.h:69
#define AD5460_VOUT_RANGE_MSK
Definition: ad5460.h:90
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:103
struct _ad5460_live_status status_bits
Definition: ad5460.h:321
@ AD5460_DIAG_SENSE_P_CH_D
Definition: ad5460.h:280
uint8_t ANALOG_IO_SC_STATUS_B
Definition: ad5460.h:310
@ AD5460_I_LIMIT0
Definition: ad5460.h:235
void no_os_udelay(uint32_t usecs)
Wait until usecs microseconds passed.
Definition: aducm3029_delay.c:114
#define NULL
Definition: wrapper.h:64
ad5460_op_mode
Operation modes of the device.
Definition: ad5460.h:206
bool enabled
Definition: ad5460.h:336
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
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
@ AD5460_DIAG_SENSE_N_CH_A
Definition: ad5460.h:281
int ad5460_reg_read_raw(struct ad5460_desc *desc, uint32_t addr, uint8_t *val)
Read a raw communication frame.
Definition: ad5460.c:159
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:68
#define AD5460_NOP
Definition: ad5460.h:49
#define AD5460_CMD_KEY_RESET_2
Definition: ad5460.h:78
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
Header file of GPIO Interface.
uint16_t value
Definition: ad5460.h:322
@ AD5460_DIAG_SENSE_AVDD_CH_C
Definition: ad5460.h:297
@ AD5460_DIAG_SENSE_AVDD_HI
Definition: ad5460.h:292
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
uint16_t no_os_get_unaligned_be16(uint8_t *buf)
@ AD5460_DIAG_SENSE_AGND1
Definition: ad5460.h:288
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:255
@ AD5460_DIAG_SENSE_AGND2
Definition: ad5460.h:289
#define AD5460_DAC_RANGE
Definition: ad5460.h:193
int ad5460_dac_slew_disable(struct ad5460_desc *desc, uint32_t ch)
Disable the slew rate control.
Definition: ad5460.c:469
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:350
int ad5460_get_live(struct ad5460_desc *desc, union ad5460_live_status *status)
Read the live status bits.
Definition: ad5460.c:429
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:554
@ AD5460_HIGH_Z
Definition: ad5460.h:207
#define AD5460_GPIO_SELECT_MSK
Definition: ad5460.h:113
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:68
@ AD5460_STEP_6_1_PERCENT
Definition: ad5460.h:245
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
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:376
int ad5460_reg_update(struct ad5460_desc *, uint32_t, uint16_t, uint16_t)
Update a register's field.
Definition: ad5460.c:231
int ad5460_gpio_get(struct ad5460_desc *, uint32_t, uint8_t *)
Get the GPO value for a specific channel.
Definition: ad5460.c:409
@ AD5460_DIAG_SENSE_N_CH_D
Definition: ad5460.h:284
int ad5460_reg_read(struct ad5460_desc *desc, uint32_t addr, uint16_t *val)
Read a register's value.
Definition: ad5460.c:205
Header file of CRC-8 computation.
struct ad5460_channel_config channel_configs[AD5460_N_CHANNELS]
Definition: ad5460.h:350
#define AD5460_DIAG_CONFIG
Definition: ad5460.h:58
#define AD5460_DAC_RESOLUTION
Definition: ad5460.h:197
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:103
@ AD5460_IOUT_RANGE_0_25MA
Definition: ad5460.h:226
uint8_t TEMP_ALERT_STATUS
Definition: ad5460.h:314
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140
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