axp192

package
v0.0.0-...-7691dab Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 27, 2022 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
}

type Device

type Device struct {
	*axp192orig.Device
	LED    Pin
	RST    Pin
	SPK_EN Pin
}

Device wraps an I2C connection to a AXP192 device.

func New

func New(i2c drivers.I2C) *Device

New creates a new AXP192 connection. The I2C bus must already be configured.

This function only creates the Device object, it does not touch the device.

func (*Device) Configure

func (d *Device) Configure(config Config) error

Configure sets up the device for communication

func (*Device) SetDCDC3

func (d *Device) SetDCDC3(State bool)

SetDCDC3 enables or disables DCDC3.

func (*Device) SetESPVoltage

func (d *Device) SetESPVoltage(voltage uint16)

SetESPVoltage sets voltage of ESP32.

func (*Device) SetLcdVoltage

func (d *Device) SetLcdVoltage(voltage uint16)

SetLcdVoltage sets voltage of LCD.

func (*Device) ToggleLED

func (d *Device) ToggleLED()

ToggleLED toggles LED connected to AXP192.

type Pin

type Pin struct {
	// contains filtered or unexported fields
}

Pin is a single pin on AXP192.

func (Pin) High

func (p Pin) High()

High sets this GPIO pin to high.

func (Pin) Low

func (p Pin) Low()

Low sets this GPIO pin to low.

func (Pin) Toggle

func (p Pin) Toggle()

Toggle switches an output pin from low to high or from high to low.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL