Not all pins default to GPIO. Setting func_sel to 3 enables GPIO for
each pin. Do this.
This commit is contained in:
parent
16f680544c
commit
d247a613b7
|
@ -1,4 +1,8 @@
|
||||||
#define MBAR_GPIO 0x80000000
|
#define MBAR_GPIO 0x80000000
|
||||||
|
#define GPIO_FUNC_SEL0 0x80000018 /* GPIO 15 - 0; 2 bit blocks */
|
||||||
|
#define GPIO_FUNC_SEL1 0x8000001c
|
||||||
|
#define GPIO_FUNC_SEL2 0x80000020
|
||||||
|
#define GPIO_FUNC_SEL3 0x80000024
|
||||||
#define GPIO_PAD_DIR0 0x80000000
|
#define GPIO_PAD_DIR0 0x80000000
|
||||||
#define GPIO_DATA0 0x80000008
|
#define GPIO_DATA0 0x80000008
|
||||||
#define GPIO_PAD_DIR1 0x80000004
|
#define GPIO_PAD_DIR1 0x80000004
|
||||||
|
@ -15,6 +19,11 @@
|
||||||
__attribute__ ((section ("startup")))
|
__attribute__ ((section ("startup")))
|
||||||
void main(void) {
|
void main(void) {
|
||||||
|
|
||||||
|
*(volatile uint32_t *)GPIO_FUNC_SEL0 = 0xffffffff;
|
||||||
|
*(volatile uint32_t *)GPIO_FUNC_SEL1 = 0xffffffff;
|
||||||
|
*(volatile uint32_t *)GPIO_FUNC_SEL2 = 0xffffffff;
|
||||||
|
*(volatile uint32_t *)GPIO_FUNC_SEL3 = 0xffffffff;
|
||||||
|
|
||||||
*(volatile uint32_t *)GPIO_PAD_DIR0 = 0xffffffff;
|
*(volatile uint32_t *)GPIO_PAD_DIR0 = 0xffffffff;
|
||||||
*(volatile uint32_t *)GPIO_PAD_DIR1 = 0xffffffff;
|
*(volatile uint32_t *)GPIO_PAD_DIR1 = 0xffffffff;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue