1#include "../../../SensorBuildOpt.h"
2#if !SENSORLIB_EXCLUDE_PMIC_AXP517
55 if (pin != 0)
return false;
67 uint8_t field = (uint8_t)((v >> 2) & 0x03);
78 high = (v & 0x02) != 0;
108 default: code = 0b00;
break;
AXP517 low-level core driver.
DriveType getDrive(uint8_t pin) override
Get GPIO pin drive type.
OutputSource getOutputSource(uint8_t pin)
Get current GPIO output source.
bool setOutputSource(uint8_t pin, OutputSource src)
Select GPIO output source.
Status write(uint8_t pin, Level level) override
Set output level.
uint8_t getPinCount() const override
Get number of GPIO pins (1)
Status setDirection(uint8_t pin, Direction dir) override
Set GPIO pin direction.
AXP517Gpio(AXP517Core &core)
Construct an AXP517 GPIO driver.
Status setDrive(uint8_t pin, DriveType drive) override
Set GPIO pin drive type.
Status read(uint8_t pin, bool &high) override
Read input level.
OutputSource
Hardware source selected for the GPIO output path.
Direction getDirection(uint8_t pin) override
Get GPIO pin direction.
int readRaw()
Read raw REG11 for debug.
DriveType
GPIO drive type.
@ OpenDrain
Open-drain output: only pulls low, high-impedance for high.
@ PushPull
Push-pull output: actively drives high or low.
Level
Output level control.
@ Low
Logic low (active drive low or open-drain pulled low)
@ High
Logic high (active drive high)
@ HiZ
High-impedance (input mode or open-drain not pulling low)
Direction
GPIO pin direction.
@ Output
Configure pin as output (drive external circuits)
@ Input
Configure pin as input (read external signals)
Status
GPIO operation status code.
int readReg(uint8_t reg) const
int updateBits(uint8_t reg, uint8_t mask, uint8_t value_shifted)
static constexpr uint8_t GPIO_CFG
GPIO configure.