no-OS
iio_adp1050.h
Go to the documentation of this file.
1 /***************************************************************************/
33 #ifndef IIO_ADP1050_H
34 #define IIO_ADP1050_H
35 
36 #include <stdbool.h>
37 #include "iio.h"
38 #include "adp1050.h"
39 
46 };
47 
56 };
57 
61 
64 
65 #endif /* IIO_ADP1050_H */
ADP1050_SR1_SR2_MODULATION_SETTINGS
#define ADP1050_SR1_SR2_MODULATION_SETTINGS
Definition: adp1050.h:346
adp1050_remove
int adp1050_remove(struct adp1050_desc *desc)
Free the resources allocated by the adp1050_init()
Definition: adp1050.c:1166
adp1050_set_close_loop
int adp1050_set_close_loop(struct adp1050_desc *desc)
Set close loop operation.
Definition: adp1050.c:654
no_os_sign_extend16
int16_t no_os_sign_extend16(uint16_t value, int index)
no_os_alloc.h
END_ATTRIBUTES_ARRAY
#define END_ATTRIBUTES_ARRAY
Definition: iio_types.h:116
ADP1050_IIO_IIN_CHAN
@ ADP1050_IIO_IIN_CHAN
Definition: iio_adp1050.c:189
ADP1050_IIO_MODULATION_AVAIL_MASK
#define ADP1050_IIO_MODULATION_AVAIL_MASK(x)
Definition: iio_adp1050.c:48
ADP1050_IIO_OUTB_CHAN
@ ADP1050_IIO_OUTB_CHAN
Definition: iio_adp1050.c:196
IIO_VAL_INT
@ IIO_VAL_INT
Definition: iio_types.h:50
iio_channel
Struct describing the scan type.
Definition: iio_types.h:168
adp1050_iio_remove
int adp1050_iio_remove(struct adp1050_iio_desc *)
Free resources allocated by the init function.
Definition: iio_adp1050.c:1269
ADP1050_FEEDFORWARD_OL_ENABLE
#define ADP1050_FEEDFORWARD_OL_ENABLE
Definition: adp1050.h:148
adp1050_iio_desc::iio_dev
struct iio_device * iio_dev
Definition: iio_adp1050.h:45
adp1050_iio_output_chan_type
adp1050_iio_output_chan_type
Definition: iio_adp1050.c:194
adp1050_iio_input_chan_type
adp1050_iio_input_chan_type
Definition: iio_adp1050.c:187
adp1050_mod
adp1050_mod
Definition: adp1050.h:403
ADP1050_IIO_FLOAT_FREQ_ENUM
#define ADP1050_IIO_FLOAT_FREQ_ENUM(x)
Definition: iio_adp1050.c:46
IIO_VAL_FRACTIONAL_LOG2
@ IIO_VAL_FRACTIONAL_LOG2
Definition: iio_types.h:56
ADP1050_DUTY_CYCLE
@ ADP1050_DUTY_CYCLE
Definition: adp1050.h:524
adp1050_iio_desc::adp1050_desc
struct adp1050_desc * adp1050_desc
Definition: iio_adp1050.h:44
ADP1050_CLOSE_LOOP
@ ADP1050_CLOSE_LOOP
Definition: adp1050.h:391
ADP1050_IIN
@ ADP1050_IIN
Definition: adp1050.h:522
iio_desc
Definition: iio.c:204
iio_ch_info
Structure holding channel attributess.
Definition: iio_types.h:103
no_os_units.h
Header file of Units.
adp1050_desc::loop
enum adp1050_loop loop
Definition: adp1050.h:564
adp1050_iio_vout_value_type
adp1050_iio_vout_value_type
Definition: iio_adp1050.c:179
adp1050_read
int adp1050_read(struct adp1050_desc *desc, uint16_t command, uint8_t *data, uint8_t bytes_number)
Read data from ADP1050.
Definition: adp1050.c:74
adp1050_read_vsense
int adp1050_read_vsense(struct adp1050_desc *desc, uint16_t *vsense)
Read Voltage Sense output raw value from the ADP1050.
Definition: adp1050.c:184
ADP1050_IIO_VOUT_COMMAND_VALUE
@ ADP1050_IIO_VOUT_COMMAND_VALUE
Definition: iio_adp1050.c:180
ADP1050_MARGIN_HIGH
#define ADP1050_MARGIN_HIGH
Definition: adp1050.h:79
ADP1050_IIO_ENABLE_MASK
#define ADP1050_IIO_ENABLE_MASK(x)
Definition: iio_adp1050.c:57
adp1050_iio_desc_init_param::iin_scale_monitor
uint16_t iin_scale_monitor
Definition: iio_adp1050.h:55
ADP1050_STATUS_TEMPERATURE_TYPE
@ ADP1050_STATUS_TEMPERATURE_TYPE
Definition: adp1050.h:532
ADP1050_SYNCH_GENERAL_SETTINGS
#define ADP1050_SYNCH_GENERAL_SETTINGS
Definition: adp1050.h:295
adp1050_write
int adp1050_write(struct adp1050_desc *desc, uint16_t command, uint16_t data, uint8_t bytes_number)
Write data to ADP1050.
Definition: adp1050.c:108
adp1050.h
Header file for the ADP1050 Driver.
ADP1050_IIO_OUT_MASK
#define ADP1050_IIO_OUT_MASK
Definition: iio_adp1050.c:56
ADP1050_PULSE_SKIPPING_ENABLE
#define ADP1050_PULSE_SKIPPING_ENABLE
Definition: adp1050.h:150
ADP1050_IIO_OUTPUT_CHANNELS
#define ADP1050_IIO_OUTPUT_CHANNELS
Definition: iio_adp1050.c:50
adp1050_iio_desc
Structure holding the ADP1050 IIO device descriptor.
Definition: iio_adp1050.h:43
ADP1050_MANT_MASK
#define ADP1050_MANT_MASK
Definition: adp1050.h:84
no_os_calloc
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
NO_OS_ARRAY_SIZE
#define NO_OS_ARRAY_SIZE(x)
Definition: no_os_util.h:49
adp1050_pwm_duty_cycle
int adp1050_pwm_duty_cycle(struct adp1050_desc *desc, uint16_t pulse_width, uint16_t pulse_start, enum adp1050_channel chan)
Set VOUT duty cycle for requested channel.
Definition: adp1050.c:324
ADP1050_TRIM_DEFAULT_PASS
#define ADP1050_TRIM_DEFAULT_PASS
Definition: adp1050.h:138
ADP1050_DUTY_CYCLE_READING_SETTINGS
#define ADP1050_DUTY_CYCLE_READING_SETTINGS
Definition: adp1050.h:355
adp1050_iio_init
int adp1050_iio_init(struct adp1050_iio_desc **iio_desc, struct adp1050_iio_desc_init_param *init_param)
Initializes the ADP1050 IIO descriptor.
Definition: iio_adp1050.c:1203
adp1050_vout_offset
int adp1050_vout_offset(struct adp1050_desc *desc, int16_t vout_offset)
Set output voltage offset.
Definition: adp1050.c:249
ADP1050_CHIP_DEFAULT_PASS
#define ADP1050_CHIP_DEFAULT_PASS
Definition: adp1050.h:135
ADP1050_IIO_VOUT_OFFSET_VALUE
@ ADP1050_IIO_VOUT_OFFSET_VALUE
Definition: iio_adp1050.c:184
adp1050_set_pwm
int adp1050_set_pwm(struct adp1050_desc *desc, enum adp1050_channel chan, enum adp1050_freq freq)
Set PWM channel and frequency.
Definition: adp1050.c:471
adp1050_freq_sync
int adp1050_freq_sync(struct adp1050_desc *desc, bool state_on)
Frequency synchronization of the PWM clock with an external clock Requires syni_desc to be initialize...
Definition: adp1050.c:736
ADP1050_IIO_FLOAT_FREQ_INDEX
#define ADP1050_IIO_FLOAT_FREQ_INDEX
Definition: iio_adp1050.c:44
ADP1050_IIO_VIN_CHAN
@ ADP1050_IIO_VIN_CHAN
Definition: iio_adp1050.c:188
ADP1050_IIO_OUT_ENABLE
@ ADP1050_IIO_OUT_ENABLE
Definition: iio_adp1050.c:173
IIO_SHARED_BY_ALL
@ IIO_SHARED_BY_ALL
Definition: iio_types.h:122
ADP1050_IIO_TEMP_CHAN
@ ADP1050_IIO_TEMP_CHAN
Definition: iio_adp1050.c:191
no_os_field_prep
uint32_t no_os_field_prep(uint32_t mask, uint32_t val)
ADP1050_VOUT_MARGIN_LOW
#define ADP1050_VOUT_MARGIN_LOW
Definition: adp1050.h:206
ADP1050_IIO_VOUT_MARGIN_HIGH_VALUE
@ ADP1050_IIO_VOUT_MARGIN_HIGH_VALUE
Definition: iio_adp1050.c:182
ADP1050_IIO_SR1_CHAN
@ ADP1050_IIO_SR1_CHAN
Definition: iio_adp1050.c:197
ADP1050_IIO_SR2_CHAN
@ ADP1050_IIO_SR2_CHAN
Definition: iio_adp1050.c:198
iio.h
Header file of iio.
no_os_error.h
Error codes definition.
ADP1050_VIN
@ ADP1050_VIN
Definition: adp1050.h:521
adp1050_pulse_skipping
int adp1050_pulse_skipping(struct adp1050_desc *desc, uint8_t pulse_threshold, bool state_on)
Enable or disbale the pulse skipping mode.
Definition: adp1050.c:681
iio_attribute::name
const char * name
Definition: iio_types.h:131
ADP1050_IIO_VOUT_MARGIN_LOW_VALUE
@ ADP1050_IIO_VOUT_MARGIN_LOW_VALUE
Definition: iio_adp1050.c:181
ADP1050_IIO_OUTA_DUTY_CYCLE_REPORTING
#define ADP1050_IIO_OUTA_DUTY_CYCLE_REPORTING
Definition: iio_adp1050.c:52
ADP1050_IIO_FREQ_SYNC_ENABLE
@ ADP1050_IIO_FREQ_SYNC_ENABLE
Definition: iio_adp1050.c:176
iio_channel::name
const char * name
Definition: iio_types.h:170
ADP1050_TEMP
@ ADP1050_TEMP
Definition: adp1050.h:523
ADP1050_IIO_OUTA_OUTB_MASK
#define ADP1050_IIO_OUTA_OUTB_MASK
Definition: iio_adp1050.c:54
ADP1050_VOUT_SCALE_MONITOR
#define ADP1050_VOUT_SCALE_MONITOR
Definition: adp1050.h:209
iio_attribute
Structure holding pointers to show and store functions.
Definition: iio_types.h:129
adp1050_iio_desc_init_param::vout_scale_monitor
uint16_t vout_scale_monitor
Definition: iio_adp1050.h:53
ADP1050_IIO_FLOAT_FREQ
#define ADP1050_IIO_FLOAT_FREQ(x)
Definition: iio_adp1050.c:45
adp1050_iio_desc_init_param
Structure holding the ADP1050 IIO initalization parameter.
Definition: iio_adp1050.h:51
ADP1050_IIO_FEEDFORWARD_ENABLE
@ ADP1050_IIO_FEEDFORWARD_ENABLE
Definition: iio_adp1050.c:174
adp1050_vout_value
int adp1050_vout_value(struct adp1050_desc *desc, uint16_t vout_command, uint16_t vout_max)
Set VOUT_COMMAND and VOUT_MAX values.
Definition: adp1050.c:231
ADP1050_STATUS_WORD_TYPE
@ ADP1050_STATUS_WORD_TYPE
Definition: adp1050.h:531
ADP1050_MSB_MASK
#define ADP1050_MSB_MASK
Definition: adp1050.h:49
adp1050_read_status
int adp1050_read_status(struct adp1050_desc *desc, enum adp1050_status_type status, uint16_t *status_val)
Read statuses.
Definition: adp1050.c:145
IIO_CURRENT
@ IIO_CURRENT
Definition: iio_types.h:66
iio_parse_value
int32_t iio_parse_value(char *buf, enum iio_val fmt, int32_t *val, int32_t *val2)
Definition: iio.c:630
adp1050_freq
adp1050_freq
Definition: adp1050.h:416
IIO_VOLTAGE
@ IIO_VOLTAGE
Definition: iio_types.h:65
ADP1050_VOUT_MARGIN_HIGH
#define ADP1050_VOUT_MARGIN_HIGH
Definition: adp1050.h:205
ADP1050_EEPROM_DEFAULT_PASS
#define ADP1050_EEPROM_DEFAULT_PASS
Definition: adp1050.h:137
ADP1050_FEEDFORWARD_CL_ENABLE
#define ADP1050_FEEDFORWARD_CL_ENABLE
Definition: adp1050.h:147
adp1050_desc
Device descriptor for ADP1050.
Definition: adp1050.h:558
adp1050_set_feedforward
int adp1050_set_feedforward(struct adp1050_desc *desc, bool state_on)
Enable or disable voltage input feedforward for edge modulation.
Definition: adp1050.c:712
ADP1050_VIN_SCALE_MONITOR
#define ADP1050_VIN_SCALE_MONITOR
Definition: adp1050.h:265
ADP1050_IIO_MODULATION_AVAIL_SELECT
#define ADP1050_IIO_MODULATION_AVAIL_SELECT(x)
Definition: iio_adp1050.c:49
ADP1050_STATUS_CML_TYPE
@ ADP1050_STATUS_CML_TYPE
Definition: adp1050.h:533
ADP1050_STATUS_VOUT_TYPE
@ ADP1050_STATUS_VOUT_TYPE
Definition: adp1050.h:529
adp1050_unlock_pass
int adp1050_unlock_pass(struct adp1050_desc *desc, uint16_t password, enum adp1050_pass_type pass_type)
Unlock CHIP/EEPROM/TRIM password.
Definition: adp1050.c:935
iio_format_value
int iio_format_value(char *buf, uint32_t len, enum iio_val fmt, int32_t size, int32_t *vals)
Definition: iio.c:686
iio_adp1050.h
Header file for the ADP1050 IIO Driver.
iio_ch_info::address
uint32_t address
Definition: iio_types.h:113
no_os_field_get
uint32_t no_os_field_get(uint32_t mask, uint32_t word)
iio_channel::attributes
struct iio_attribute * attributes
Definition: iio_types.h:186
adp1050_iio_desc_init_param::vin_scale_monitor
uint16_t vin_scale_monitor
Definition: iio_adp1050.h:54
iio_device::num_ch
uint16_t num_ch
Definition: iio_types.h:252
adp1050_iio_init
int adp1050_iio_init(struct adp1050_iio_desc **, struct adp1050_iio_desc_init_param *)
Initializes the ADP1050 IIO descriptor.
Definition: iio_adp1050.c:1203
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
ADP1050_VOUT_CAL_OFFSET
#define ADP1050_VOUT_CAL_OFFSET
Definition: adp1050.h:203
no_os_get_unaligned_le16
uint16_t no_os_get_unaligned_le16(uint8_t *buf)
ADP1050_DISABLE_ALL
@ ADP1050_DISABLE_ALL
Definition: adp1050.h:400
ADP1050_VOUT_COMMAND
#define ADP1050_VOUT_COMMAND
Definition: adp1050.h:201
IIO_TEMP
@ IIO_TEMP
Definition: iio_types.h:69
ADP1050_EEPROM_PASS
@ ADP1050_EEPROM_PASS
Definition: adp1050.h:412
NULL
#define NULL
Definition: wrapper.h:64
ADP1050_FEEDFORWARD_SS_FILTER_GAIN
#define ADP1050_FEEDFORWARD_SS_FILTER_GAIN
Definition: adp1050.h:330
ADP1050_IIO_VOUT_CHAN
@ ADP1050_IIO_VOUT_CHAN
Definition: iio_adp1050.c:190
ADP1050_IIO_MODULATION_AVAIL_SIZE
#define ADP1050_IIO_MODULATION_AVAIL_SIZE
Definition: iio_adp1050.c:47
ADP1050_OUTA_OUTB_MODULATION_SETTINGS
#define ADP1050_OUTA_OUTB_MODULATION_SETTINGS
Definition: adp1050.h:345
ADP1050_IIN_SCALE_MONITOR
#define ADP1050_IIN_SCALE_MONITOR
Definition: adp1050.h:266
init_param
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
iio_device
Structure holding channels and attributes of a device.
Definition: iio_types.h:247
ADP1050_EXP_MASK
#define ADP1050_EXP_MASK
Definition: adp1050.h:83
ADP1050_MARGIN_LOW
#define ADP1050_MARGIN_LOW
Definition: adp1050.h:78
ADP1050_IIO_OUTB_DUTY_CYCLE_REPORTING
#define ADP1050_IIO_OUTB_DUTY_CYCLE_REPORTING
Definition: iio_adp1050.c:53
adp1050_set_open_loop
int adp1050_set_open_loop(struct adp1050_desc *desc, uint8_t rising_edge, uint8_t falling_edge, enum adp1050_channel chan)
Set requested ADP1050 channel in Open Loop operation mode.
Definition: adp1050.c:589
ADP1050_IIO_PULSE_DEFAULT_VAL
#define ADP1050_IIO_PULSE_DEFAULT_VAL
Definition: iio_adp1050.c:58
ADP1050_IIO_OUTA_CHAN
@ ADP1050_IIO_OUTA_CHAN
Definition: iio_adp1050.c:195
adp1050_pwm_modulation
int adp1050_pwm_modulation(struct adp1050_desc *desc, enum adp1050_mod mod, enum adp1050_channel chan, bool sign)
Set PWM modulation for requested channel.
Definition: adp1050.c:416
adp1050_init_param
Initialization parameter for the ADP1050 device.
Definition: adp1050.h:545
ADP1050_PWM_OUTPUT_DISABLE
#define ADP1050_PWM_OUTPUT_DISABLE
Definition: adp1050.h:347
ADP1050_IIO_SR1_SR2_MASK
#define ADP1050_IIO_SR1_SR2_MASK
Definition: iio_adp1050.c:55
ADP1050_FREQ_SYNC_ON
#define ADP1050_FREQ_SYNC_ON
Definition: adp1050.h:128
no_os_util.h
Header file of utility functions.
adp1050_read_value
int adp1050_read_value(struct adp1050_desc *desc, uint16_t *mant, uint8_t *exp, enum adp1050_value_type val_type)
Read VIN/IIN/TEMP/DUTY_CYCLE/FREQ raw value from the ADP1050.
Definition: adp1050.c:206
adp1050_init
int adp1050_init(struct adp1050_desc **desc, struct adp1050_init_param *init_param)
Initialize the ADP1050 device.
Definition: adp1050.c:1079
adp1050_desc::freq
enum adp1050_freq freq
Definition: adp1050.h:565
adp1050_iio_remove
int adp1050_iio_remove(struct adp1050_iio_desc *iio_desc)
Free resources allocated by the init function.
Definition: iio_adp1050.c:1269
ADP1050_IIO_OUTPUT_CHANNEL
#define ADP1050_IIO_OUTPUT_CHANNEL(x)
Definition: iio_adp1050.c:51
adp1050_vout_scale
int adp1050_vout_scale(struct adp1050_desc *desc, int8_t exp, uint16_t mant)
Set ADP1050 VOUT scale, regarding the resistor divider assigned to the VS pins.
Definition: adp1050.c:273
ADP1050_OPEN_LOOP
@ ADP1050_OPEN_LOOP
Definition: adp1050.h:392
ADP1050_OL_OPERATION_SETTINGS
#define ADP1050_OL_OPERATION_SETTINGS
Definition: adp1050.h:364
ADP1050_TRIM_PASS
@ ADP1050_TRIM_PASS
Definition: adp1050.h:413
ADP1050_IIO_VOUT_SCALE_MONITOR_VALUE
@ ADP1050_IIO_VOUT_SCALE_MONITOR_VALUE
Definition: iio_adp1050.c:183
ADP1050_IIO_PULSE_ENABLE
@ ADP1050_IIO_PULSE_ENABLE
Definition: iio_adp1050.c:175
adp1050_iio_enable_type
adp1050_iio_enable_type
Definition: iio_adp1050.c:172
ADP1050_CHIP_PASS
@ ADP1050_CHIP_PASS
Definition: adp1050.h:411
ADP1050_LSB_MASK
#define ADP1050_LSB_MASK
Definition: adp1050.h:48
adp1050_iio_desc_init_param::adp1050_init_param
struct adp1050_init_param * adp1050_init_param
Definition: iio_adp1050.h:52
ADP1050_STATUS_INPUT_TYPE
@ ADP1050_STATUS_INPUT_TYPE
Definition: adp1050.h:530