pwrmeter2 2.0.0.0
|
Functions | |
void | pwrmeter2_cfg_setup (pwrmeter2_cfg_t *cfg) |
Config Object Initialization function. | |
err_t | pwrmeter2_init (pwrmeter2_t *ctx, pwrmeter2_cfg_t *cfg) |
Initialization function. | |
err_t | pwrmeter2_default_cfg (pwrmeter2_t *ctx) |
Click Default Configuration function. | |
err_t | pwrmeter2_write_reg (pwrmeter2_t *ctx, uint8_t reg, uint32_t data_in) |
Generic Write function. | |
err_t | pwrmeter2_read_reg (pwrmeter2_t *ctx, uint8_t reg, uint32_t *data_out, uint8_t len) |
Generic Read function. | |
err_t | pwrmeter2_read_conv_data (pwrmeter2_t *ctx, uint32_t *data_ch_0, uint32_t *data_ch_1) |
Read Converted Data function. | |
err_t | pwrmeter2_get_data (pwrmeter2_t *ctx, float *voltage, float *current, float *power) |
Data Get function. | |
void | pwrmeter2_reset (pwrmeter2_t *ctx) |
Reset function. | |
uint8_t | pwrmeter2_get_modulator_1 (pwrmeter2_t *ctx) |
Modulator 1 Get function. | |
uint8_t | pwrmeter2_get_modulator_0 (pwrmeter2_t *ctx) |
Modulator 0 Get function. | |
uint8_t | pwrmeter2_check_ready_pin (pwrmeter2_t *ctx) |
Ready Pin Check function. | |
void pwrmeter2_cfg_setup | ( | pwrmeter2_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
This function initializes click configuration structure to init state.
uint8_t pwrmeter2_check_ready_pin | ( | pwrmeter2_t * | ctx | ) |
Ready Pin Check function.
ctx | Click object. |
This function returns the state of the Data Ready ( DR ) pin.
err_t pwrmeter2_default_cfg | ( | pwrmeter2_t * | ctx | ) |
Click Default Configuration function.
ctx | Click object. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.err_t pwrmeter2_get_data | ( | pwrmeter2_t * | ctx, |
float * | voltage, | ||
float * | current, | ||
float * | power ) |
Data Get function.
ctx | Click object. |
voltage | Stores the voltage data in V. |
current | Stores the current data in A. |
power | Stores the power data in W. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.uint8_t pwrmeter2_get_modulator_0 | ( | pwrmeter2_t * | ctx | ) |
Modulator 0 Get function.
ctx | Click object. |
This function returns the state of the modulator output for the channel 0.
uint8_t pwrmeter2_get_modulator_1 | ( | pwrmeter2_t * | ctx | ) |
Modulator 1 Get function.
ctx | Click object. |
This function returns the state of the modulator output for the channel 1.
err_t pwrmeter2_init | ( | pwrmeter2_t * | ctx, |
pwrmeter2_cfg_t * | cfg ) |
Initialization function.
ctx | Click object. |
cfg | Click configuration structure. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.err_t pwrmeter2_read_conv_data | ( | pwrmeter2_t * | ctx, |
uint32_t * | data_ch_0, | ||
uint32_t * | data_ch_1 ) |
Read Converted Data function.
ctx | Click object. |
data_ch_0 | Buffer where the converted data from channel 0 register be stored. |
data_ch_1 | Buffer where the converted data from channel 1 register be stored. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.err_t pwrmeter2_read_reg | ( | pwrmeter2_t * | ctx, |
uint8_t | reg, | ||
uint32_t * | data_out, | ||
uint8_t | len ) |
Generic Read function.
ctx | Click object. |
reg | Address which from data be read. |
data_out | Buffer where data be stored. |
len | Number of data to be read. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.void pwrmeter2_reset | ( | pwrmeter2_t * | ctx | ) |
Reset function.
ctx | Click object. |
This function performs the hardware reset and puts the device back to the normal operation mode after 1.2 seconds.
err_t pwrmeter2_write_reg | ( | pwrmeter2_t * | ctx, |
uint8_t | reg, | ||
uint32_t | data_in ) |
Generic Write function.
ctx | Click object. |
reg | Address where data be written. |
data_in | Data to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.