rcbench
Servo and ESC test bench: panel, IOmcu and shared C
Loading...
Searching...
No Matches
sense_i3221_cfg.c File Reference

The INA3221 map's helpers. More...

#include "sense_sched.h"
#include <string.h>

Functions

void sense_i3221_one (sense_i3221_cfg_t *m, bool en, uint8_t addr, uint32_t shunt_uohm, uint8_t channels)
 One INA3221 as the SENSE page sets it up before protocol 4.25: the part at addr fitted when en and addr lies in 0x40 to 0x43, each channel in channels (bit 0 CH1) on shunt_uohm, FAST its CH1 when CH1 is one of them.

Detailed Description

The INA3221 map's helpers.

See sense_sched.h. A file of its own so the SENSE page links them without the schedule.

SPDX-License-Identifier: MIT

Function Documentation

◆ sense_i3221_one()

void sense_i3221_one ( sense_i3221_cfg_t * m,
bool en,
uint8_t addr,
uint32_t shunt_uohm,
uint8_t channels )

One INA3221 as the SENSE page sets it up before protocol 4.25: the part at addr fitted when en and addr lies in 0x40 to 0x43, each channel in channels (bit 0 CH1) on shunt_uohm, FAST its CH1 when CH1 is one of them.

Anything else in m is cleared.

Parameters
mThe map entry to fill.
entrue when the part is fitted.
addrI2C address of the part.
shunt_uohmShunt resistance, in µΩ, for each channel it has.
channelsChannels to read, bit 0 CH1.