Go to the documentation of this file.
44 #define LT8722_CRC_POLYNOMIAL 0x07
46 #define LT8722_MAX_REGISTER_SIZE 4
47 #define LT8722_NUM_REGISTERS 8
50 #define LT8722_STATUS_ACQUISITION_COMMAND 0xF0
51 #define LT8722_DATA_WRITE_COMMAND 0xF2
52 #define LT8722_DATA_READ_COMMAND 0xF4
55 #define LT8722_STATUS_ACQUISITION_COMMAND_SIZE 4
56 #define LT8722_DATA_WRITE_COMMAND_SIZE 8
57 #define LT8722_DATA_READ_COMMAND_SIZE 8
60 #define LT8722_ACK_ACKNOWLEDGE 0xA5
61 #define LT8722_ACK_NON_ACKNOWLEDGE 0xC3
62 #define LT8722_ACK_UNSUPPORTED_ADDRESS 0x0F
63 #define LT8722_ACK_STUCK_AT_0 0x00
64 #define LT8722_ACK_STUCK_AT_1 0xFF
67 #define LT8722_SPIS_COMMAND 0x00
68 #define LT8722_SPIS_STATUS 0x01
69 #define LT8722_SPIS_DAC_ILIMN 0x02
70 #define LT8722_SPIS_DAC_ILIMP 0x03
71 #define LT8722_SPIS_DAC 0x04
72 #define LT8722_SPIS_OV_CLAMP 0x05
73 #define LT8722_SPIS_UV_CLAMP 0x06
74 #define LT8722_SPIS_AMUX 0x07
77 #define LT8722_SPIS_COMMAND_SIZE 22
78 #define LT8722_SPIS_STATUS_SIZE 11
79 #define LT8722_SPIS_DAC_ILIMN_SIZE 9
80 #define LT8722_SPIS_DAC_ILIMP_SIZE 9
81 #define LT8722_SPIS_DAC_SIZE 32
82 #define LT8722_SPIS_OV_CLAMP_SIZE 4
83 #define LT8722_SPIS_UV_CLAMP_SIZE 4
84 #define LT8722_SPIS_AMUX_SIZE 7
87 #define LT8722_SPIS_COMMAND_MASK NO_OS_GENMASK(21, 0)
88 #define LT8722_SPIS_STATUS_MASK NO_OS_GENMASK(10, 0)
89 #define LT8722_SPIS_DAC_ILIMN_MASK NO_OS_GENMASK(8, 0)
90 #define LT8722_SPIS_DAC_ILIMP_MASK NO_OS_GENMASK(8, 0)
91 #define LT8722_SPIS_DAC_MASK NO_OS_GENMASK(31, 0)
92 #define LT8722_SPIS_OV_CLAMP_MASK NO_OS_GENMASK(3, 0)
93 #define LT8722_SPIS_UV_CLAMP_MASK NO_OS_GENMASK(3, 0)
94 #define LT8722_SPIS_AMUX_MASK NO_OS_GENMASK(6, 0)
97 #define LT8722_SPIS_COMMAND_DEFAULT_VALUE 0x08A214
98 #define LT8722_SPIS_STATUS_DEFAULT_VALUE 0x0
99 #define LT8722_SPIS_DAC_ILIMN_DEFAULT_VALUE 0x1FF
100 #define LT8722_SPIS_DAC_ILIMP_DEFAULT_VALUE 0x000
101 #define LT8722_SPIS_DAC_DEFAULT_VALUE 0xFF000000
102 #define LT8722_SPIS_OV_CLAMP_DEFAULT_VALUE 0xF
103 #define LT8722_SPIS_UV_CLAMP_DEFAULT_VALUE 0x0
104 #define LT8722_SPIS_AMUX_DEFAULT_VALUE 0x00
107 #define LT8722_ENABLE_REQ_MASK NO_OS_BIT(0)
108 #define LT8722_SWEN_REQ_MASK NO_OS_BIT(1)
109 #define LT8722_SW_FRQ_SET_MASK NO_OS_GENMASK(4, 2)
110 #define LT8722_SW_FRQ_ADJ_MASK NO_OS_GENMASK(6, 5)
111 #define LT8722_SYS_DC_MASK NO_OS_GENMASK(8, 7)
112 #define LT8722_VCC_VREG_MASK NO_OS_BIT(9)
113 #define LT8722_SW_VC_INT_MASK NO_OS_GENMASK(13, 11)
114 #define LT8722_SPI_RST_MASK NO_OS_BIT(14)
115 #define LT8722_PWR_LIM_POS 15
116 #define LT8722_PWR_LIM_MASK NO_OS_GENMASK(18, 15)
119 #define LT8722_SPI_RST_RESET 0b1
122 #define LT8722_SWEN_MASK NO_OS_BIT(0)
123 #define LT8722_SRVO_ILIM_MASK NO_OS_BIT(1)
124 #define LT8722_SRVO_PLIM_MASK NO_OS_BIT(2)
125 #define LT8722_MIN_OT_MASK NO_OS_BIT(3)
126 #define LT8722_POR_OCC_MASK NO_OS_BIT(4)
127 #define LT8722_OVER_CURRENT_MASK NO_OS_BIT(5)
128 #define LT8722_TSD_MASK NO_OS_BIT(6)
129 #define LT8722_VCC_UVLO_MASK NO_OS_BIT(7)
130 #define LT8722_VDDIO_UVLO_MASK NO_OS_BIT(8)
131 #define LT8722_CP_UVLO_MASK NO_OS_BIT(9)
132 #define LT8722_V2P5_UVLO_MASK NO_OS_BIT(10)
135 #define LT8722_FAULTS_MASK NO_OS_GENMASK(10, 5)
138 #define LT8722_SPIS_DAC_ILIMN_MASK NO_OS_GENMASK(8, 0)
141 #define LT8722_SPIS_DAC_ILIMN_MIN 0x030
142 #define LT8722_SPIS_DAC_ILIMN_MAX 0x1FF
145 #define LT8722_SPIS_DAC_ILIMP_MASK NO_OS_GENMASK(8, 0)
148 #define LT8722_SPIS_DAC_ILIMP_MIN 0x000
149 #define LT8722_SPIS_DAC_ILIMP_MAX 0x1CE
152 #define LT8722_SPIS_DAC_MASK NO_OS_GENMASK(31, 0)
155 #define LT8722_SPIS_OV_CLAMP_MASK NO_OS_GENMASK(3, 0)
158 #define LT8722_SPIS_UV_CLAMP_MASK NO_OS_GENMASK(3, 0)
161 #define LT8722_AMUX_MASK NO_OS_GENMASK(3, 0)
162 #define LT8722_AMUX_TEST_MASK NO_OS_GENMASK(5, 4)
163 #define LT8722_AOUT_EN_MASK NO_OS_BIT(6)
165 #define LT8722_DAC_RESOLUTION 25
166 #define LT8722_DAC_OFFSET 1250000000LL // nanovolts
167 #define LT8722_DAC_VREF 2500000000LL // nanovolts
168 #define LT8722_VOLTAGE_SCALE NANO
400 uint32_t mask, uint32_t data);
int lt8722_get_pwr_lim(struct lt8722_dev *dev, enum lt8722_pwr_lim *value)
Get LDR power dissipation limit of LT8722 device.
Definition: lt8722.c:537
Device descriptor for LT8722.
Definition: lt8722.h:373
#define LT8722_ENABLE_REQ_MASK
Definition: lt8722.h:107
#define LT8722_SPIS_UV_CLAMP_MASK
Definition: lt8722.h:158
#define LT8722_SPIS_DAC_SIZE
Definition: lt8722.h:81
int lt8722_set_en_pin(struct lt8722_dev *dev, uint8_t value)
Set EN pin of LT8722 device.
Definition: lt8722.c:998
#define LT8722_SPIS_OV_CLAMP
Definition: lt8722.h:72
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:79
int lt8722_set_sw_frq_adj(struct lt8722_dev *dev, enum lt8722_sw_frq_adj value)
Set switching frequency adjustment of LT8722 device.
Definition: lt8722.c:407
#define LT8722_AMUX_TEST_MASK
Definition: lt8722.h:162
@ LT8722_SWEN_REQ_DISABLED
Definition: lt8722.h:187
int lt8722_get_sw_vc_int(struct lt8722_dev *dev, enum lt8722_sw_vc_int *value)
Get initial peak inductor current of LT8722 device.
Definition: lt8722.c:499
#define LT8722_AOUT_EN_MASK
Definition: lt8722.h:163
uint32_t data
Definition: lt8722.h:352
@ LT8722_ENABLE_REQ_DISABLED
Definition: lt8722.h:176
int lt8722_set_sw_vc_int(struct lt8722_dev *dev, enum lt8722_sw_vc_int value)
Set initial peak inductor current of LT8722 device.
Definition: lt8722.c:483
#define LT8722_SPIS_AMUX_SIZE
Definition: lt8722.h:84
bool start_up_sequence
Definition: lt8722.h:366
int lt8722_set_vcc_vreg(struct lt8722_dev *dev, enum lt8722_vcc_vreg value)
Set internal circuitry voltage source of LT8722 device.
Definition: lt8722.c:445
#define NO_OS_GENMASK(h, l)
Definition: no_os_util.h:82
#define LT8722_SPIS_DAC_ILIMN_MASK
Definition: lt8722.h:138
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
int lt8722_remove(struct lt8722_dev *dev)
Free the resources allocated by the lt8722_init()
Definition: lt8722.c:1148
int lt8722_set_enable_req(struct lt8722_dev *dev, bool value)
Set ENABLE_REQ field in LT8722 device.
Definition: lt8722.c:293
Header file of SPI Interface.
int lt8722_get_spis_dac_ilimp(struct lt8722_dev *dev, uint16_t *value)
Get positive output current limit of LT8722 device.
Definition: lt8722.c:663
#define LT8722_SYS_DC_MASK
Definition: lt8722.h:111
int lt8722_reg_write(struct lt8722_dev *dev, uint8_t address, uint32_t data)
Write data to LT8722 device.
Definition: lt8722.c:191
int lt8722_get_sys_dc(struct lt8722_dev *dev, enum lt8722_sys_dc *value)
Get PWM duty cycle of LT8722 device.
Definition: lt8722.c:575
int lt8722_get_aout_en(struct lt8722_dev *dev, bool *value)
Get analog output buffer status of LT8722 device.
Definition: lt8722.c:815
int lt8722_get_sw_frq_adj(struct lt8722_dev *dev, enum lt8722_sw_frq_adj *value)
Get switching frequency adjustment of LT8722 device.
Definition: lt8722.c:422
int lt8722_reg_read(struct lt8722_dev *dev, uint8_t address, uint32_t *data)
Read data from LT8722 device.
Definition: lt8722.c:160
#define LT8722_SPIS_DAC_ILIMP_DEFAULT_VALUE
Definition: lt8722.h:100
int lt8722_get_spis_ov_clamp(struct lt8722_dev *dev, uint8_t *value)
Get positive output voltage limit of LT8722 device.
Definition: lt8722.c:739
int lt8722_set_spis_dac_ilimn(struct lt8722_dev *dev, uint16_t value)
Set negative output current limit of LT8722 device.
Definition: lt8722.c:598
#define LT8722_DATA_READ_COMMAND_SIZE
Definition: lt8722.h:57
int32_t no_os_gpio_get_value(struct no_os_gpio_desc *desc, uint8_t *value)
Get the value of the specified GPIO.
Definition: no_os_gpio.c:221
struct lt8722_reg reg
Definition: lt8722.h:351
#define pr_err(fmt, args...)
Definition: no_os_print_log.h:88
int lt8722_reg_write_mask(struct lt8722_dev *dev, uint8_t address, uint32_t mask, uint32_t data)
Write to LT8722 device register with mask.
Definition: lt8722.c:217
Header file of Delay functions.
#define LT8722_STATUS_ACQUISITION_COMMAND_SIZE
Definition: lt8722.h:55
struct no_os_spi_init_param * spi
Definition: lt8722.h:363
#define LT8722_DATA_READ_COMMAND
Definition: lt8722.h:52
uint16_t status
Definition: lt8722.h:355
int lt8722_get_spis_dac_ilimn(struct lt8722_dev *dev, uint16_t *value)
Get negative output current limit of LT8722 device.
Definition: lt8722.c:619
struct lt8722_reg lt8722_regs[LT8722_NUM_REGISTERS]
Definition: lt8722.c:45
int lt8722_set_pwr_lim(struct lt8722_dev *dev, enum lt8722_pwr_lim value)
Set LDR power dissipation limit of LT8722 device.
Definition: lt8722.c:522
int lt8722_init(struct lt8722_dev **device, struct lt8722_init_param *init_param)
Initialize the LT8722 device.
Definition: lt8722.c:1027
@ LT8722_SW_FRQ_SET_3MHZ
Definition: lt8722.h:208
#define LT8722_SPIS_DAC_ILIMN_SIZE
Definition: lt8722.h:79
Definition: ad9361_util.h:69
@ NO_OS_GPIO_HIGH
Definition: no_os_gpio.h:117
int32_t lt8722_voltage_to_dac(int64_t voltage)
Convert voltage to DAC code.
Definition: lt8722.c:85
#define LT8722_SPIS_DAC_ILIMN
Definition: lt8722.h:69
lt8722_sw_vc_int
Typical peak inductor current after BST-SW refresh period control bits.
Definition: lt8722.h:245
#define LT8722_SPIS_OV_CLAMP_MASK
Definition: lt8722.h:155
#define LT8722_SPI_RST_RESET
Definition: lt8722.h:119
@ LT8722_SW_VC_INT_1_278A
Definition: lt8722.h:253
@ LT8722_AOUT_EN_ENABLED
Definition: lt8722.h:323
@ LT8722_AOUT_EN_DISABLED
Definition: lt8722.h:321
int lt8722_clear_faults(struct lt8722_dev *dev)
Clear LT8722 device faults.
Definition: lt8722.c:271
int lt8722_get_status(struct lt8722_dev *dev, uint16_t *status)
Get LT8722 device status.
Definition: lt8722.c:242
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
#define LT8722_SPIS_STATUS_SIZE
Definition: lt8722.h:78
@ LT8722_SW_FRQ_ADJ_0_PERCENT
Definition: lt8722.h:221
int lt8722_set_sw_vc_int(struct lt8722_dev *dev, enum lt8722_sw_vc_int value)
Set initial peak inductor current of LT8722 device.
Definition: lt8722.c:483
struct no_os_gpio_init_param * gpio_en
Definition: lt8722.h:365
@ LT8722_SW_FRQ_SET_2MHZ
Definition: lt8722.h:204
int lt8722_set_spis_ov_clamp(struct lt8722_dev *dev, uint8_t value)
Set positive output voltage limit of LT8722 device.
Definition: lt8722.c:724
@ LT8722_AMUX_IOUT
Definition: lt8722.h:301
uint8_t size
Definition: lt8722.h:333
int lt8722_get_en_pin(struct lt8722_dev *dev, uint8_t *value)
Get EN pin of LT8722 device.
Definition: lt8722.c:1012
lt8722_sw_frq_adj
PWM switch frequency adjustment bits.
Definition: lt8722.h:219
int lt8722_transaction(struct lt8722_dev *dev, struct lt8722_packet *packet)
LT8722 device SPI transaction.
Definition: lt8722.c:108
@ LT8722_PWR_LIM_3_5W
Definition: lt8722.h:276
@ LT8722_AMUX_VDDIO
Definition: lt8722.h:308
int lt8722_set_dac(struct lt8722_dev *dev, uint32_t value)
Set DAC code of LT8722 device.
Definition: lt8722.c:686
@ NO_OS_GPIO_LOW
Definition: no_os_gpio.h:115
#define LT8722_SPIS_DAC_ILIMP_SIZE
Definition: lt8722.h:80
@ LT8722_AMUX_VCC
Definition: lt8722.h:307
int lt8722_get_sw_frq_set(struct lt8722_dev *dev, enum lt8722_sw_frq_set *value)
Get switching frequency of LT8722 device.
Definition: lt8722.c:384
@ LT8722_SW_FRQ_SET_1_5MHZ
Definition: lt8722.h:202
int lt8722_set_enable_req(struct lt8722_dev *dev, bool value)
Set ENABLE_REQ field in LT8722 device.
Definition: lt8722.c:293
@ LT8722_ENABLE_REQ_ENABLED
Definition: lt8722.h:178
int lt8722_shutdown(struct lt8722_dev *dev)
Reset the LT8722 device.
Definition: lt8722.c:936
Initialization parameter for the LT8722 device.
Definition: lt8722.h:362
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)
@ LT8722_SYS_DC_20_80_DUTY_CYCLE
Definition: lt8722.h:285
#define LT8722_SPIS_DAC_ILIMP
Definition: lt8722.h:70
#define LT8722_SPIS_DAC_ILIMP_MASK
Definition: lt8722.h:145
int lt8722_get_spis_uv_clamp(struct lt8722_dev *dev, uint8_t *value)
Get negative output voltage limit of LT8722 device.
Definition: lt8722.c:777
int lt8722_get_sys_dc(struct lt8722_dev *dev, enum lt8722_sys_dc *value)
Get PWM duty cycle of LT8722 device.
Definition: lt8722.c:575
int lt8722_get_aout_en(struct lt8722_dev *dev, bool *value)
Get analog output buffer status of LT8722 device.
Definition: lt8722.c:815
int lt8722_get_sw_frq_adj(struct lt8722_dev *dev, enum lt8722_sw_frq_adj *value)
Get switching frequency adjustment of LT8722 device.
Definition: lt8722.c:422
uint8_t size
Definition: lt8722.h:342
int64_t lt8722_dac_to_voltage(int32_t dac)
Convert DAC code to nanovolts.
Definition: lt8722.c:96
lt8722_swen_req
PWM switch enable request bit.
Definition: lt8722.h:185
int lt8722_set_spis_dac_ilimn(struct lt8722_dev *dev, uint16_t value)
Set negative output current limit of LT8722 device.
Definition: lt8722.c:598
lt8722_aout_en
Analog output buffer enable control bits.
Definition: lt8722.h:319
uint16_t status
Definition: lt8722.h:378
@ LT8722_SW_VC_INT_2_646A
Definition: lt8722.h:261
#define LT8722_SPIS_UV_CLAMP
Definition: lt8722.h:73
#define LT8722_VCC_VREG_MASK
Definition: lt8722.h:112
@ LT8722_AMUX_VSFB
Definition: lt8722.h:309
int lt8722_set_sys_dc(struct lt8722_dev *dev, enum lt8722_sys_dc value)
Set PWM duty cycle of LT8722 device.
Definition: lt8722.c:560
@ LT8722_PWR_LIM_2W
Definition: lt8722.h:270
#define LT8722_SPIS_UV_CLAMP_SIZE
Definition: lt8722.h:83
#define LT8722_DAC_RESOLUTION
Definition: lt8722.h:165
int lt8722_get_swen_req(struct lt8722_dev *dev, bool *value)
Get switching enable of LT8722 device.
Definition: lt8722.c:346
void no_os_crc8_populate_msb(uint8_t *table, const uint8_t polynomial)
int lt8722_reset(struct lt8722_dev *dev)
Shutdown the LT8722 device.
Definition: lt8722.c:955
int lt8722_get_spis_dac_ilimn(struct lt8722_dev *dev, uint16_t *value)
Get negative output current limit of LT8722 device.
Definition: lt8722.c:619
#define LT8722_SPIS_DAC_ILIMN_MIN
Definition: lt8722.h:141
@ LT8722_SWEN_REQ_ENABLED
Definition: lt8722.h:189
int lt8722_set_sw_frq_adj(struct lt8722_dev *dev, enum lt8722_sw_frq_adj value)
Set switching frequency adjustment of LT8722 device.
Definition: lt8722.c:407
Header file for the LT8722 Driver.
int lt8722_set_spis_dac_ilimp(struct lt8722_dev *dev, uint16_t value)
Set positive output current limit of LT8722 device.
Definition: lt8722.c:642
void no_os_put_unaligned_be32(uint32_t val, uint8_t *buf)
@ LT8722_SW_VC_INT_0_936A
Definition: lt8722.h:251
int lt8722_get_sw_vc_int(struct lt8722_dev *dev, enum lt8722_sw_vc_int *value)
Get initial peak inductor current of LT8722 device.
Definition: lt8722.c:499
int lt8722_get_swen_pin(struct lt8722_dev *dev, uint8_t *value)
Get SWEN pin of LT8722 device.
Definition: lt8722.c:984
@ LT8722_SW_FRQ_SET_2_5MHZ
Definition: lt8722.h:206
@ LT8722_AMUX_VDAC
Definition: lt8722.h:299
int lt8722_get_dac(struct lt8722_dev *dev, uint32_t *value)
Get DAC code of LT8722 device.
Definition: lt8722.c:701
@ LT8722_PWR_LIM_NO_LIMIT
Definition: lt8722.h:272
#define LT8722_SPIS_STATUS
Definition: lt8722.h:68
@ LT8722_SW_FRQ_ADJ_0_PERCENT_2
Definition: lt8722.h:227
int lt8722_set_swen_pin(struct lt8722_dev *dev, uint8_t value)
Set SWEN pin of LT8722 device.
Definition: lt8722.c:970
@ LT8722_AMUX_V1P65
Definition: lt8722.h:304
int lt8722_set_sw_frq_set(struct lt8722_dev *dev, enum lt8722_sw_frq_set value)
Set switching frequency of LT8722 device.
Definition: lt8722.c:369
#define LT8722_PWR_LIM_MASK
Definition: lt8722.h:116
int lt8722_set_amux(struct lt8722_dev *dev, enum lt8722_amux value, uint8_t test)
Set analot output signal source of LT8722 device.
Definition: lt8722.c:839
@ LT8722_VCC_VREG_3_4V
Definition: lt8722.h:238
int lt8722_get_status(struct lt8722_dev *dev, uint16_t *status)
Get LT8722 device status.
Definition: lt8722.c:242
uint8_t ack
Definition: lt8722.h:354
lt8722_sys_dc
PWM duty cycle control bits.
Definition: lt8722.h:283
int lt8722_remove(struct lt8722_dev *dev)
Free the resources allocated by the lt8722_init()
Definition: lt8722.c:1148
@ LT8722_AMUX_VIN
Definition: lt8722.h:306
int lt8722_get_vcc_vreg(struct lt8722_dev *dev, enum lt8722_vcc_vreg *value)
Get internal circuitry voltage source of LT8722 device.
Definition: lt8722.c:460
#define LT8722_SW_VC_INT_MASK
Definition: lt8722.h:113
@ LT8722_SYS_DC_10_90_DUTY_CYCLE
Definition: lt8722.h:289
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
int lt8722_set_swen_req(struct lt8722_dev *dev, bool value)
Set switching enable of LT8722 device.
Definition: lt8722.c:331
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
int lt8722_get_sw_frq_set(struct lt8722_dev *dev, enum lt8722_sw_frq_set *value)
Get switching frequency of LT8722 device.
Definition: lt8722.c:384
int lt8722_get_enable_req(struct lt8722_dev *dev, bool *value)
Get ENABLE_REQ field in LT8722 device.
Definition: lt8722.c:308
int lt8722_get_amux(struct lt8722_dev *dev, enum lt8722_amux *value, uint8_t *test)
Get analot output signal source of LT8722 device.
Definition: lt8722.c:867
#define LT8722_DATA_WRITE_COMMAND_SIZE
Definition: lt8722.h:56
#define LT8722_SPIS_DAC_ILIMP_MIN
Definition: lt8722.h:148
lt8722_sw_frq_set
PWM switch frequency control bits.
Definition: lt8722.h:196
#define LT8722_SPIS_OV_CLAMP_DEFAULT_VALUE
Definition: lt8722.h:102
NO_OS_DECLARE_CRC8_TABLE(lt8722_crc8)
#define LT8722_SPIS_COMMAND
Definition: lt8722.h:67
struct no_os_spi_desc * spi
Definition: lt8722.h:374
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:96
uint8_t byte
Definition: lt8722.h:341
int lt8722_set_spis_uv_clamp(struct lt8722_dev *dev, uint8_t value)
Set negative output voltage limit of LT8722 device.
Definition: lt8722.c:762
int lt8722_get_spis_uv_clamp(struct lt8722_dev *dev, uint8_t *value)
Get negative output voltage limit of LT8722 device.
Definition: lt8722.c:777
int lt8722_get_output_voltage(struct lt8722_dev *dev, int64_t *value)
Get output volatge of LT8722 device.
Definition: lt8722.c:912
int64_t lt8722_dac_to_voltage(int32_t dac)
Convert DAC code to nanovolts.
Definition: lt8722.c:96
@ LT8722_AMUX_VTEMP
Definition: lt8722.h:305
int lt8722_set_en_pin(struct lt8722_dev *dev, uint8_t value)
Set EN pin of LT8722 device.
Definition: lt8722.c:998
#define LT8722_SPIS_COMMAND_SIZE
Definition: lt8722.h:77
#define LT8722_STATUS_ACQUISITION_COMMAND
Definition: lt8722.h:50
@ LT8722_AMUX_VILIMP
Definition: lt8722.h:297
bool start_up_sequence
Definition: lt8722.h:377
#define LT8722_SPIS_DAC_ILIMN_DEFAULT_VALUE
Definition: lt8722.h:99
#define LT8722_SPIS_AMUX_DEFAULT_VALUE
Definition: lt8722.h:104
@ LT8722_SW_FRQ_SET_3MHZ_2
Definition: lt8722.h:210
int lt8722_set_output_voltage(struct lt8722_dev *dev, int64_t value)
Set output volatge of LT8722 device.
Definition: lt8722.c:892
LT8722 register structure.
Definition: lt8722.h:330
#define LT8722_FAULTS_MASK
Definition: lt8722.h:135
int lt8722_get_swen_req(struct lt8722_dev *dev, bool *value)
Get switching enable of LT8722 device.
Definition: lt8722.c:346
#define LT8722_SPI_RST_MASK
Definition: lt8722.h:114
int32_t lt8722_voltage_to_dac(int64_t voltage)
Convert voltage to DAC code.
Definition: lt8722.c:85
struct no_os_gpio_init_param * gpio_swen
Definition: lt8722.h:364
int lt8722_reset(struct lt8722_dev *dev)
Shutdown the LT8722 device.
Definition: lt8722.c:955
@ LT8722_SW_VC_INT_1_962A
Definition: lt8722.h:257
uint8_t address
Definition: lt8722.h:331
int lt8722_set_spis_dac_ilimp(struct lt8722_dev *dev, uint16_t value)
Set positive output current limit of LT8722 device.
Definition: lt8722.c:642
uint32_t no_os_field_get(uint32_t mask, uint32_t word)
#define LT8722_SPIS_DAC_ILIMN_MAX
Definition: lt8722.h:142
int lt8722_clear_faults(struct lt8722_dev *dev)
Clear LT8722 device faults.
Definition: lt8722.c:271
@ LT8722_SW_VC_INT_0_594A
Definition: lt8722.h:249
#define LT8722_SPIS_STATUS_DEFAULT_VALUE
Definition: lt8722.h:98
#define LT8722_SPIS_UV_CLAMP_DEFAULT_VALUE
Definition: lt8722.h:103
int lt8722_get_dac(struct lt8722_dev *dev, uint32_t *value)
Get DAC code of LT8722 device.
Definition: lt8722.c:701
@ LT8722_AMUX_VSFB_2
Definition: lt8722.h:310
lt8722_pwr_lim
Linear power stage MOSFET power limit control bits.
Definition: lt8722.h:268
uint8_t no_os_crc8(const uint8_t *table, const uint8_t *pdata, size_t nbytes, uint8_t crc)
@ LT8722_AMUX_VSFB_3
Definition: lt8722.h:311
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
#define LT8722_SPIS_DAC_DEFAULT_VALUE
Definition: lt8722.h:101
int lt8722_set_swen_pin(struct lt8722_dev *dev, uint8_t value)
Set SWEN pin of LT8722 device.
Definition: lt8722.c:970
int lt8722_set_aout_en(struct lt8722_dev *dev, bool value)
Set analog output buffer status of LT8722 device.
Definition: lt8722.c:800
@ LT8722_AMUX_VILIMN
Definition: lt8722.h:298
int lt8722_set_sw_frq_set(struct lt8722_dev *dev, enum lt8722_sw_frq_set value)
Set switching frequency of LT8722 device.
Definition: lt8722.c:369
int lt8722_get_spis_dac_ilimp(struct lt8722_dev *dev, uint16_t *value)
Get positive output current limit of LT8722 device.
Definition: lt8722.c:663
#define LT8722_NUM_REGISTERS
Definition: lt8722.h:47
int lt8722_reg_write(struct lt8722_dev *dev, uint8_t address, uint32_t data)
Write data to LT8722 device.
Definition: lt8722.c:191
@ LT8722_SW_VC_INT_2_304A
Definition: lt8722.h:259
lt8722_amux
Analog multiplexer control bits.
Definition: lt8722.h:296
@ LT8722_SW_FRQ_SET_0_5MHZ
Definition: lt8722.h:198
#define LT8722_SPIS_DAC
Definition: lt8722.h:71
void no_os_udelay(uint32_t usecs)
Wait until usecs microseconds passed.
Definition: aducm3029_delay.c:114
int lt8722_reg_read(struct lt8722_dev *dev, uint8_t address, uint32_t *data)
Read data from LT8722 device.
Definition: lt8722.c:160
int lt8722_get_spis_ov_clamp(struct lt8722_dev *dev, uint8_t *value)
Get positive output voltage limit of LT8722 device.
Definition: lt8722.c:739
#define LT8722_DAC_VREF
Definition: lt8722.h:167
#define LT8722_SPIS_DAC_ILIMP_MAX
Definition: lt8722.h:149
#define LT8722_CRC_POLYNOMIAL
Definition: lt8722.h:44
uint32_t default_val
Definition: lt8722.h:332
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
uint32_t no_os_get_unaligned_be32(uint8_t *buf)
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
int lt8722_get_pwr_lim(struct lt8722_dev *dev, enum lt8722_pwr_lim *value)
Get LDR power dissipation limit of LT8722 device.
Definition: lt8722.c:537
int lt8722_reg_write_mask(struct lt8722_dev *dev, uint8_t address, uint32_t mask, uint32_t data)
Write to LT8722 device register with mask.
Definition: lt8722.c:217
int lt8722_set_swen_req(struct lt8722_dev *dev, bool value)
Set switching enable of LT8722 device.
Definition: lt8722.c:331
LT8722 packet structure.
Definition: lt8722.h:349
#define LT8722_AMUX_MASK
Definition: lt8722.h:161
int lt8722_set_pwr_lim(struct lt8722_dev *dev, enum lt8722_pwr_lim value)
Set LDR power dissipation limit of LT8722 device.
Definition: lt8722.c:522
int lt8722_set_sys_dc(struct lt8722_dev *dev, enum lt8722_sys_dc value)
Set PWM duty cycle of LT8722 device.
Definition: lt8722.c:560
LT8722 command structure.
Definition: lt8722.h:340
@ LT8722_PWR_LIM_3W
Definition: lt8722.h:274
int lt8722_set_spis_uv_clamp(struct lt8722_dev *dev, uint8_t value)
Set negative output voltage limit of LT8722 device.
Definition: lt8722.c:762
@ LT8722_SYS_DC_15_85_DUTY_CYCLE
Definition: lt8722.h:287
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
int lt8722_get_output_voltage(struct lt8722_dev *dev, int64_t *value)
Get output volatge of LT8722 device.
Definition: lt8722.c:912
Header file of GPIO Interface.
#define LT8722_SPIS_OV_CLAMP_SIZE
Definition: lt8722.h:82
#define LT8722_ACK_ACKNOWLEDGE
Definition: lt8722.h:60
@ LT8722_SW_FRQ_ADJ_NEGATIVE_15_PERCENT
Definition: lt8722.h:225
#define LT8722_SPIS_DAC_MASK
Definition: lt8722.h:152
int lt8722_set_vcc_vreg(struct lt8722_dev *dev, enum lt8722_vcc_vreg value)
Set internal circuitry voltage source of LT8722 device.
Definition: lt8722.c:445
@ LT8722_AMUX_V1P25
Definition: lt8722.h:303
#define LT8722_SWEN_REQ_MASK
Definition: lt8722.h:108
struct no_os_gpio_desc * gpio_en
Definition: lt8722.h:376
int lt8722_set_output_voltage(struct lt8722_dev *dev, int64_t value)
Set output volatge of LT8722 device.
Definition: lt8722.c:892
int lt8722_get_swen_pin(struct lt8722_dev *dev, uint8_t *value)
Get SWEN pin of LT8722 device.
Definition: lt8722.c:984
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)
@ LT8722_VCC_VREG_3_1V
Definition: lt8722.h:236
@ LT8722_SW_FRQ_SET_1MHZ
Definition: lt8722.h:200
#define LT8722_SW_FRQ_SET_MASK
Definition: lt8722.h:109
@ LT8722_AMUX_VOUT
Definition: lt8722.h:300
Header file of utility functions.
struct no_os_gpio_desc * gpio_swen
Definition: lt8722.h:375
int lt8722_set_amux(struct lt8722_dev *dev, enum lt8722_amux value, uint8_t test)
Set analot output signal source of LT8722 device.
Definition: lt8722.c:839
int lt8722_set_spis_ov_clamp(struct lt8722_dev *dev, uint8_t value)
Set positive output voltage limit of LT8722 device.
Definition: lt8722.c:724
int lt8722_get_en_pin(struct lt8722_dev *dev, uint8_t *value)
Get EN pin of LT8722 device.
Definition: lt8722.c:1012
int lt8722_transaction(struct lt8722_dev *dev, struct lt8722_packet *packet)
LT8722 device SPI transaction.
Definition: lt8722.c:108
int lt8722_set_dac(struct lt8722_dev *dev, uint32_t value)
Set DAC code of LT8722 device.
Definition: lt8722.c:686
#define LT8722_SW_FRQ_ADJ_MASK
Definition: lt8722.h:110
@ LT8722_SW_FRQ_SET_3MHZ_3
Definition: lt8722.h:212
#define LT8722_SPIS_COMMAND_DEFAULT_VALUE
Definition: lt8722.h:97
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
lt8722_vcc_vreg
VCC LDO regulation control bits.
Definition: lt8722.h:234
int lt8722_get_vcc_vreg(struct lt8722_dev *dev, enum lt8722_vcc_vreg *value)
Get internal circuitry voltage source of LT8722 device.
Definition: lt8722.c:460
int lt8722_set_aout_en(struct lt8722_dev *dev, bool value)
Set analog output buffer status of LT8722 device.
Definition: lt8722.c:800
@ LT8722_SW_FRQ_ADJ_POSITIVE_15_PERCENT
Definition: lt8722.h:223
int lt8722_shutdown(struct lt8722_dev *dev)
Reset the LT8722 device.
Definition: lt8722.c:936
lt8722_enable_req
VCC LDO enable bit and linear power stage enable request bit.
Definition: lt8722.h:174
#define LT8722_SPIS_AMUX
Definition: lt8722.h:74
@ LT8722_AMUX_V2P5
Definition: lt8722.h:302
Header file of CRC-8 computation.
struct lt8722_command command
Definition: lt8722.h:350
Error macro definition for ARM Compiler.
#define LT8722_DAC_OFFSET
Definition: lt8722.h:166
@ LT8722_SW_VC_INT_1_620A
Definition: lt8722.h:255
int lt8722_get_enable_req(struct lt8722_dev *dev, bool *value)
Get ENABLE_REQ field in LT8722 device.
Definition: lt8722.c:308
int lt8722_get_amux(struct lt8722_dev *dev, enum lt8722_amux *value, uint8_t *test)
Get analot output signal source of LT8722 device.
Definition: lt8722.c:867
struct lt8722_reg lt8722_regs[LT8722_NUM_REGISTERS]
Definition: lt8722.c:45
int lt8722_init(struct lt8722_dev **device, struct lt8722_init_param *init_param)
Initialize the LT8722 device.
Definition: lt8722.c:1027
uint8_t crc
Definition: lt8722.h:353
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140
@ LT8722_AMUX_VSFB_4
Definition: lt8722.h:312
@ LT8722_SW_VC_INT_0_252A
Definition: lt8722.h:247
#define LT8722_DATA_WRITE_COMMAND
Definition: lt8722.h:51
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