Skip to content

Commit

Permalink
Xiao BLE: High charge current (#33)
Browse files Browse the repository at this point in the history
* xiao-ble: high charge current

* build: store artifacts
  • Loading branch information
ysoldak authored Sep 12, 2023
1 parent bfb4f1a commit a441f17
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,10 @@ jobs:

- name: Build Nano 33 BLE binary
run: make TARGET=nano-33-ble-s140v6-uf2 build

- name: Store binaries
uses: actions/upload-artifact@v3
with:
name: binaries
path: build/*
retention-days: 14
7 changes: 7 additions & 0 deletions src/extras_nano-33-ble.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
//go:build nano_33_ble

package main

func initExtras() {
// nop
}
23 changes: 23 additions & 0 deletions src/extras_xiao-ble.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//go:build xiao_ble

// The battery charging current is selectable as 50mA or 100mA,
// where you can set Pin13 as high or low to change it to 50mA or 100mA.
//
// The low current charging current is at the input model set up as HIGH LEVEL
// and the high current charging current is at the output model set up as LOW LEVEL.
//
// In this project, we ensure the high current charging is enabled by default.
//
// See https://wiki.seeedstudio.com/XIAO_BLE/#battery-charging-current
package main

import "machine"

var (
pinChargeCurrent = machine.P0_13
)

func initExtras() {
pinChargeCurrent.Configure(machine.PinConfig{Mode: machine.PinOutput})
pinChargeCurrent.Low() // enable charging at high current, 100mA
}
1 change: 1 addition & 0 deletions src/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ func init() {

initLeds()
initPins()
initExtras()

// Orientation
o = orientation.New()
Expand Down

0 comments on commit a441f17

Please sign in to comment.