Zephyr API Documentation 4.1.99
A Scalable Open Source RTOS
 4.1.99
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
pzem004t.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2025 Srishtik Bhandarkar
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef ZEPHYR_INCLUDE_DRIVERS_SENSOR_PZEM004T_H_
8#define ZEPHYR_INCLUDE_DRIVERS_SENSOR_PZEM004T_H_
9
11
12/* PZEM004T specific channels */
14 /* Energy corresponds to active power accumulated over time.
15 * Units: 1Wh (Watt-hours)
16 */
18 /* Power factor is defined as ratio of real power to apparent power 0. 01 resolution.
19 * Unit: No unit
20 */
22 /* Alarm status is 0xFF when current active power is greater than power alarm threshold.
23 * 0x00 when current power is less than power alarm threshold.
24 * Unit: No unit
25 */
27 /* Active Power above which the power alarm threshold is set.
28 * Unit: 1W (Watts)
29 */
31 /* Unique Modbus address of each pzem004t device on the modbus. Only use this
32 * to set individual modbus address by connecteing each device individually.
33 */
35 /* Channel used to set the Modbus address of pzem004t device for the device instance.
36 * This does not set the modbus address of the device. It is used to set the
37 * modbus address of the device instance only for the driver.
38 */
40 /* Channel used to reset the Energy counter of the pzem004t sensor. Please enable
41 * the CONFIG_PZEM004T_ENABLE_RESET_ENERGY option in prj.conf in application to
42 * use the channel.
43 */
45};
46
48 /* Active Power above which the power alarm threshold is set.
49 * Unit: 1W (Watts)
50 */
52 /* Unique Modbus address of each pzem004t device on the modbus. Only use this
53 * to set individual modbus address by connecteing each device individually.
54 */
56 /* Attribute used to set the Modbus address of pzem004t device for the device instance.
57 * This does not set the modbus address of the device. It is used to set the
58 * modbus address of the device instance only for the driver.
59 */
61 /* Attribute used to reset the Energy counter of the pzem004t sensor. Please enable
62 * the CONFIG_PZEM004T_ENABLE_RESET_ENERGY option in prj.conf in appplicationtn
63 * use the channel.
64 */
66};
67
68#endif /* ZEPHYR_INCLUDE_DRIVERS_SENSOR_PZEM004T_H_ */
@ SENSOR_ATTR_PRIV_START
This and higher values are sensor specific.
Definition sensor.h:368
@ SENSOR_CHAN_PRIV_START
This and higher values are sensor specific.
Definition sensor.h:217
sensor_attribute_pzem004t
Definition pzem004t.h:47
@ SENSOR_ATTR_PZEM004T_ADDRESS_INST_SET
Definition pzem004t.h:60
@ SENSOR_ATTR_PZEM004T_RESET_ENERGY
Definition pzem004t.h:65
@ SENSOR_ATTR_PZEM004T_MODBUS_RTU_ADDRESS
Definition pzem004t.h:55
@ SENSOR_ATTR_PZEM004T_POWER_ALARM_THRESHOLD
Definition pzem004t.h:51
sensor_channel_pzem004t
Definition pzem004t.h:13
@ SENSOR_CHAN_PZEM004T_POWER_ALARM_THRESHOLD
Definition pzem004t.h:30
@ SENSOR_CHAN_PZEM004T_RESET_ENERGY
Definition pzem004t.h:44
@ SENSOR_CHAN_PZEM004T_ADDRESS_INST_SET
Definition pzem004t.h:39
@ SENSOR_CHAN_PZEM004T_ENERGY
Definition pzem004t.h:17
@ SENSOR_CHAN_PZEM004T_MODBUS_RTU_ADDRESS
Definition pzem004t.h:34
@ SENSOR_CHAN_PZEM004T_ALARM_STATUS
Definition pzem004t.h:26
@ SENSOR_CHAN_PZEM004T_POWER_FACTOR
Definition pzem004t.h:21
Public APIs for the sensor driver.