https://open-source-silicon.dev logo
Title
j

James A

04/14/2022, 7:59 AM
@User and @User you might also have some insight on this - depending on the method used to initialize the pins. For this example, we want to set pins[8] - [18] as inputs and [19] - [27] as outputs and would expect pseudo code like this:
li s3, 0x0402
    // 8 to 18 inputs
    sw s3, IOCONF_OFS(8)
    // … <9 to 17>
    sw s3, IOCONF_OFS(18)

    li s3, 0x1808
    // 19 to 27 outputs
    sw s3, IOCONF_OFS(19)
    // … <10 to 26>
    sw s3, IOCONF_OFS(27)
Can you help explain the bit shifting needed in the actual sources?