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/lcd.c | |
parent | 9c8f5a5e8f11e4a5012d55b96afae290242b8fdd (diff) |
improved init process
Diffstat (limited to 'fw/fe310/eos/lcd.c')
-rw-r--r-- | fw/fe310/eos/lcd.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/fw/fe310/eos/lcd.c b/fw/fe310/eos/lcd.c index 86dd1e9..cf09018 100644 --- a/fw/fe310/eos/lcd.c +++ b/fw/fe310/eos/lcd.c @@ -5,7 +5,6 @@ #include "platform.h" #include "eos.h" -#include "power.h" #include "timer.h" #include "i2s.h" #include "net.h" @@ -33,13 +32,18 @@ int eos_lcd_select(void) { if (eos_spi_dev() != EOS_SPI_DEV_NET) return EOS_ERR_BUSY; eos_net_stop(); - GPIO_REG(GPIO_IOF_EN) &= ~SPI_IOF_MASK; + + GPIO_REG(GPIO_OUTPUT_VAL) &= ~(1 << LCD_PIN_CS); + + GPIO_REG(GPIO_INPUT_EN) &= ~(1 << LCD_PIN_CS); + GPIO_REG(GPIO_OUTPUT_EN) |= (1 << LCD_PIN_CS); + + GPIO_REG(GPIO_IOF_EN) &= ~SPI_IOF_MASK; return EOS_OK; } void eos_lcd_deselect(void) { - GPIO_REG(GPIO_OUTPUT_VAL) |= (1 << IOF_SPI1_MOSI); GPIO_REG(GPIO_IOF_EN) |= SPI_IOF_MASK; eos_net_start(); } |