ltc4150_recorder_t Struct Reference

Interface to allow recording of the drawn current in a user defined resolution. More...

Detailed Description

Interface to allow recording of the drawn current in a user defined resolution.

Note
Keep in mind that the data recording may be performed by the CPU of the system to monitor - thus keep power consumption for the recording low!

The LTC4150 driver will only track total charge transferred (separately for charging in discharging direction). However, there are use cases that required more precise data recording, e.g. a rolling average of the last minute. This interface allows application developers to implement the ideal trade-off between RAM, ROM and runtime overhead for the data recording and the level of information they require.

Definition at line 121 of file ltc4150.h.

#include <ltc4150.h>

Data Fields

void(* pulse )(ltc4150_dev_t *dev, ltc4150_dir_t dir, uint64_t now_usec, void *arg)
 Function to call on every pulse received from the LTC4150. More...
 
void(* reset )(ltc4150_dev_t *dev, uint64_t now_usec, void *arg)
 Function to call upon driver initialization or reset. More...
 

Field Documentation

◆ pulse

void(* ltc4150_recorder_t::pulse) (ltc4150_dev_t *dev, ltc4150_dir_t dir, uint64_t now_usec, void *arg)

Function to call on every pulse received from the LTC4150.

Warning
This function is called in interrupt context
Parameters
[in]devThe device the pulse was received from
[in]dirDirection in which the charge is transferred
[in]now_usecThe system time the pulse was received in µs
[in]arg(Optional) argument for this callback

Definition at line 131 of file ltc4150.h.

◆ reset

void(* ltc4150_recorder_t::reset) (ltc4150_dev_t *dev, uint64_t now_usec, void *arg)

Function to call upon driver initialization or reset.

See also
ltc4150_init
ltc4150_reset_counters
Parameters
[in]devThe LTC4150 device to monitor
[in]now_usecThe system time the pulse was received in µs
[in]arg(Optional) argument for this callback

Definition at line 142 of file ltc4150.h.


The documentation for this struct was generated from the following file: