SensorLib
0.5.0
Multi-platform sensor driver library for Arduino, PlatformIO, and ESP-IDF
Loading...
Searching...
No Matches
AXP1xxCore.hpp
Go to the documentation of this file.
1
30
#pragma once
31
#include <stdint.h>
32
33
namespace
axp1xx
34
{
35
39
struct
ModuleEntry
{
40
uint8_t
reg
;
41
uint8_t
bit
;
42
};
43
47
struct
CoreConfig
{
48
uint8_t
chipIdReg
;
49
uint8_t
chipIdValue
;
50
uint8_t
i2cAddress
;
51
struct
{
52
const
ModuleEntry
*
table
;
53
uint8_t
count
;
54
}
modules
;
55
};
56
64
inline
const
ModuleEntry
*
findEntry
(
const
ModuleEntry
*table, uint8_t count, uint8_t index)
65
{
66
if
(index >= count)
return
nullptr
;
67
return
&table[index];
68
}
69
70
}
// namespace axp1xx
axp1xx
Definition
AXP192AdcTraits.hpp:43
axp1xx::findEntry
const ModuleEntry * findEntry(const ModuleEntry *table, uint8_t count, uint8_t index)
Look up a module entry by index.
Definition
AXP1xxCore.hpp:64
axp1xx::CoreConfig
Chip configuration metadata.
Definition
AXP1xxCore.hpp:47
axp1xx::CoreConfig::modules
struct axp1xx::CoreConfig::@1 modules
axp1xx::CoreConfig::chipIdValue
uint8_t chipIdValue
Expected chip ID value.
Definition
AXP1xxCore.hpp:49
axp1xx::CoreConfig::count
uint8_t count
Number of entries in the table.
Definition
AXP1xxCore.hpp:53
axp1xx::CoreConfig::chipIdReg
uint8_t chipIdReg
Register address for chip ID.
Definition
AXP1xxCore.hpp:48
axp1xx::CoreConfig::table
const ModuleEntry * table
Pointer to module entry table.
Definition
AXP1xxCore.hpp:52
axp1xx::CoreConfig::i2cAddress
uint8_t i2cAddress
I2C slave address.
Definition
AXP1xxCore.hpp:50
axp1xx::ModuleEntry
Register-bit pair identifying a power module.
Definition
AXP1xxCore.hpp:39
axp1xx::ModuleEntry::bit
uint8_t bit
Bit position within the register.
Definition
AXP1xxCore.hpp:41
axp1xx::ModuleEntry::reg
uint8_t reg
Register address.
Definition
AXP1xxCore.hpp:40
src
pmic
xpowers
axp1xx
AXP1xxCore.hpp
Generated by
1.9.8