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: 1 Imported by: 0

Documentation

Overview

Package axp192 provides a driver for the axp192 I2C Enhanced single Cell Li-Battery and Power System Management IC.

http://www.x-powers.com/en.php/Info/product_detail/article_id/29 Datasheet: https://github.com/m5stack/M5-Schematic/blob/master/Core/AXP192%20Datasheet_v1.1_en_draft_2211.pdf

Index

Constants

View Source
const (
	// Address is default I2C address.
	Address = 0x34

	RegPowerSupplyStatus            = 0x00
	RegDCDC13LDO23Switch            = 0x12
	RegVbusIPSOutAccessManagement   = 0x30
	RegBackupBatteryChargingControl = 0x35
	RegDCDC2VoltageSet              = 0x25
	RegDCDC1VoltageSet              = 0x26
	RegDCDC3VoltageSet              = 0x27
	RegLDO23VoltageSet              = 0x28
	RegPEKParameterSet              = 0x36
	RegADCEnableSet                 = 0x82

	RegGPIO1Control          = 0x92
	RegGPIO2Control          = 0x93
	RegGPIO20SignalStatus    = 0x94
	RegGPIO43FunctionControl = 0x95
	RegGPIO43SignalStatus    = 0x96
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
}

type Device

type Device struct {
	Address uint8
	// contains filtered or unexported fields
}

func New

func New(i2c drivers.I2C) *Device

New returns AXP192 device for the provided I2C bus using default address.

func (*Device) Configure

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

Configure the AXP192 device.

func (*Device) GetADCEnableSet

func (d *Device) GetADCEnableSet() uint8

GetADCEnableSet gets ADC enable 1.

func (*Device) GetBackupBatteryChargingControl

func (d *Device) GetBackupBatteryChargingControl() uint8

GetBackupBatteryChargingControl gets backup battery charge control.

func (*Device) GetDCDC13LDO23Switch

func (d *Device) GetDCDC13LDO23Switch() uint8

GetDCDC13LDO23Switch gets DC-DC1/3 & LOD2/3 output control.

func (*Device) GetDCDC1VoltageSet

func (d *Device) GetDCDC1VoltageSet() uint8

GetDCDC1VoltageSet gets DC-DC1 output voltage.

func (*Device) GetDCDC2VoltageSet

func (d *Device) GetDCDC2VoltageSet() uint8

GetDCDC2VoltageSet gets DC-DC2 dynamic voltage parameter.

func (*Device) GetDCDC3VoltageSet

func (d *Device) GetDCDC3VoltageSet() uint8

GetDCDC3VoltageSet gets DC-DC3 output voltage.

func (*Device) GetGPIO1Control

func (d *Device) GetGPIO1Control() uint8

GetGPIO1Control gets GPIO1 function.

func (*Device) GetGPIO20SignalStatus

func (d *Device) GetGPIO20SignalStatus() uint8

GetGPIO20SignalStatus gets GPIO[2:0] signal status.

func (*Device) GetGPIO2Control

func (d *Device) GetGPIO2Control() uint8

GetGPIO2Control gets GPIO2 function.

func (*Device) GetGPIO43FunctionControl

func (d *Device) GetGPIO43FunctionControl() uint8

GetGPIO43FunctionControl gets GPIO[4:3] pin function.

func (*Device) GetGPIO43SignalStatus

func (d *Device) GetGPIO43SignalStatus() uint8

GetGPIO43SignalStatus gets GPIO[4:3] signal status.

func (*Device) GetLDO23VoltageSet

func (d *Device) GetLDO23VoltageSet() uint8

GetLDO23VoltageSet gets LDO2/3 output voltage.

func (*Device) GetPEKParameterSet

func (d *Device) GetPEKParameterSet() uint8

GetPEKParameterSet gets PEK press key parameter.

func (*Device) GetVbusIPSOutAccessManagement

func (d *Device) GetVbusIPSOutAccessManagement() uint8

GetVbusIPSOutAccessManagement gets VBUS-IPSOUT access management.

func (*Device) ReadPowerSupplyStatus

func (d *Device) ReadPowerSupplyStatus() uint8

ReadPowerSupplyStatus reads power supply status.

func (*Device) SetADCEnableSet

func (d *Device) SetADCEnableSet(a uint8)

SetADCEnableSet sets ADC enable 1.

func (*Device) SetBackupBatteryChargingControl

func (d *Device) SetBackupBatteryChargingControl(a uint8)

SetBackupBatteryChargingControl sets backup battery charge control.

func (*Device) SetDCDC13LDO23Switch

func (d *Device) SetDCDC13LDO23Switch(a uint8)

SetDCDC13LDO23Switch sets DC-DC1/3 & LOD2/3 output control.

func (*Device) SetDCDC1VoltageSet

func (d *Device) SetDCDC1VoltageSet(a uint8)

SetDCDC1VoltageSet sets DC-DC1 output voltage.

func (*Device) SetDCDC2VoltageSet

func (d *Device) SetDCDC2VoltageSet(a uint8)

SetDCDC2VoltageSet sets DC-DC2 dynamic voltage parameter.

func (*Device) SetDCDC3VoltageSet

func (d *Device) SetDCDC3VoltageSet(a uint8)

SetDCDC3VoltageSet sets DC-DC3 output voltage.

func (*Device) SetDCVoltage

func (d *Device) SetDCVoltage(number uint8, voltage uint16)

SetDCVoltage sets DC voltage.

func (*Device) SetGPIO1Control

func (d *Device) SetGPIO1Control(a uint8)

SetGPIO1Control sets GPIO1 function.

func (*Device) SetGPIO20SignalStatus

func (d *Device) SetGPIO20SignalStatus(a uint8)

SetGPIO20SignalStatus sets GPIO[2:0] signal status.

func (*Device) SetGPIO2Control

func (d *Device) SetGPIO2Control(a uint8)

SetGPIO2Control sets GPIO2 function.

func (*Device) SetGPIO43FunctionControl

func (d *Device) SetGPIO43FunctionControl(a uint8)

SetGPIO43FunctionControl sets GPIO[4:3] pin function.

func (*Device) SetGPIO43SignalStatus

func (d *Device) SetGPIO43SignalStatus(a uint8)

SetGPIO43SignalStatus sets GPIO[4:3] signal status.

func (*Device) SetLDO23VoltageSet

func (d *Device) SetLDO23VoltageSet(a uint8)

SetLDO23VoltageSet sets LDO2/3 output voltage.

func (*Device) SetLDOEnable

func (d *Device) SetLDOEnable(number uint8, state bool)

SetLDOEnable enable LDO.

func (*Device) SetLDOVoltage

func (d *Device) SetLDOVoltage(number uint8, voltage uint16)

SetLDOVoltage sets LDO voltage.

func (*Device) SetPEKParameterSet

func (d *Device) SetPEKParameterSet(a uint8)

SetPEKParameterSet sets PEK press key parameter.

func (*Device) SetVbusIPSOutAccessManagement

func (d *Device) SetVbusIPSOutAccessManagement(a uint8)

SetVbusIPSOutAccessManagement sets VBUS-IPSOUT access management.

type Error

type Error uint8
const (
	ErrInvalidID Error = 0x1
)

func (Error) Error

func (e Error) Error() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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