功率监视器
功率监视器是一种用于监测和管理电源的集成电路。它可以实时监测电源的电压、电流和功率等参数以供系统使用。Power Monitor ICs 可以应用在包括计算机、电源管理系统、消费电子设备、工业控制系统和通信设备等。
适配列表
名称 |
功能 |
总线 |
供应商 |
规格书 |
硬件抽象层 |
---|---|---|---|---|---|
INA236 | 16位数字功率监视器 | I2C | TI | 规格书 | x |
API 参考
The following API implements hardware abstraction for power monitor sensors. Users can directly call this layer of code to write sensor applications.
Header File
Functions
-
esp_err_t ina236_create(ina236_handle_t *handle, ina236_config_t *config)
Create and init object and return a handle.
- 参数
handle – Pointer to handle
config – Pointer to configuration
- 返回
ESP_OK Success
Others Fail
-
esp_err_t ina236_delete(ina236_handle_t handle)
Deinit object and free memory.
- 参数
handle – ina236 handle Handle
- 返回
ESP_OK Success
Others Fail
-
esp_err_t ina236_get_voltage(ina236_handle_t handle, float *volt)
Get the Voltage on the bus.
- 参数
handle – object handle of ina236
volt – Voltage value in volts
- 返回
ESP_OK Success
Others Fail
-
esp_err_t ina236_get_current(ina236_handle_t handle, float *curr)
Get the Current on the bus.
- 参数
handle – object handle of ina236
curr – Current value in A
- 返回
ESP_OK Success
Others Fail
-
esp_err_t ina236_clear_mask(ina236_handle_t handle)
Clear the mask of the alert pin.
- 参数
handle – object handle of ina236
- 返回
ESP_OK Success
Others Fail
Structures
-
struct ina236_config_t
ina236 configuration structure
Public Members
-
i2c_bus_handle_t bus
I2C bus object
-
bool alert_en
Enable alert callback
-
uint8_t dev_addr
I2C device address
-
uint8_t alert_pin
Alert pin number
-
int236_alert_cb_t alert_cb
Alert callback function
-
i2c_bus_handle_t bus
Macros
-
INA236_I2C_ADDRESS_DEFAULT
Type Definitions
-
typedef struct ina236_t *ina236_handle_t
INA236 handle.
-
typedef void (*int236_alert_cb_t)(void *arg)
ina236 alert callback function