pwrmeter 2.0.0.0
|
This file contains API for PWR Meter Click driver. More...
#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_uart.h"
Go to the source code of this file.
Data Structures | |
struct | pwrmeter_t |
Click ctx object definition. More... | |
struct | pwrmeter_cfg_t |
Click configuration structure definition. More... | |
Typedefs | |
typedef uint8_t | pwrmeter_error_t |
Error type. | |
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. | |
This file contains API for PWR Meter Click driver.
#define PWRMETER_16BIT_DATA 0x00 |
#define PWRMETER_32BIT_DATA 0x01 |
#define PWRMETER_ACCUM_INTER_PAR_REG 0x00C0 |
#define PWRMETER_ACTIVE_PWR_REG 0x0012 |
#define PWRMETER_ADDRESS_FAIL 0x00 |
#define PWRMETER_APP_PWR_DIV_DIG_REG 0x00BE |
#define PWRMETER_APPARENT_PWR_REG 0x001A |
#define PWRMETER_BOTH_RESET 0x00000060 |
#define PWRMETER_BOTH_SHUTDOWN 0x00000018 |
#define PWRMETER_CALIB_CURR_REG 0x00A0 |
#define PWRMETER_CALIB_DELIMIT_REG 0x004E |
#define PWRMETER_CALIB_PWR_ACTIVE_REG 0x00A6 |
#define PWRMETER_CALIB_PWR_REACTIVE_REG 0x00AA |
#define PWRMETER_CALIB_VOLT_REG 0x00A4 |
#define PWRMETER_CHECKSUM_FAIL 0x51 |
#define PWRMETER_COMMAND_FAIL 0x15 |
#define PWRMETER_CURR_GAIN_1 0x00000000 |
#define PWRMETER_CURR_GAIN_16 0x04000000 |
#define PWRMETER_CURR_GAIN_2 0x01000000 |
#define PWRMETER_CURR_GAIN_32 0x05000000 |
#define PWRMETER_CURR_GAIN_4 0x02000000 |
#define PWRMETER_CURR_GAIN_8 0x03000000 |
#define PWRMETER_CURR_RESET 0x00000020 |
#define PWRMETER_CURR_RMS_REG 0x000E |
#define PWRMETER_CURR_SHUTDOWN 0x00000008 |
#define PWRMETER_DC_GAIN_ACTIVE_PWR_REG 0x0070 |
#define PWRMETER_DC_GAIN_CURR_RMS_REG 0x006C |
#define PWRMETER_DC_GAIN_VOLT_RMS_REG 0x006E |
#define PWRMETER_DC_OFFSET_AVTIVE_PWR_REG 0x0074 |
#define PWRMETER_DC_OFFSET_CURR_RMS_REG 0x0072 |
#define PWRMETER_DCCURR_SIGN_MASK 0x02 |
#define PWRMETER_DCMODE_MASK 0x01 |
#define PWRMETER_DCVOLT_SIGN_MASK 0x04 |
#define PWRMETER_DISABLE 0x01 |
#define PWRMETER_ENABLE 0x00 |
#define PWRMETER_ENERGY_ON 0x00000001 |
#define PWRMETER_EVENT_CONFIG_REG 0x0098 |
#define PWRMETER_EXPORT_ACTIVE_E_COUNT_REG 0x0026 |
#define PWRMETER_EXPORT_REACTIVE_E_COUNT_REG 0x0036 |
#define PWRMETER_GAIN_ACTIVE_PWR_REG 0x0054 |
#define PWRMETER_GAIN_CURR_RMS_REG 0x0050 |
#define PWRMETER_GAIN_LINE_FREQ_REG 0x0060 |
#define PWRMETER_GAIN_REACTIVE_PWR_REG 0x0056 |
#define PWRMETER_GAIN_VOLT_RMS_REG 0x0052 |
#define PWRMETER_IMPORT_ACTIVE_E_COUNT_REG 0x001E |
#define PWRMETER_IMPORT_REACTIVE_E_COUNT_REG 0x002E |
#define PWRMETER_INCAP_CURR_COMP_REG 0x0066 |
#define PWRMETER_INSTR_POINTER_REG 0x0000 |
#define PWRMETER_INT_VOLT_REF_DISABLED 0x00000004 |
#define PWRMETER_LINE_FREQ_REF_REG 0x00CA |
#define PWRMETER_LINE_FREQ_REG 0x0008 |
#define PWRMETER_MAX_RECORD_1_REG 0x0046 |
#define PWRMETER_MAX_RECORD_2_REG 0x004A |
#define PWRMETER_MIN_MAX_POINTER1_REG 0x00C6 |
#define PWRMETER_MIN_MAX_POINTER2_REG 0x00C8 |
#define PWRMETER_MIN_RECORD_1_REG 0x003E |
#define PWRMETER_MIN_RECORD_2_REG 0x0042 |
#define PWRMETER_NBYTES_FAIL 0x01 |
#define PWRMETER_NO_LOAD_THRESHOLD_REG 0x00E0 |
#define PWRMETER_OFFCAL_CH0_REG 0x007C |
#define PWRMETER_OFFCAL_CH1_REG 0x007E |
#define PWRMETER_OFFCAL_MSB_REG 0x007A |
#define PWRMETER_OFFSET_ACTIVE_PWR_REG 0x005C |
#define PWRMETER_OFFSET_CURR_RMS_REG 0x005A |
#define PWRMETER_OFFSET_REACTIVE_PWR_REG 0x005E |
#define PWRMETER_OVER_CURR_LIMIT_REG 0x00D2 |
#define PWRMETER_OVER_PWR_LIMIT_REG 0x00D6 |
#define PWRMETER_OVER_TEMP_LIMIT_REG 0x00DA |
#define PWRMETER_PA_SIGN_MASK 0x10 |
#define PWRMETER_PAGE_NUM_FAIL 0x02 |
#define PWRMETER_PHASE_COMP_REG 0x0062 |
#define PWRMETER_PR_SIGN_MASK 0x08 |
#define PWRMETER_PWM_DUTY_CYCLE_REG 0x00C4 |
#define PWRMETER_PWM_PERIOD_REG 0x00C2 |
#define PWRMETER_PWM_TURNED_ON 0x00000002 |
#define PWRMETER_PWR_FACTOR_REG 0x000C |
#define PWRMETER_RANGE_REG 0x009C |
#define PWRMETER_RANGE_VDROP_COMP_REG 0x0068 |
#define PWRMETER_REACTIVE_PWR_REG 0x0016 |
#define PWRMETER_SINGLE_WIRE_EN 0x00000100 |
#define PWRMETER_SUCCESSFUL 0x06 |
#define PWRMETER_SYS_CONFIG_REG 0x0094 |
#define PWRMETER_SYS_STATUS_REG 0x0002 |
#define PWRMETER_SYS_VERSION_REG 0x0004 |
#define PWRMETER_TEMP_COMP_EN 0x00000080 |
#define PWRMETER_TEMP_NEG_COMP_CURR_REG 0x0086 |
#define PWRMETER_TEMP_NEG_COMP_FREQ_REG 0x0082 |
#define PWRMETER_TEMP_NEG_COMP_PWR_REG 0x008A |
#define PWRMETER_TEMP_POS_COMP_CURR_REG 0x0084 |
#define PWRMETER_TEMP_POS_COMP_FREQ_REG 0x0080 |
#define PWRMETER_TEMP_POS_COMP_PWR_REG 0x0088 |
#define PWRMETER_THERM_VOLT_CALIB_REG 0x00CC |
#define PWRMETER_THERM_VOLT_REG 0x000A |
#define PWRMETER_UART_BR_115200 0x00000000 |
#define PWRMETER_UART_BR_1200 0x0000E000 |
#define PWRMETER_UART_BR_19200 0x00006000 |
#define PWRMETER_UART_BR_2400 0x0000C000 |
#define PWRMETER_UART_BR_38400 0x00004000 |
#define PWRMETER_UART_BR_4800 0x0000A000 |
#define PWRMETER_UART_BR_57600 0x00002000 |
#define PWRMETER_UART_BR_9600 0x00008000 |
#define PWRMETER_VOLT_DROP_COMP_REG 0x0064 |
#define PWRMETER_VOLT_GAIN_1 0x00000000 |
#define PWRMETER_VOLT_GAIN_16 0x20000000 |
#define PWRMETER_VOLT_GAIN_2 0x08000000 |
#define PWRMETER_VOLT_GAIN_32 0x28000000 |
#define PWRMETER_VOLT_GAIN_4 0x10000000 |
#define PWRMETER_VOLT_GAIN_8 0x18000000 |
#define PWRMETER_VOLT_HIGH_THRESHOLD_REG 0x00DE |
#define PWRMETER_VOLT_LOW_THRESHOLD_REG 0x00DC |
#define PWRMETER_VOLT_RESET 0x00000040 |
#define PWRMETER_VOLT_RMS_REG 0x0006 |
#define PWRMETER_VOLT_SAG_LIMIT_REG 0x00CE |
#define PWRMETER_VOLT_SHUTDOWN 0x00000010 |
#define PWRMETER_VOLT_SURGE_LIMIT_REG 0x00D0 |
#define PWRMETER_ZCD_INVERTED 0x00001000 |
#define PWRMETER_ZCD_OUTPUT_DISABLED 0x00000400 |