73 enum class Pull : uint8_t {
virtual Pull getPull(uint8_t pin)
Get current internal pull resistor setting.
virtual Direction getDirection(uint8_t pin)=0
Get current GPIO pin direction.
virtual Status setDirection(uint8_t pin, Direction dir)=0
Set GPIO pin direction.
virtual Status setDrive(uint8_t pin, DriveType drive)=0
Set GPIO drive type.
DriveType
GPIO drive type.
@ Keep
Keep current drive type (do not change)
@ OpenDrain
Open-drain output: only pulls low, high-impedance for high.
@ PushPull
Push-pull output: actively drives high or low.
Status pinMode(uint8_t pin, Direction dir, DriveType drive=DriveType::Keep, Pull pull=Pull::Keep, uint8_t func=0xFF)
Configure a pin with a single high-level call.
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)
virtual ~PmicGpioBase()=default
Virtual destructor.
virtual Status write(uint8_t pin, Level level)=0
Set output level.
virtual DriveType getDrive(uint8_t pin)=0
Get current GPIO drive type.
virtual Status read(uint8_t pin, bool &high)=0
Read input level.
virtual uint8_t getPinCount() const =0
Get number of GPIO pins supported by this PMIC.
Pull
Internal pull resistor configuration.
@ Keep
Keep current pull setting (do not change)
static constexpr bool isOk(Status s)
Direction
GPIO pin direction.
@ Output
Configure pin as output (drive external circuits)
@ Input
Configure pin as input (read external signals)
virtual Status setPull(uint8_t pin, Pull pull)
Set internal pull resistor.
virtual Status setFunction(uint8_t pin, uint8_t func)
Set GPIO pin function mode (chip-specific multiplexing)
Status
GPIO operation status code.
virtual uint8_t getFunction(uint8_t pin)
Get current GPIO pin function mode.