efuse2
2.0.0.0
|
API for configuring and manipulating eFuse 2 Click driver. More...
Modules | |
eFuse 2 Registers Settings | |
Settings for registers of eFuse 2 Click driver. | |
eFuse 2 MikroBUS Map | |
MikroBUS pin mapping of eFuse 2 Click driver. | |
Functions | |
void | efuse2_cfg_setup (efuse2_cfg_t *cfg) |
eFuse 2 configuration object setup function. More... | |
err_t | efuse2_init (efuse2_t *ctx, efuse2_cfg_t *cfg) |
eFuse 2 initialization function. More... | |
err_t | efuse2_default_cfg (efuse2_t *ctx) |
eFuse 2 default configuration function. More... | |
err_t | efuse2_generic_write (efuse2_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len) |
eFuse 2 I2C writing function. More... | |
err_t | efuse2_generic_read (efuse2_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len) |
eFuse 2 I2C reading function. More... | |
void | efuse2_write_ad5241 (efuse2_t *ctx, ad5241_instru_t cmd, uint8_t data_byte) |
Generic write data to the AD5241 function. More... | |
uint8_t | efuse2_read_ad5241 (efuse2_t *ctx) |
Generic read data from the AD5241 function. More... | |
void | efuse2_hw_reset (efuse2_t *ctx) |
Hardware reset function. More... | |
void | efuse2_set_operating_voltage (efuse2_t *ctx, float voltage, float *min_voltage, float *max_voltage) |
Set operating voltage function. More... | |
void | efuse2_write_ad5175 (efuse2_t *ctx, uint8_t cmd, uint16_t data_byte) |
Generic write data to the AD5175 function. More... | |
uint16_t | efuse2_read_ad5175 (efuse2_t *ctx, uint8_t cmd, uint8_t wiper_location) |
Generic read data from the AD5175 function. More... | |
uint16_t | efuse2_read_rdac (efuse2_t *ctx) |
Read RDAC function. More... | |
void | efuse2_enable_write (efuse2_t *ctx) |
Enable write function. More... | |
void | efuse2_write_rdac (efuse2_t *ctx, uint16_t data_byte) |
Write RDAC function. More... | |
void | efuse2_set_current_limit (efuse2_t *ctx, float current) |
Set operating current function. More... | |
void | efuse2_sw_reset (efuse2_t *ctx) |
Software reset function. More... | |
void | efuse2_store_wiper (efuse2_t *ctx) |
Store wiper setting function. More... | |
void | efuse2_operating_mode (efuse2_t *ctx, uint8_t mode) |
Set operating mode function. More... | |
uint16_t | efuse2_next_frame_read (efuse2_t *ctx, uint8_t wiper_location) |
Next frame read function. More... | |
uint16_t | efuse2_read_memory (efuse2_t *ctx) |
Read memory function. More... | |
uint8_t | efuse2_read_control (efuse2_t *ctx) |
Read control register function. More... | |
uint8_t | efuse2_get_fault (efuse2_t *ctx) |
Get fault function. More... | |
API for configuring and manipulating eFuse 2 Click driver.
void efuse2_cfg_setup | ( | efuse2_cfg_t * | cfg | ) |
eFuse 2 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See efuse2_cfg_t object definition for detailed explanation. |
err_t efuse2_default_cfg | ( | efuse2_t * | ctx | ) |
eFuse 2 default configuration function.
This function executes a default configuration of eFuse 2 click board.
[in] | ctx | : Click context object. See efuse2_t object definition for detailed explanation. |
0
- Success, -1
- Error.void efuse2_enable_write | ( | efuse2_t * | ctx | ) |
Enable write function.
The function enable write of the AD5175 Single-Channel, 1024-Position, Digital Rheostat with I2C Interface and 50-TP Memory on the eFuse 2 click board.
[in] | ctx | : Click context object. See efuse2_t object definition for detailed explanation. |
err_t efuse2_generic_read | ( | efuse2_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | rx_buf, | ||
uint8_t | rx_len | ||
) |
eFuse 2 I2C reading function.
This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See efuse2_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | rx_buf | : Output read data. |
[in] | rx_len | : Number of bytes to be read. |
0
- Success, -1
- Error.err_t efuse2_generic_write | ( | efuse2_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | tx_buf, | ||
uint8_t | tx_len | ||
) |
eFuse 2 I2C writing function.
This function writes a desired number of data bytes starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See efuse2_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | tx_buf | : Data to be written. |
[in] | tx_len | : Number of bytes to be written. |
0
- Success, -1
- Error.uint8_t efuse2_get_fault | ( | efuse2_t * | ctx | ) |
Get fault function.
The function get state of the FLT ( INT ) pin, active low indicator which will be pulled low when a fault is detected. It is an open-drain output that requires an external pull-up resistance of the TPS2596 2.7 to 19 V, 0.125 to 2-A, 89-mO eFuse With Accurate Current Monitor and Fast Overvoltage Protection on the eFuse 2 click board.
[in] | ctx | : Click context object. See efuse2_t object definition for detailed explanation. |
void efuse2_hw_reset | ( | efuse2_t * | ctx | ) |
Hardware reset function.
The function reset the AD5241 I2C Compatible, 256-Position Digital Potentiometers on the eFuse 2 click board.
[out] | ctx | : Click context object. See efuse2_t object definition for detailed explanation. |
err_t efuse2_init | ( | efuse2_t * | ctx, |
efuse2_cfg_t * | cfg | ||
) |
eFuse 2 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See efuse2_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See efuse2_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.uint16_t efuse2_next_frame_read | ( | efuse2_t * | ctx, |
uint8_t | wiper_location | ||
) |
Next frame read function.
The function next frame read of the AD5241 I2C Compatible, 256-Position Digital Potentiometers on the eFuse 2 click board.
[in] | ctx | : Click context object. See efuse2_t object definition for detailed explanation. |
[in] | wiper_location | : Wiper location ( from 0x00 to the 0x38 ). |
void efuse2_operating_mode | ( | efuse2_t * | ctx, |
uint8_t | mode | ||
) |
Set operating mode function.
The function set operating mode of the AD5241 I2C Compatible, 256-Position Digital Potentiometers on the eFuse 2 click board.
[in] | ctx | : Click context object. See efuse2_t object definition for detailed explanation. |
[in] | mode | : Operation mode options |
uint16_t efuse2_read_ad5175 | ( | efuse2_t * | ctx, |
uint8_t | cmd, | ||
uint8_t | wiper_location | ||
) |
Generic read data from the AD5175 function.
The function read a 10-bit data of the AD5175 Single-Channel, 1024-Position, Digital Rheostat with I2C Interface and 50-TP Memory on the eFuse 2 click board.
[in] | ctx | : Click context object. See efuse2_t object definition for detailed explanation. |
[in] | cmd | : Command Operation:
|
[in] | data_byte | : 10-bit data to be written. |
uint8_t efuse2_read_ad5241 | ( | efuse2_t * | ctx | ) |
Generic read data from the AD5241 function.
The function read a the byte of data from the AD5241 I2C Compatible, 256-Position Digital Potentiometers on the eFuse 2 click board.
[in] | ctx | : Click context object. See efuse2_t object definition for detailed explanation. |
uint8_t efuse2_read_control | ( | efuse2_t * | ctx | ) |
Read control register function.
The function read contents of the control register of the AD5241 I2C Compatible, 256-Position Digital Potentiometers on the eFuse 2 click board.
[in] | ctx | : Click context object. See efuse2_t object definition for detailed explanation. |
0x01
( EFUSE2_AD5175_50T_PROGRAM_ENABLE ) : Enable device for 50-TP program. 0x02
( EFUSE2_AD5175_UPDATE_WIPER_POS ) : RDAC register write protect. 0x08
( EFUSE2_AD5175_FUSE_PROGRAM_UNSUCCESSFUL ) : Fuse program command successful. uint16_t efuse2_read_memory | ( | efuse2_t * | ctx | ) |
Read memory function.
The function read address of the last 50-TP programmed memory location of the AD5241 I2C Compatible, 256-Position Digital Potentiometers on the eFuse 2 click board.
[in] | ctx | : Click context object. See efuse2_t object definition for detailed explanation. |
uint16_t efuse2_read_rdac | ( | efuse2_t * | ctx | ) |
Read RDAC function.
The function read a 10-bit RDAC data of the AD5175 Single-Channel, 1024-Position, Digital Rheostat with I2C Interface and 50-TP Memory on the eFuse 2 click board.
[in] | ctx | : Click context object. See efuse2_t object definition for detailed explanation. |
void efuse2_set_current_limit | ( | efuse2_t * | ctx, |
float | current | ||
) |
Set operating current function.
The function set operating current of the AD5241 I2C Compatible, 256-Position Digital Potentiometers on the eFuse 2 click board.
[in] | ctx | : Click context object. See efuse2_t object definition for detailed explanation. |
[in] | current | : Operating current ( from 0.125 A to the 2.0 A ). |
void efuse2_set_operating_voltage | ( | efuse2_t * | ctx, |
float | voltage, | ||
float * | min_voltage, | ||
float * | max_voltage | ||
) |
Set operating voltage function.
The function set operating voltage, OVLO and UVLO of the AD5241 I2C Compatible, 256-Position Digital Potentiometers on the eFuse 2 click board.
[in] | ctx | : Click context object. See efuse2_t object definition for detailed explanation. |
[in] | voltage | : Operating voltage ( from 3.65 V to the 15.0 V ). |
[in] | min_voltage | : Pointer to the memory location where UVLO data is stored. |
[in] | max_voltage | : Pointer to the memory location where OVLO data is stored. |
void efuse2_store_wiper | ( | efuse2_t * | ctx | ) |
Store wiper setting function.
The function store wiper setting, store RDAC setting to 50-TP of the AD5241 I2C Compatible, 256-Position Digital Potentiometers on the eFuse 2 click board.
[in] | ctx | : Click context object. See efuse2_t object definition for detailed explanation. |
void efuse2_sw_reset | ( | efuse2_t * | ctx | ) |
Software reset function.
The function software reset the AD5241 I2C Compatible, 256-Position Digital Potentiometers on the eFuse 2 click board.
[in] | ctx | : Click context object. See efuse2_t object definition for detailed explanation. |
void efuse2_write_ad5175 | ( | efuse2_t * | ctx, |
uint8_t | cmd, | ||
uint16_t | data_byte | ||
) |
Generic write data to the AD5175 function.
The function writes a 10-bit data to the AD5175 Single-Channel, 1024-Position, Digital Rheostat with I2C Interface and 50-TP Memory on the eFuse 2 click board.
[in] | ctx | : Click context object. See efuse2_t object definition for detailed explanation. |
[in] | cmd | : Pointer to the memory location where data is stored. |
[in] | data_byte | : 10-bit data to be written. |
void efuse2_write_ad5241 | ( | efuse2_t * | ctx, |
ad5241_instru_t | cmd, | ||
uint8_t | data_byte | ||
) |
Generic write data to the AD5241 function.
The function writes a the byte of data and instruction of the AD5241 I2C Compatible, 256-Position Digital Potentiometers on the eFuse 2 click board.
[in] | ctx | : Click context object. See efuse2_t object definition for detailed explanation. |
[in] | cmd | : Pointer to the memory location where data is stored. |
[in] | data_byte | : Byte of the data to be written. |
void efuse2_write_rdac | ( | efuse2_t * | ctx, |
uint16_t | data_byte | ||
) |
Write RDAC function.
The function writes a 10-bit RDAC data of the AD5175 Single-Channel, 1024-Position, Digital Rheostat with I2C Interface and 50-TP Memory on the eFuse 2 click board.
[in] | ctx | : Click context object. See efuse2_t object definition for detailed explanation. |