![]() |
LibDriver HLW8032
|
hlw8032 basic driver modules More...
Data Structures | |
| struct | hlw8032_data_s |
| hlw8032 data structure definition More... | |
| struct | hlw8032_handle_s |
| hlw8032 handle structure definition More... | |
| struct | hlw8032_info_s |
| hlw8032 information structure definition More... | |
Typedefs | |
| typedef struct hlw8032_data_s | hlw8032_data_t |
| hlw8032 data structure definition | |
| typedef struct hlw8032_handle_s | hlw8032_handle_t |
| hlw8032 handle structure definition | |
| typedef struct hlw8032_info_s | hlw8032_info_t |
| hlw8032 information structure definition | |
Enumerations | |
| enum | hlw8032_mode_t { HLW8032_MODE_SAMPLE = 0 , HLW8032_MODE_TRANSFORMER = 1 } |
| hlw8032 mode enumeration definition More... | |
| enum | hlw8032_status_t { HLW8032_STATUS_VOLTAGE_OVERFLOW = (1 << 3) , HLW8032_STATUS_CURRENT_OVERFLOW = (1 << 2) , HLW8032_STATUS_POWER_OVERFLOW = (1 << 1) , HLW8032_STATUS_REGISTER_INVALID = (1 << 0) } |
| hlw8032 status enumeration definition More... | |
| enum | hlw8032_update_status_t { HLW8032_UPDATE_STATUS_PF_OVERFLOW = (1 << 7) , HLW8032_UPDATE_STATUS_VOLTAGE_UPDATED = (1 << 6) , HLW8032_UPDATE_STATUS_CURRENT_UPDATED = (1 << 5) , HLW8032_UPDATE_STATUS_POWER_UPDATED = (1 << 4) } |
| hlw8032 update status enumeration definition More... | |
Functions | |
| uint8_t | hlw8032_info (hlw8032_info_t *info) |
| get chip's information | |
| uint8_t | hlw8032_init (hlw8032_handle_t *handle) |
| initialize the chip | |
| uint8_t | hlw8032_deinit (hlw8032_handle_t *handle) |
| close the chip | |
| uint8_t | hlw8032_read (hlw8032_handle_t *handle, hlw8032_data_t *data) |
| read the data | |
| uint8_t | hlw8032_set_mode (hlw8032_handle_t *handle, hlw8032_mode_t mode) |
| set mode | |
| uint8_t | hlw8032_get_mode (hlw8032_handle_t *handle, hlw8032_mode_t *mode) |
| get mode | |
| uint8_t | hlw8032_quantity_electricity_export (hlw8032_handle_t *handle, int64_t *quantity_electricity_counter) |
| quantity electricity export | |
| uint8_t | hlw8032_quantity_electricity_import (hlw8032_handle_t *handle, int64_t quantity_electricity_counter) |
| quantity electricity import | |
| uint8_t | hlw8032_set_sample_voltage_coefficient (hlw8032_handle_t *handle, float coeff) |
| set sample voltage coefficient | |
| uint8_t | hlw8032_get_sample_voltage_coefficient (hlw8032_handle_t *handle, float *coeff) |
| get sample voltage coefficient | |
| uint8_t | hlw8032_set_sample_current_coefficient (hlw8032_handle_t *handle, float coeff) |
| set sample current coefficient | |
| uint8_t | hlw8032_get_sample_current_coefficient (hlw8032_handle_t *handle, float *coeff) |
| get sample current coefficient | |
| uint8_t | hlw8032_set_transformer_voltage_k1 (hlw8032_handle_t *handle, float coeff) |
| set transformer voltage k1 | |
| uint8_t | hlw8032_get_transformer_voltage_k1 (hlw8032_handle_t *handle, float *coeff) |
| get transformer voltage k1 | |
| uint8_t | hlw8032_set_transformer_current_k2 (hlw8032_handle_t *handle, float coeff) |
| set transformer current k2 | |
| uint8_t | hlw8032_get_transformer_current_k2 (hlw8032_handle_t *handle, float *coeff) |
| get transformer current k2 | |
| uint8_t | hlw8032_set_transformer_power_k3 (hlw8032_handle_t *handle, float coeff) |
| set transformer power k3 | |
| uint8_t | hlw8032_get_transformer_power_k3 (hlw8032_handle_t *handle, float *coeff) |
| get transformer power k3 | |
hlw8032 basic driver modules
| typedef struct hlw8032_data_s hlw8032_data_t |
hlw8032 data structure definition
| typedef struct hlw8032_handle_s hlw8032_handle_t |
hlw8032 handle structure definition
| typedef struct hlw8032_info_s hlw8032_info_t |
hlw8032 information structure definition
| enum hlw8032_mode_t |
hlw8032 mode enumeration definition
| Enumerator | |
|---|---|
| HLW8032_MODE_SAMPLE | sample |
| HLW8032_MODE_TRANSFORMER | transformer |
Definition at line 97 of file driver_hlw8032.h.
| enum hlw8032_status_t |
hlw8032 status enumeration definition
Definition at line 106 of file driver_hlw8032.h.
hlw8032 update status enumeration definition
Definition at line 117 of file driver_hlw8032.h.
| uint8_t hlw8032_deinit | ( | hlw8032_handle_t * | handle | ) |
close the chip
| [in] | *handle | pointer to a hlw8032 handle structure |
Definition at line 133 of file driver_hlw8032.c.
| uint8_t hlw8032_get_mode | ( | hlw8032_handle_t * | handle, |
| hlw8032_mode_t * | mode ) |
get mode
| [in] | *handle | pointer to a hlw8032 handle structure |
| [out] | *mode | pointer to a chip mode buffer |
Definition at line 562 of file driver_hlw8032.c.
| uint8_t hlw8032_get_sample_current_coefficient | ( | hlw8032_handle_t * | handle, |
| float * | coeff ) |
get sample current coefficient
| [in] | *handle | pointer to a hlw8032 handle structure |
| [out] | *coeff | pointer to a current coefficient buffer |
Definition at line 670 of file driver_hlw8032.c.
| uint8_t hlw8032_get_sample_voltage_coefficient | ( | hlw8032_handle_t * | handle, |
| float * | coeff ) |
get sample voltage coefficient
| [in] | *handle | pointer to a hlw8032 handle structure |
| [out] | *coeff | pointer to a voltage coefficient buffer |
Definition at line 616 of file driver_hlw8032.c.
| uint8_t hlw8032_get_transformer_current_k2 | ( | hlw8032_handle_t * | handle, |
| float * | coeff ) |
get transformer current k2
| [in] | *handle | pointer to a hlw8032 handle structure |
| [out] | *coeff | pointer to a current coefficient buffer |
Definition at line 778 of file driver_hlw8032.c.
| uint8_t hlw8032_get_transformer_power_k3 | ( | hlw8032_handle_t * | handle, |
| float * | coeff ) |
get transformer power k3
| [in] | *handle | pointer to a hlw8032 handle structure |
| [out] | *coeff | pointer to a power coefficient buffer |
Definition at line 832 of file driver_hlw8032.c.
| uint8_t hlw8032_get_transformer_voltage_k1 | ( | hlw8032_handle_t * | handle, |
| float * | coeff ) |
get transformer voltage k1
| [in] | *handle | pointer to a hlw8032 handle structure |
| [out] | *coeff | pointer to a voltage coefficient buffer |
Definition at line 724 of file driver_hlw8032.c.
| uint8_t hlw8032_info | ( | hlw8032_info_t * | info | ) |
get chip's information
| [out] | *info | pointer to a hlw8032 info structure |
Definition at line 902 of file driver_hlw8032.c.
| uint8_t hlw8032_init | ( | hlw8032_handle_t * | handle | ) |
initialize the chip
| [in] | *handle | pointer to a hlw8032 handle structure |
Definition at line 61 of file driver_hlw8032.c.
| uint8_t hlw8032_quantity_electricity_export | ( | hlw8032_handle_t * | handle, |
| int64_t * | quantity_electricity_counter ) |
quantity electricity export
| [in] | *handle | pointer to a hlw8032 handle structure |
| [out] | *quantity_electricity_counter | pointer to a quantity electricity counter buffer |
Definition at line 420 of file driver_hlw8032.c.
| uint8_t hlw8032_quantity_electricity_import | ( | hlw8032_handle_t * | handle, |
| int64_t | quantity_electricity_counter ) |
quantity electricity import
| [in] | *handle | pointer to a hlw8032 handle structure |
| [in] | quantity_electricity_counter | quantity electricity counter |
Definition at line 448 of file driver_hlw8032.c.
| uint8_t hlw8032_read | ( | hlw8032_handle_t * | handle, |
| hlw8032_data_t * | data ) |
read the data
| [in] | *handle | pointer to a hlw8032 handle structure |
| [out] | *data | pointer to a data structure |
Definition at line 168 of file driver_hlw8032.c.
| uint8_t hlw8032_set_mode | ( | hlw8032_handle_t * | handle, |
| hlw8032_mode_t | mode ) |
set mode
| [in] | *handle | pointer to a hlw8032 handle structure |
| [in] | mode | chip mode |
Definition at line 535 of file driver_hlw8032.c.
| uint8_t hlw8032_set_sample_current_coefficient | ( | hlw8032_handle_t * | handle, |
| float | coeff ) |
set sample current coefficient
| [in] | *handle | pointer to a hlw8032 handle structure |
| [in] | coeff | current coefficient |
Definition at line 643 of file driver_hlw8032.c.
| uint8_t hlw8032_set_sample_voltage_coefficient | ( | hlw8032_handle_t * | handle, |
| float | coeff ) |
set sample voltage coefficient
| [in] | *handle | pointer to a hlw8032 handle structure |
| [in] | coeff | voltage coefficient |
Definition at line 589 of file driver_hlw8032.c.
| uint8_t hlw8032_set_transformer_current_k2 | ( | hlw8032_handle_t * | handle, |
| float | coeff ) |
set transformer current k2
| [in] | *handle | pointer to a hlw8032 handle structure |
| [in] | coeff | current coefficient |
Definition at line 751 of file driver_hlw8032.c.
| uint8_t hlw8032_set_transformer_power_k3 | ( | hlw8032_handle_t * | handle, |
| float | coeff ) |
set transformer power k3
| [in] | *handle | pointer to a hlw8032 handle structure |
| [in] | coeff | power coefficient |
Definition at line 805 of file driver_hlw8032.c.
| uint8_t hlw8032_set_transformer_voltage_k1 | ( | hlw8032_handle_t * | handle, |
| float | coeff ) |
set transformer voltage k1
| [in] | *handle | pointer to a hlw8032 handle structure |
| [in] | coeff | voltage coefficient |
Definition at line 697 of file driver_hlw8032.c.