mem_write_pgm(REG::CMDB_WRITE,GT911_data,sizeof(GT911_data));/* write binary blob to command-fifo */
delay(10);
mem_write_8(REG::TOUCH_OVERSAMPLE,0x0F);/* setup oversample to 0x0f as "hidden" in binary-blob for AN_336 */
mem_write_16(REG::TOUCH_CONFIG,0x05d0);/* write magic cookie as requested by AN_336 */
/* specific to the EVE2 modules from Matrix-Orbital we have to use GPIO3 to reset GT911 */
mem_write_16(REG::GPIOX_DIR,0x8008);/* Reset-Value is 0x8000, adding 0x08 sets GPIO3 to output, default-value for REG_GPIOX is 0x8000 -> Low output on GPIO3 */
delay(1);/* wait more than 100µs */
mem_write_8(REG::CPURESET,0x00);/* clear all resets */
delay(56);/* wait more than 55ms */
mem_write_16(REG::GPIOX_DIR,0x8000);/* setting GPIO3 back to input */
#endif
mem_write_8(REG::PWM_DUTY,0);// turn off Backlight, Frequency already is set to 250Hz default
mem_write_8(REG::PWM_DUTY,0);// turn off Backlight, Frequency already is set to 250Hz default
/* Configure the FT8xx Registers */
/* Configure the FT8xx Registers */
@ -1140,13 +1151,13 @@ void CLCD::init() {
if(GPIO_1_Audio_Shutdown){
if(GPIO_1_Audio_Shutdown){
mem_write_8(REG::GPIO_DIR,GPIO_DISP|GPIO_GP1);
mem_write_8(REG::GPIO_DIR,GPIO_DISP|GPIO_GP1);
mem_write_8(REG::GPIO,GPIO_DISP|GPIO_GP1);
mem_write_8(REG::GPIO,GPIO_DISP|GPIO_GP1);
}elseif(GPIO_0_Audio_Enable){
}
elseif(GPIO_0_Audio_Enable){
mem_write_8(REG::GPIO_DIR,GPIO_DISP|GPIO_GP0);
mem_write_8(REG::GPIO_DIR,GPIO_DISP|GPIO_GP0);
mem_write_8(REG::GPIO,GPIO_DISP|GPIO_GP0);
mem_write_8(REG::GPIO,GPIO_DISP|GPIO_GP0);
}
}
else{
else
mem_write_8(REG::GPIO,GPIO_DISP);/* REG::GPIO_DIR is set to output for GPIO_DISP by default */
mem_write_8(REG::GPIO,GPIO_DISP);/* REG::GPIO_DIR is set to output for GPIO_DISP by default */
}
mem_write_8(REG::PCLK,Pclk);// Turns on Clock by setting PCLK Register to the value necessary for the module
mem_write_8(REG::PCLK,Pclk);// Turns on Clock by setting PCLK Register to the value necessary for the module