diff options
author | Uros Majstorovic <majstor@majstor.org> | 2019-12-06 01:42:35 +0100 |
---|---|---|
committer | Uros Majstorovic <majstor@majstor.org> | 2019-12-06 01:42:35 +0100 |
commit | db165818cd02bac16ac70f5317f947c5f6aa20da (patch) | |
tree | aeaaebf23d560afef35b451f4df39c1783de0f0c /code/fe310/eos/net.c | |
parent | 5454acdb6e04aa454989b78a2f20be2c25740585 (diff) |
refactor gpio initialization
Diffstat (limited to 'code/fe310/eos/net.c')
-rw-r--r-- | code/fe310/eos/net.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/code/fe310/eos/net.c b/code/fe310/eos/net.c index 8f259db..9f19b4b 100644 --- a/code/fe310/eos/net.c +++ b/code/fe310/eos/net.c @@ -253,17 +253,21 @@ void eos_net_init(void) { } eos_evtq_set_handler(EOS_EVT_NET, net_handler_evt); - GPIO_REG(GPIO_OUTPUT_EN) &= ~(1 << NET_PIN_CTS); - GPIO_REG(GPIO_PULLUP_EN) |= (1 << NET_PIN_CTS); - GPIO_REG(GPIO_INPUT_EN) |= (1 << NET_PIN_CTS); - GPIO_REG(GPIO_RISE_IE) |= (1 << NET_PIN_CTS); + GPIO_REG(GPIO_INPUT_EN) |= (1 << NET_PIN_CTS); + GPIO_REG(GPIO_OUTPUT_EN) &= ~(1 << NET_PIN_CTS); + GPIO_REG(GPIO_PULLUP_EN) &= ~(1 << NET_PIN_CTS); + GPIO_REG(GPIO_OUTPUT_XOR) &= ~(1 << NET_PIN_CTS); + + GPIO_REG(GPIO_RISE_IE) |= (1 << NET_PIN_CTS); eos_intr_set(INT_GPIO_BASE + NET_PIN_CTS, IRQ_PRIORITY_NET_CTS, net_handler_cts); - GPIO_REG(GPIO_OUTPUT_EN) &= ~(1 << NET_PIN_RTS); - GPIO_REG(GPIO_PULLUP_EN) |= (1 << NET_PIN_RTS); - GPIO_REG(GPIO_INPUT_EN) |= (1 << NET_PIN_RTS); - GPIO_REG(GPIO_RISE_IE) |= (1 << NET_PIN_RTS); - GPIO_REG(GPIO_FALL_IE) |= (1 << NET_PIN_RTS); + GPIO_REG(GPIO_INPUT_EN) |= (1 << NET_PIN_RTS); + GPIO_REG(GPIO_OUTPUT_EN) &= ~(1 << NET_PIN_RTS); + GPIO_REG(GPIO_PULLUP_EN) &= ~(1 << NET_PIN_RTS); + GPIO_REG(GPIO_OUTPUT_XOR) &= ~(1 << NET_PIN_RTS); + + GPIO_REG(GPIO_RISE_IE) |= (1 << NET_PIN_RTS); + GPIO_REG(GPIO_FALL_IE) |= (1 << NET_PIN_RTS); eos_intr_set(INT_GPIO_BASE + NET_PIN_RTS, IRQ_PRIORITY_NET_RTS, net_handler_rts); } |