axp192: add support for AXP192 single Cell Li-Battery and power system management IC

This commit is contained in:
sago35
2021-11-16 21:19:46 +09:00
committed by Ron Evans
parent 520234e9f8
commit 51c3aa271b
6 changed files with 573 additions and 2 deletions
@@ -0,0 +1,25 @@
package main
import (
"machine"
"time"
axp192 "tinygo.org/x/drivers/axp192/m5stack-core2-axp192"
"tinygo.org/x/drivers/i2csoft"
)
func main() {
i2c := i2csoft.New(machine.SCL0_PIN, machine.SDA0_PIN)
i2c.Configure(i2csoft.I2CConfig{Frequency: 100e3})
axp := axp192.New(i2c)
led := axp.LED
for {
led.Low()
time.Sleep(time.Millisecond * 500)
led.High()
time.Sleep(time.Millisecond * 500)
}
}