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/spi.c | |
parent | 5454acdb6e04aa454989b78a2f20be2c25740585 (diff) |
refactor gpio initialization
Diffstat (limited to 'code/fe310/eos/spi.c')
-rw-r--r-- | code/fe310/eos/spi.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/code/fe310/eos/spi.c b/code/fe310/eos/spi.c index 0c9a38c..56ef318 100644 --- a/code/fe310/eos/spi.c +++ b/code/fe310/eos/spi.c @@ -60,10 +60,11 @@ static void spi_xchg_wait(void) { } void eos_spi_init(void) { - GPIO_REG(GPIO_OUTPUT_VAL) |= (1 << SPI_CS_PIN_CAM); GPIO_REG(GPIO_INPUT_EN) &= ~(1 << SPI_CS_PIN_CAM); GPIO_REG(GPIO_OUTPUT_EN) |= (1 << SPI_CS_PIN_CAM); + GPIO_REG(GPIO_PULLUP_EN) &= ~(1 << SPI_CS_PIN_CAM); GPIO_REG(GPIO_OUTPUT_XOR) &= ~(1 << SPI_CS_PIN_CAM); + GPIO_REG(GPIO_OUTPUT_VAL) |= (1 << SPI_CS_PIN_CAM); SPI1_REG(SPI_REG_SCKMODE) = SPI_MODE0; SPI1_REG(SPI_REG_FMT) = SPI_FMT_PROTO(SPI_PROTO_S) | |