/* * Display_Init.c * * Created: Sun Mar 21 2021 12:52:01 * Author Chris */ #include "Display_SPI.h" #include "Display_Init.h" #include "Display_Config.h" // ============================================================================================ // Defines // ============================================================================================ // Variables // ============================================================================================ // Function Declarations /******************************************************************* Functions *******************************************************************/ void Display_Init_GPIOs(void) { // Initialize Reset- and DC-Pins as regular GPIOs gpio_init (DISPLAY_PIN_RESET); gpio_set_dir (DISPLAY_PIN_RESET, GPIO_OUT); gpio_set_slew_rate (DISPLAY_PIN_RESET, GPIO_SLEW_RATE_FAST); DISPLAY_RESET_OFF(); gpio_init (DISPLAY_PIN_COMMAND); gpio_set_dir (DISPLAY_PIN_COMMAND, GPIO_OUT); gpio_set_slew_rate (DISPLAY_PIN_COMMAND, GPIO_SLEW_RATE_FAST); DISPLAY_MODE_SET_DATA(); } void Display_Init_Reset(void) { sleep_ms(10); DISPLAY_RESET_ON(); sleep_ms(10); DISPLAY_RESET_OFF(); sleep_ms(10); Display_SPI_Start_Command(0x01); // Soft Reset (Valid for all Display types) Display_SPI_Finish_Command(); sleep_ms(150); } void Display_Init_WakeUp(void) { #ifdef DISPLAY_ILI9341 Display_SPI_Start_Command(ILI9341_CMD_SLEEP_OUT); Display_SPI_Finish_Command(); sleep_ms(150); uint8_t Data[2] = { 0, 0 }; Display_SPI_Start_Command(ILI9341_CMD_MEMORY_WRITE); for(int16_t r=0 ; r