smartbuck 2.0.0.0
|
Data Structures | |
struct | smartbuck_t |
Click ctx object definition. More... | |
struct | smartbuck_cfg_t |
Click configuration structure definition. More... | |
Functions | |
void | smartbuck_cfg_setup (smartbuck_cfg_t *cfg) |
Config Object Initialization function. | |
SMARTBUCK_RETVAL | smartbuck_init (smartbuck_t *ctx, smartbuck_cfg_t *cfg) |
Initialization function. | |
void | smartbuck_default_cfg (smartbuck_t *ctx) |
Click Default Configuration function. | |
uint8_t | smartbuck_write_eeprom (smartbuck_t *ctx, uint8_t eeprom_addr, uint8_t data_in) |
EEPROM Write function. | |
uint8_t | smartbuck_read_eeprom (smartbuck_t *ctx, uint8_t eeprom_addr, uint8_t *data_out) |
EEPROM Read function. | |
uint8_t | smartbuck_read_seq_eeprom (smartbuck_t *ctx, uint8_t eeprom_addr, uint8_t *data_out, uint8_t n_bytes) |
Sequential EEPROM Read function. | |
uint8_t | smartbuck_write_pot (smartbuck_t *ctx, uint8_t reg_addr, uint16_t data_in) |
Potentiometer Write function. | |
uint8_t | smartbuck_read_pot (smartbuck_t *ctx, uint8_t reg_addr, uint16_t *data_out) |
Potentiometer Read function. | |
uint8_t | smartbuck_incr_pot (smartbuck_t *ctx, uint8_t wiper_sel, uint16_t steps) |
Potentiometer Increment function. | |
uint8_t | smartbuck_decr_pot (smartbuck_t *ctx, uint8_t wiper_sel, uint16_t steps) |
Potentiometer Decrement function. | |
void | smartbuck_en_regulator1 (smartbuck_t *ctx, uint8_t state) |
Regulator1 Enable function. | |
void | smartbuck_en_regulator2 (smartbuck_t *ctx, uint8_t state) |
Regulator2 Enable function. | |
void | smartbuck_force_pwm_mode (smartbuck_t *ctx, uint8_t state) |
PWM Mode Force function. | |
uint8_t | smartbuck_check_diagnostic (smartbuck_t *ctx) |
Diagnostic Check function. | |
uint8_t | smartbuck_send_cmd_pac (smartbuck_t *ctx, uint8_t command) |
Command Send function. | |
uint8_t | smartbuck_write_pac (smartbuck_t *ctx, uint8_t reg_addr, uint8_t data_in) |
PAC1934 Write function. | |
uint8_t | smartbuck_read_pac (smartbuck_t *ctx, uint8_t reg_addr, uint8_t *data_out) |
PAC1934 Read function. | |
uint8_t | smartbuck_set_addr_ptr_pac (smartbuck_t *ctx, uint8_t reg_addr) |
Address Pointer Set function. | |
void | smartbuck_receive_byte_pac (smartbuck_t *ctx, uint8_t *data_out) |
Byte Receive function. | |
uint8_t | smartbuck_block_read_pac (smartbuck_t *ctx, uint8_t reg_addr, uint8_t *data_out, uint8_t n_bytes) |
PAC1934 Block Read function. | |
uint8_t | smartbuck_set_config_pac (smartbuck_t *ctx, uint8_t en_chann, uint8_t data_format, uint8_t data_sel) |
PAC1934 Configuration Set function. | |
void | smartbuck_get_data (smartbuck_t *ctx, float *voltage, float *current, float *power) |
Data Get function. | |
Variables | |
uint8_t | enabled_chann |
uint8_t smartbuck_block_read_pac | ( | smartbuck_t * | ctx, |
uint8_t | reg_addr, | ||
uint8_t * | data_out, | ||
uint8_t | n_bytes ) |
PAC1934 Block Read function.
ctx | Click object. |
reg_addr | Start address which from data be read |
data_out | Memory where data be stored |
n_bytes | Number of bytes to be read |
Function reads the desired number of bytes from the PAC1934 registers.
void smartbuck_cfg_setup | ( | smartbuck_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
uint8_t smartbuck_check_diagnostic | ( | smartbuck_t * | ctx | ) |
Diagnostic Check function.
ctx | Click object. |
Function checks regulator diagnostic (Power Good state) and returns result.
uint8_t smartbuck_decr_pot | ( | smartbuck_t * | ctx, |
uint8_t | wiper_sel, | ||
uint16_t | steps ) |
Potentiometer Decrement function.
ctx | Click object. |
wiper_sel | 0 - Wiper0, 1 - Wiper1 |
steps | Determines for how many steps potentiometer be decremented |
Function decrements the desired wiper for the desired number of steps.
void smartbuck_default_cfg | ( | smartbuck_t * | ctx | ) |
Click Default Configuration function.
ctx | Click object. |
@description This function executes default configuration for SMARTBUCK click.
void smartbuck_en_regulator1 | ( | smartbuck_t * | ctx, |
uint8_t | state ) |
Regulator1 Enable function.
ctx | Click object. |
state | 0 - OFF, 1 - ON |
Function puts Regulator1 to the desired state.
void smartbuck_en_regulator2 | ( | smartbuck_t * | ctx, |
uint8_t | state ) |
Regulator2 Enable function.
ctx | Click object. |
state | 0 - OFF, 1 - ON |
Function puts Regulator2 to the desired state.
void smartbuck_force_pwm_mode | ( | smartbuck_t * | ctx, |
uint8_t | state ) |
PWM Mode Force function.
ctx | Click object. |
state | 0 - PWM Forced Mode, 1 - Auto Trickle Mode |
Function puts regulator to Forced PWM Mode or to Automatic Trickle Mode.
void smartbuck_get_data | ( | smartbuck_t * | ctx, |
float * | voltage, | ||
float * | current, | ||
float * | power ) |
Data Get function.
ctx | Click object. |
voltage | Memory where voltage data be stored |
current | Memory where current data be stored. |
power | Memory where power data be stored. |
Function reads and calculates the voltage, current and power data from PAC1934 activated channels.
uint8_t smartbuck_incr_pot | ( | smartbuck_t * | ctx, |
uint8_t | wiper_sel, | ||
uint16_t | steps ) |
Potentiometer Increment function.
ctx | Click object. |
wiper_sel | 0 - Wiper0, 1 - Wiper1 |
steps | Determines for how many steps potentiometer be incremented |
Function increments the desired wiper for the desired number of steps.
SMARTBUCK_RETVAL smartbuck_init | ( | smartbuck_t * | ctx, |
smartbuck_cfg_t * | cfg ) |
Initialization function.
ctx | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.
uint8_t smartbuck_read_eeprom | ( | smartbuck_t * | ctx, |
uint8_t | eeprom_addr, | ||
uint8_t * | data_out ) |
EEPROM Read function.
ctx | Click object. |
eeprom_addr | Address which from data be read |
data_out | Memory where data be stored |
Function reads one byte from the EEPROM.
uint8_t smartbuck_read_pac | ( | smartbuck_t * | ctx, |
uint8_t | reg_addr, | ||
uint8_t * | data_out ) |
PAC1934 Read function.
ctx | Click object. |
reg_addr | Address which from data be read |
data_out | Memory where data be stored |
Function reads one byte from the PAC1934 register.
uint8_t smartbuck_read_pot | ( | smartbuck_t * | ctx, |
uint8_t | reg_addr, | ||
uint16_t * | data_out ) |
Potentiometer Read function.
ctx | Click object. |
reg_addr | Address which from data be read |
data_out | Memory where data be stored |
Function reads 16bit data from the Potentiometer register (MCP4661).
uint8_t smartbuck_read_seq_eeprom | ( | smartbuck_t * | ctx, |
uint8_t | eeprom_addr, | ||
uint8_t * | data_out, | ||
uint8_t | n_bytes ) |
Sequential EEPROM Read function.
ctx | Click object. |
eeprom_addr | Start address which from data be read |
data_out | Memory where data be stored |
n_bytes | Number of bytes to be read |
Function reads the desired number of bytes from the EEPROM.
void smartbuck_receive_byte_pac | ( | smartbuck_t * | ctx, |
uint8_t * | data_out ) |
Byte Receive function.
ctx | Click object. |
data_out | Memory where byte be stored |
Function receives one byte from the PAC1934 address on which internal address pointer is set up.
uint8_t smartbuck_send_cmd_pac | ( | smartbuck_t * | ctx, |
uint8_t | command ) |
Command Send function.
ctx | Click object. |
command | Command to be performed |
Function performs the desired command for PAC1934.
uint8_t smartbuck_set_addr_ptr_pac | ( | smartbuck_t * | ctx, |
uint8_t | reg_addr ) |
Address Pointer Set function.
ctx | Click object. |
reg_addr | Address on which address pointer be set up |
Function sets internal address pointer on the desired PAC1934 register.
uint8_t smartbuck_set_config_pac | ( | smartbuck_t * | ctx, |
uint8_t | en_chann, | ||
uint8_t | data_format, | ||
uint8_t | data_sel ) |
PAC1934 Configuration Set function.
ctx | Click object. |
en_chann | Determines which channel be enabled or disabled |
data_format | Determines format of data, signed or unsigned |
data_sel | Selects conversion mode, one sample(0) or averaged data(1) |
Function sets configuration for conversion cycle for PAC1934.
uint8_t smartbuck_write_eeprom | ( | smartbuck_t * | ctx, |
uint8_t | eeprom_addr, | ||
uint8_t | data_in ) |
EEPROM Write function.
ctx | Click object. |
eeprom_addr | Address where data be written |
data_in | Data to be written |
Function writes one byte to the EEPROM.
uint8_t smartbuck_write_pac | ( | smartbuck_t * | ctx, |
uint8_t | reg_addr, | ||
uint8_t | data_in ) |
PAC1934 Write function.
ctx | Click object. |
reg_addr | Address where data be written |
data_in | Data to be written |
Function writes one byte to the PAC1934 register.
uint8_t smartbuck_write_pot | ( | smartbuck_t * | ctx, |
uint8_t | reg_addr, | ||
uint16_t | data_in ) |
Potentiometer Write function.
ctx | Click object. |
reg_addr | Address where data be written |
data_in | Data to be written |
Function writes 16bit data to the Potentiometer register (MCP4661).
|
extern |
This variable checks which channel is enabled