Zephyr API Documentation 4.5.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches

Microchip PAC194x power monitor. More...

Files

file  pac194x.h
 Header file for extended sensor API of PAC194x/PAC195x sensor.
file  pac194x.h
 Devicetree binding constants for the Microchip PAC194x power monitor.

Enumerations

enum  pac194x_sensor_attribute { SENSOR_ATTR_SAMPLING_FREQUENCY_RAW = SENSOR_ATTR_PRIV_START , SENSOR_ATTR_CHANNEL_ENABLED , SENSOR_ATTR_REFRESH_MODE , SENSOR_ATTR_FORCE_REFRESH_CMD }
 Additional attributes supported by the PAC194x/PAC195x. More...
enum  pac194x_sensor_attr_refresh_mode { PAC194X_SENSOR_ATTR_REFRESH_MODE_AUTO_NOWAIT = 0 , PAC194X_SENSOR_ATTR_REFRESH_MODE_AUTO_WAIT , PAC194X_SENSOR_ATTR_REFRESH_MODE_MANUAL }
 Refresh modes for PAC194x/PAC195x. More...
enum  pac194x_sensor_attr_force_refresh_cmd { PAC194X_SENSOR_ATTR_FORCE_REFRESH_CMD_SINGLE = 0 , PAC194X_SENSOR_ATTR_FORCE_REFRESH_CMD_ALL }
 Refresh commands for PAC194x/PAC195x. More...
enum  pac194x_sensor_channel {
  PAC194X_CHAN_VBUS1 = SENSOR_CHAN_PRIV_START , PAC194X_CHAN_VBUS2 , PAC194X_CHAN_VBUS3 , PAC194X_CHAN_VBUS4 ,
  PAC194X_CHAN_CURR1 , PAC194X_CHAN_CURR2 , PAC194X_CHAN_CURR3 , PAC194X_CHAN_CURR4 ,
  PAC194X_CHAN_ACC1 , PAC194X_CHAN_ACC2 , PAC194X_CHAN_ACC3 , PAC194X_CHAN_ACC4 ,
  PAC194X_CHAN_ACC1_AVG , PAC194X_CHAN_ACC2_AVG , PAC194X_CHAN_ACC3_AVG , PAC194X_CHAN_ACC4_AVG ,
  PAC194X_CHAN_ACC_COUNT
}
 Additional channels supported by the PAC194x/PAC195x. More...

Full-scale range mode

Values for the microchip,vbus-mode and microchip,vsense-mode devicetree properties.

#define PAC_UNIPOLAR_FSR   0
 Unipolar full-scale range.
#define PAC_BIPOLAR_FSR   1
 Bipolar full-scale range.
#define PAC_BIPOLAR_HALF_FSR   2
 Bipolar half (FSR / 2) range.

Accumulation source

Values for the microchip,accumulation-mode devicetree property.

#define PAC_ACCUM_VPOWER   0
 Accumulate power data.
#define PAC_ACCUM_VSENSE   1
 Accumulate current (sense voltage) data.
#define PAC_ACCUM_VBUS   2
 Accumulate bus voltage data.

Refresh mode

Values for the microchip,refresh-mode devicetree property.

#define PAC_REFRESH_MANUAL   0
 Manual refresh.
#define PAC_REFRESH_AUTO_WAIT   1
 Automatic refresh, wait for valid data.
#define PAC_REFRESH_AUTO_NOWAIT   2
 Automatic refresh, do not wait.

Detailed Description

Microchip PAC194x power monitor.

Macro Definition Documentation

◆ PAC_ACCUM_VBUS

#define PAC_ACCUM_VBUS   2

#include <zephyr/dt-bindings/sensor/pac194x.h>

Accumulate bus voltage data.

◆ PAC_ACCUM_VPOWER

#define PAC_ACCUM_VPOWER   0

#include <zephyr/dt-bindings/sensor/pac194x.h>

Accumulate power data.

◆ PAC_ACCUM_VSENSE

#define PAC_ACCUM_VSENSE   1

#include <zephyr/dt-bindings/sensor/pac194x.h>

Accumulate current (sense voltage) data.

◆ PAC_BIPOLAR_FSR

#define PAC_BIPOLAR_FSR   1

#include <zephyr/dt-bindings/sensor/pac194x.h>

Bipolar full-scale range.

◆ PAC_BIPOLAR_HALF_FSR

#define PAC_BIPOLAR_HALF_FSR   2

#include <zephyr/dt-bindings/sensor/pac194x.h>

Bipolar half (FSR / 2) range.

◆ PAC_REFRESH_AUTO_NOWAIT

#define PAC_REFRESH_AUTO_NOWAIT   2

#include <zephyr/dt-bindings/sensor/pac194x.h>

Automatic refresh, do not wait.

◆ PAC_REFRESH_AUTO_WAIT

#define PAC_REFRESH_AUTO_WAIT   1

#include <zephyr/dt-bindings/sensor/pac194x.h>

Automatic refresh, wait for valid data.

◆ PAC_REFRESH_MANUAL

#define PAC_REFRESH_MANUAL   0

#include <zephyr/dt-bindings/sensor/pac194x.h>

Manual refresh.

◆ PAC_UNIPOLAR_FSR

#define PAC_UNIPOLAR_FSR   0

#include <zephyr/dt-bindings/sensor/pac194x.h>

Unipolar full-scale range.

Enumeration Type Documentation

◆ pac194x_sensor_attr_force_refresh_cmd

#include <zephyr/drivers/sensor/pac194x.h>

Refresh commands for PAC194x/PAC195x.

Enumerator
PAC194X_SENSOR_ATTR_FORCE_REFRESH_CMD_SINGLE 

Refresh only a single PAC device.

PAC194X_SENSOR_ATTR_FORCE_REFRESH_CMD_ALL 

Refresh all PACs on the I2C bus at once.

◆ pac194x_sensor_attr_refresh_mode

#include <zephyr/drivers/sensor/pac194x.h>

Refresh modes for PAC194x/PAC195x.

Enumerator
PAC194X_SENSOR_ATTR_REFRESH_MODE_AUTO_NOWAIT 

sample_fetch is non-blocking.

Refresh is being called after samples are collected from ACC registers.

PAC194X_SENSOR_ATTR_REFRESH_MODE_AUTO_WAIT 

sample_fetch is blocking.

Refresh is being called before samples are collected from ACC registers and function waits at least 1ms for data to be accessible.

PAC194X_SENSOR_ATTR_REFRESH_MODE_MANUAL 

sample_fetch is non-blocking and refresh is not being called automatically.

The user is responsible for sending an appropriate REFRESH command.

◆ pac194x_sensor_attribute

#include <zephyr/drivers/sensor/pac194x.h>

Additional attributes supported by the PAC194x/PAC195x.

Enumerator
SENSOR_ATTR_SAMPLING_FREQUENCY_RAW 

Sampling frequency in RAW format.

SENSOR_ATTR_CHANNEL_ENABLED 

Enable/disable specific channel.

SENSOR_ATTR_REFRESH_MODE 

PAC refresh mode.

SENSOR_ATTR_FORCE_REFRESH_CMD 

Command: force refresh PAC accumulated data.

◆ pac194x_sensor_channel

#include <zephyr/drivers/sensor/pac194x.h>

Additional channels supported by the PAC194x/PAC195x.

Enumerator
PAC194X_CHAN_VBUS1 

Channel 1: voltage sensor.

PAC194X_CHAN_VBUS2 

Channel 2: voltage sensor.

PAC194X_CHAN_VBUS3 

Channel 3: voltage sensor.

PAC194X_CHAN_VBUS4 

Channel 4: voltage sensor.

PAC194X_CHAN_CURR1 

Channel 1: current sensor.

PAC194X_CHAN_CURR2 

Channel 2: current sensor.

PAC194X_CHAN_CURR3 

Channel 3: current sensor.

PAC194X_CHAN_CURR4 

Channel 4: current sensor.

PAC194X_CHAN_ACC1 

Channel 1: accumulator RAW value.

PAC194X_CHAN_ACC2 

Channel 2: accumulator RAW value.

PAC194X_CHAN_ACC3 

Channel 3: accumulator RAW value.

PAC194X_CHAN_ACC4 

Channel 4: accumulator RAW value.

PAC194X_CHAN_ACC1_AVG 

Channel 1: accumulator AVG value over SAMPLE_COUNT.

PAC194X_CHAN_ACC2_AVG 

Channel 2: accumulator AVG value over SAMPLE_COUNT.

PAC194X_CHAN_ACC3_AVG 

Channel 3: accumulator AVG value over SAMPLE_COUNT.

PAC194X_CHAN_ACC4_AVG 

Channel 4: accumulator AVG value over SAMPLE_COUNT.

PAC194X_CHAN_ACC_COUNT 

Accumulator SAMPLE_COUNT since last REFRESH.