pwrmeter 2.0.0.0
|
Functions | |
void | pwrmeter_cfg_setup (pwrmeter_cfg_t *cfg) |
Config Object Initialization function. | |
PWRMETER_RETVAL | pwrmeter_init (pwrmeter_t *ctx, pwrmeter_cfg_t *cfg) |
Initialization function. | |
void | pwrmeter_default_cfg (pwrmeter_t *ctx) |
Click Default Configuration function. | |
void | pwrmeter_generic_write (pwrmeter_t *ctx, char *data_buf, uint16_t len) |
Generic write function. | |
int32_t | pwrmeter_generic_read (pwrmeter_t *ctx, char *data_buf, uint16_t max_len) |
Generic read function. | |
PWRMETER_RETVAL | pwrmeter_read_reg_bytes (pwrmeter_t *ctx, uint16_t reg_addr, uint8_t n_bytes, uint8_t *data_out) |
Bytes Read function. | |
PWRMETER_RETVAL | pwrmeter_read_reg_word (pwrmeter_t *ctx, uint16_t register_addr, uint16_t *data_out) |
WORD Read function. | |
PWRMETER_RETVAL | pwrmeter_read_reg_dword (pwrmeter_t *ctx, uint16_t register_addr, uint32_t *data_out) |
DWORD Read function. | |
PWRMETER_RETVAL | pwrmeter_read_reg_signed (pwrmeter_t *ctx, uint16_t register_addr, uint8_t data_mode, int32_t *data_out) |
Signed Data Read function. | |
PWRMETER_RETVAL | pwrmeter_write_reg_bytes (pwrmeter_t *ctx, uint16_t reg_addr, uint8_t n_bytes, uint8_t *data_in) |
Bytes Write function. | |
PWRMETER_RETVAL | pwrmeter_write_reg_word (pwrmeter_t *ctx, uint16_t register_addr, uint16_t data_in) |
WORD Write function. | |
PWRMETER_RETVAL | pwrmeter_write_reg_dword (pwrmeter_t *ctx, uint16_t register_addr, uint32_t data_in) |
DWORD Write function. | |
PWRMETER_RETVAL | pwrmeter_write_reg_signed (pwrmeter_t *ctx, uint16_t register_addr, uint8_t data_mode, int32_t data_in) |
Signed Data Write function. | |
PWRMETER_RETVAL | pwrmeter_send_command (pwrmeter_t *ctx, uint8_t command_byte) |
Command Send function. | |
PWRMETER_RETVAL | pwrmeter_read_page_eeprom (pwrmeter_t *ctx, uint8_t page_num, uint16_t *data_out) |
EEPROM Read function. | |
PWRMETER_RETVAL | pwrmeter_write_page_eeprom (pwrmeter_t *ctx, uint8_t page_num, uint16_t *data_in) |
EEPROM Write function. | |
PWRMETER_RETVAL | pwrmeter_get_status (pwrmeter_t *ctx, uint8_t *status_data) |
Status Get function. | |
void | pwrmeter_enable (pwrmeter_t *ctx, uint8_t state) |
Enable function. | |
void pwrmeter_cfg_setup | ( | pwrmeter_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
void pwrmeter_default_cfg | ( | pwrmeter_t * | ctx | ) |
Click Default Configuration function.
ctx | Click object. |
@description This function executes default configuration for PwrMeter click.
void pwrmeter_enable | ( | pwrmeter_t * | ctx, |
uint8_t | state ) |
Enable function.
ctx | Click object. |
state | 0 - active state; 1 - inactive state |
@description Function puts output of regulator in enabled or disabled state.
int32_t pwrmeter_generic_read | ( | pwrmeter_t * | ctx, |
char * | data_buf, | ||
uint16_t | max_len ) |
Generic read function.
ctx | Click object. |
pwrmeter | Click object. |
data_buf | Data buffer for read data. |
max_len | The maximum length of data that can be read. |
@description Generic read function
void pwrmeter_generic_write | ( | pwrmeter_t * | ctx, |
char * | data_buf, | ||
uint16_t | len ) |
Generic write function.
ctx | Click object. |
pwrmeter | Click object. |
data_buf | Data buffer for sends. |
len | Number of bytes for sends. |
@description Generic write function
PWRMETER_RETVAL pwrmeter_get_status | ( | pwrmeter_t * | ctx, |
uint8_t * | status_data ) |
Status Get function.
ctx | Click object. |
status_data | Status byte with determined status bits |
@description Function reads 16-bit Status register and makes one byte with determined status bits, which can be useful in code.
PWRMETER_RETVAL pwrmeter_init | ( | pwrmeter_t * | ctx, |
pwrmeter_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.
PWRMETER_RETVAL pwrmeter_read_page_eeprom | ( | pwrmeter_t * | ctx, |
uint8_t | page_num, | ||
uint16_t * | data_out ) |
EEPROM Read function.
ctx | Click object. |
page_num | Page number in EEPROM memory (from 0 to 31) |
data_out | Memory where data be stored |
@description Function reads a 8 16bit data from EEPROM block determined by page number.
PWRMETER_RETVAL pwrmeter_read_reg_bytes | ( | pwrmeter_t * | ctx, |
uint16_t | reg_addr, | ||
uint8_t | n_bytes, | ||
uint8_t * | data_out ) |
Bytes Read function.
ctx | Click object. |
reg_addr | Start address which from data be read |
n_bytes | Number of bytes to be read |
data_out | Memory where data be stored |
@description Function reads data bytes from registers.
PWRMETER_RETVAL pwrmeter_read_reg_dword | ( | pwrmeter_t * | ctx, |
uint16_t | register_addr, | ||
uint32_t * | data_out ) |
DWORD Read function.
ctx | Click object. |
register_addr | Address which from data be read |
data_out | Memory where data be stored |
@description Function reads 32-bit data from the desired register.
PWRMETER_RETVAL pwrmeter_read_reg_signed | ( | pwrmeter_t * | ctx, |
uint16_t | register_addr, | ||
uint8_t | data_mode, | ||
int32_t * | data_out ) |
Signed Data Read function.
ctx | Click object. |
register_addr | Address which from data be read |
data_mode | 0 - 16bit data, 1 - 32bit data |
data_out | Memory where data be stored |
@description Function reads signed 16bit or 32bit data from the desired register.
PWRMETER_RETVAL pwrmeter_read_reg_word | ( | pwrmeter_t * | ctx, |
uint16_t | register_addr, | ||
uint16_t * | data_out ) |
WORD Read function.
ctx | Click object. |
register_addr | Address which from data be read |
data_out | Memory where data be stored |
@description Function reads 16-bit data from the desired register.
PWRMETER_RETVAL pwrmeter_send_command | ( | pwrmeter_t * | ctx, |
uint8_t | command_byte ) |
Command Send function.
ctx | Click object. |
command_byte | Command to be sent |
@description Function sends and performs a determined command.
PWRMETER_RETVAL pwrmeter_write_page_eeprom | ( | pwrmeter_t * | ctx, |
uint8_t | page_num, | ||
uint16_t * | data_in ) |
EEPROM Write function.
ctx | Click object. |
page_num | Page number in EEPROM memory (from 2 to 31) |
data_in | Data to be written |
@description Function writes 8 16bit data to the EEPROM block determined by page number.
PWRMETER_RETVAL pwrmeter_write_reg_bytes | ( | pwrmeter_t * | ctx, |
uint16_t | reg_addr, | ||
uint8_t | n_bytes, | ||
uint8_t * | data_in ) |
Bytes Write function.
ctx | Click object. |
reg_addr | Address where data be written |
n_bytes | Number of bytes to be written |
data_in | Data bytes to be written |
@description Function writes bytes to the registers.
PWRMETER_RETVAL pwrmeter_write_reg_dword | ( | pwrmeter_t * | ctx, |
uint16_t | register_addr, | ||
uint32_t | data_in ) |
DWORD Write function.
ctx | Click object. |
register_addr | Address where data be written |
data_in | Data to be written |
@description Function writes 32-bit data to the register.
PWRMETER_RETVAL pwrmeter_write_reg_signed | ( | pwrmeter_t * | ctx, |
uint16_t | register_addr, | ||
uint8_t | data_mode, | ||
int32_t | data_in ) |
Signed Data Write function.
ctx | Click object. |
register_addr | Address where data be written |
data_mode | 0 - 16bit data, 1 - 32bit data |
data_in | Data to be written |
@description Function writes 16bit or 32bit signed data to the register.
PWRMETER_RETVAL pwrmeter_write_reg_word | ( | pwrmeter_t * | ctx, |
uint16_t | register_addr, | ||
uint16_t | data_in ) |
WORD Write function.
ctx | Click object. |
register_addr | Address where data be written |
data_in | Data to be written |
@description Function writes 16-bit data to the register.