Skip to content

Instantly share code, notes, and snippets.

@9names
9names / main.S
Created January 11, 2021 05:32
Toggle GPIO11 (JTAG TDO) on BL602
# memory mapped register for gpio0/1 cfg. used as base for other registers
.set GPIO_CFGCTL0, 0x40000100
# memory mapped register for gpio10/11 cfg
.set GPIO_CFGCTL5_OFS, 0x14
# memory mapped register for GPIO output (whether GPIO is high or low)
.set GPIO_CFGCTL32_OFS, 0x88
# memory mapped register for GPIO output-enable (whether GPIO gets driven)
.set GPIO_CFGCTL34_OFS, 0x90
# config for two GPIO is stored in each CFG register, choose the appropriate one
# based on your GPIO number (ie GPIO11 is ODD, GPIO2 is EVEN)