pac1921 2.0.0.0
|
Functions | |
void | pac1921_cfg_setup (pac1921_cfg_t *cfg) |
Config Object Initialization function. | |
PAC1921_RETVAL | pac1921_init (pac1921_t *ctx, pac1921_cfg_t *cfg) |
Initialization function. | |
void | pac1921_default_cfg (pac1921_t *ctx) |
Click Default Configuration function. | |
void | pac1921_generic_write (pac1921_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic write function. | |
void | pac1921_generic_read (pac1921_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic read function. | |
void | pac1921_write_to_reg (pac1921_t *ctx, uint8_t reg_addr, uint8_t *write_data, uint8_t len) |
Register write function. | |
float | pac1921_get_measured_data (pac1921_t *ctx, uint8_t measurement_mode, uint8_t sample_num) |
Measured data read function. | |
void | pac1921_set_int_pin (pac1921_t *ctx, uint8_t output) |
INT pin set output function. | |
uint8_t | pac1921_get_an_pin (pac1921_t *ctx) |
AN pin get input function. | |
void pac1921_cfg_setup | ( | pac1921_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
void pac1921_default_cfg | ( | pac1921_t * | ctx | ) |
Click Default Configuration function.
ctx | Click object. |
@description This function executes default configuration for PAC1921 click.
void pac1921_generic_read | ( | pac1921_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_buf, | ||
uint8_t | len ) |
Generic read function.
ctx | Click object. |
reg | Register address. |
data_buf | Output data buf |
len | Number of the bytes to be read |
@description This function reads data from the desired register.
void pac1921_generic_write | ( | pac1921_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_buf, | ||
uint8_t | len ) |
Generic write function.
ctx | Click object. |
reg | Register address. |
data_buf | Data buf to be written. |
len | Number of the bytes in data buf. |
@description This function writes data to the desired register.
uint8_t pac1921_get_an_pin | ( | pac1921_t * | ctx | ) |
AN pin get input function.
ctx | Click object. |
@description This function gets the digital input from the analog pin.
float pac1921_get_measured_data | ( | pac1921_t * | ctx, |
uint8_t | measurement_mode, | ||
uint8_t | sample_num ) |
Measured data read function.
ctx | Click object. |
measurement_mode | Measurement mode of the PAC1921 chip. |
sample_num | Number of samples that will be acquired. |
@description This function gathers voltage/power data from the PAC1921 chip and, depending on the measurement mode, converts those raw values into a more suitable form.
PAC1921_RETVAL pac1921_init | ( | pac1921_t * | ctx, |
pac1921_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.
void pac1921_set_int_pin | ( | pac1921_t * | ctx, |
uint8_t | output ) |
INT pin set output function.
ctx | Click object. |
output | Pin digital output. |
@description This function sets the digital output on the interrupt pin.
void pac1921_write_to_reg | ( | pac1921_t * | ctx, |
uint8_t | reg_addr, | ||
uint8_t * | write_data, | ||
uint8_t | len ) |
Register write function.
ctx | Click object. |
reg_addr | Register address. |
write_data | Data which will be written. |
len | Size of write_data in bytes. |
@description This function writes data to the specified register address/es and saves the state of the register/s so it doesn't write the same value/s twice.