periph / host

Go·Hardware·Lean - Host drivers
https://periph.io
Apache License 2.0
53 stars 27 forks source link

allwinner: pull-up registers not set correctly #19

Closed TzeWey closed 1 year ago

TzeWey commented 1 year ago

Describe the bug While implementing Allwinner H5, it was discovered that the pull-up registers were not configured correctly.

To Reproduce Steps to reproduce the behavior:

  1. Run the program
    
    package main

import ( "periph.io/x/host/v3" )

func main() { host.Init() btn1 := gpioreg.ByName("PA13") btn1.In(gpio.PullUp, gpio.NoEdge)

btn2 := gpioreg.ByName("PA14") btn2.In(gpio.PullUp, gpio.NoEdge) }


2. Run it.
3. Check register at 0x01C2081C

**Expected behavior**
Expect 0x01C2081C to be 0x5000000

**Platform (please complete the following information):**
 - OS: Buildroot 2022.08.1
 - Board: NanoPi NEO Core2

**Additional context**
The issue appears to be caused by an implementation bug; will raise a pull request to resolve it.
maruel commented 1 year ago

Dang, thanks!