driver hlw8032 basic header file
uint8_t hlw8032_set_transformer_current_k2(hlw8032_handle_t *handle, float coeff)
set transformer current k2
uint8_t hlw8032_read(hlw8032_handle_t *handle, hlw8032_data_t *data)
read the data
uint8_t hlw8032_deinit(hlw8032_handle_t *handle)
close the chip
uint8_t hlw8032_init(hlw8032_handle_t *handle)
initialize the chip
uint8_t hlw8032_set_mode(hlw8032_handle_t *handle, hlw8032_mode_t mode)
set mode
uint8_t hlw8032_set_transformer_voltage_k1(hlw8032_handle_t *handle, float coeff)
set transformer voltage k1
uint8_t hlw8032_quantity_electricity_export(hlw8032_handle_t *handle, int64_t *quantity_electricity_counter)
quantity electricity export
struct hlw8032_handle_s hlw8032_handle_t
hlw8032 handle structure definition
uint8_t hlw8032_quantity_electricity_import(hlw8032_handle_t *handle, int64_t quantity_electricity_counter)
quantity electricity import
uint8_t hlw8032_set_transformer_power_k3(hlw8032_handle_t *handle, float coeff)
set transformer power k3
uint8_t hlw8032_set_sample_voltage_coefficient(hlw8032_handle_t *handle, float coeff)
set sample voltage coefficient
hlw8032_mode_t
hlw8032 mode enumeration definition
uint8_t hlw8032_set_sample_current_coefficient(hlw8032_handle_t *handle, float coeff)
set sample current coefficient
struct hlw8032_data_s hlw8032_data_t
hlw8032 data structure definition
#define HLW8032_BASIC_DEFAULT_TRANSFORMER_POWER_K3
uint8_t hlw8032_basic_read(hlw8032_data_t *data)
basic example read
#define HLW8032_BASIC_DEFAULT_SAMPLE_VOLTAGE_COEFFICIENT
hlw8032 basic example default definition
uint8_t hlw8032_basic_quantity_electricity_import(int64_t quantity_electricity_counter)
basic example quantity electricity import
uint8_t hlw8032_basic_quantity_electricity_export(int64_t *quantity_electricity_counter)
basic example quantity electricity export
#define HLW8032_BASIC_DEFAULT_TRANSFORMER_CURRENT_K2
#define HLW8032_BASIC_DEFAULT_SAMPLE_CURRENT_COEFFICIENT
uint8_t hlw8032_basic_init(hlw8032_mode_t mode)
basic example init
#define HLW8032_BASIC_DEFAULT_TRANSFORMER_VOLTAGE_K1
uint8_t hlw8032_basic_deinit(void)
basic example deinit
void hlw8032_interface_debug_print(const char *const fmt,...)
interface print format data
uint8_t hlw8032_interface_uart_flush(void)
interface uart flush
void hlw8032_interface_delay_ms(uint32_t ms)
interface delay ms
uint8_t hlw8032_interface_uart_init(void)
interface uart init
uint8_t hlw8032_interface_uart_deinit(void)
interface uart deinit
uint16_t hlw8032_interface_uart_read(uint8_t *buf, uint16_t len)
interface uart read
#define DRIVER_HLW8032_LINK_UART_INIT(HANDLE, FUC)
link uart_init function
#define DRIVER_HLW8032_LINK_DEBUG_PRINT(HANDLE, FUC)
link debug_print function
#define DRIVER_HLW8032_LINK_INIT(HANDLE, STRUCTURE)
initialize hlw8032_handle_t structure
#define DRIVER_HLW8032_LINK_UART_FLUSH(HANDLE, FUC)
link uart_flush function
#define DRIVER_HLW8032_LINK_UART_DEINIT(HANDLE, FUC)
link uart_deinit function
#define DRIVER_HLW8032_LINK_DELAY_MS(HANDLE, FUC)
link delay_ms function
#define DRIVER_HLW8032_LINK_UART_READ(HANDLE, FUC)
link uart_read function