diff options
author | Uros Majstorovic <majstor@majstor.org> | 2021-12-09 23:50:58 +0100 |
---|---|---|
committer | Uros Majstorovic <majstor@majstor.org> | 2021-12-09 23:50:58 +0100 |
commit | 7d03a941be6e9226e71cb5f5b4f7949e06bbfb02 (patch) | |
tree | cde9218dbe97837f972c426552c463f5f2a6a256 /fw/fe310/eos/spi.c | |
parent | 9c8f5a5e8f11e4a5012d55b96afae290242b8fdd (diff) |
improved init process
Diffstat (limited to 'fw/fe310/eos/spi.c')
-rw-r--r-- | fw/fe310/eos/spi.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/fw/fe310/eos/spi.c b/fw/fe310/eos/spi.c index 11a0703..05c9448 100644 --- a/fw/fe310/eos/spi.c +++ b/fw/fe310/eos/spi.c @@ -59,18 +59,12 @@ int eos_spi_init(uint8_t wakeup_cause) { GPIO_REG(GPIO_INPUT_EN) &= ~(1 << IOF_SPI1_SCK); GPIO_REG(GPIO_OUTPUT_EN) |= (1 << IOF_SPI1_SCK); - GPIO_REG(GPIO_PULLUP_EN) &= ~(1 << IOF_SPI1_SCK); - GPIO_REG(GPIO_OUTPUT_XOR) &= ~(1 << IOF_SPI1_SCK); GPIO_REG(GPIO_INPUT_EN) &= ~(1 << IOF_SPI1_MOSI); GPIO_REG(GPIO_OUTPUT_EN) |= (1 << IOF_SPI1_MOSI); - GPIO_REG(GPIO_PULLUP_EN) &= ~(1 << IOF_SPI1_MOSI); - GPIO_REG(GPIO_OUTPUT_XOR) &= ~(1 << IOF_SPI1_MOSI); GPIO_REG(GPIO_INPUT_EN) |= (1 << IOF_SPI1_MISO); GPIO_REG(GPIO_OUTPUT_EN) &= ~(1 << IOF_SPI1_MISO); - GPIO_REG(GPIO_PULLUP_EN) &= ~(1 << IOF_SPI1_MISO); - GPIO_REG(GPIO_OUTPUT_XOR) &= ~(1 << IOF_SPI1_MISO); SPI1_REG(SPI_REG_SCKMODE) = SPI_MODE0; SPI1_REG(SPI_REG_FMT) = SPI_FMT_PROTO(SPI_PROTO_S) | @@ -78,8 +72,8 @@ int eos_spi_init(uint8_t wakeup_cause) { SPI_FMT_DIR(SPI_DIR_RX) | SPI_FMT_LEN(8); - GPIO_REG(GPIO_IOF_SEL) &= ~SPI_IOF_MASK; - GPIO_REG(GPIO_IOF_EN) |= SPI_IOF_MASK; + GPIO_REG(GPIO_IOF_SEL) &= ~SPI_IOF_MASK; + GPIO_REG(GPIO_IOF_EN) |= SPI_IOF_MASK; // There is no way here to change the CS polarity. // SPI1_REG(SPI_REG_CSDEF) = 0xFFFF; |