/** * @brief Tearing Effect DSI callback. * @param hdsi: pointer to a DSI_HandleTypeDef structure that contains * the configuration information for the DSI. * @retval None */ void HAL_DSI_TearingEffectCallback(DSI_HandleTypeDef *hdsi) { /* Mask the TE */ HAL_DSI_ShortWrite(hdsi, 0, DSI_DCS_SHORT_PKT_WRITE_P1, OTM8009A_CMD_TEOFF, 0x00); /* Refresh the right part of the display */ HAL_DSI_Refresh(hdsi); }
/** * @brief End of Refresh DSI callback. * @param hdsi: pointer to a DSI_HandleTypeDef structure that contains * the configuration information for the DSI. * @retval None */ void HAL_DSI_EndOfRefreshCallback(DSI_HandleTypeDef *hdsi) { if(pending_buffer >= 0) { if(active_area == LEFT_AREA) { /* Mask the TE */ HAL_DSI_ShortWrite(hdsi, 0, DSI_DCS_SHORT_PKT_WRITE_P1, OTM8009A_CMD_TEOFF, 0x00); /* Disable DSI Wrapper */ __HAL_DSI_WRAPPER_DISABLE(&hdsi_eval); /* Update LTDC configuaration */ LTDC_LAYER(&hltdc_eval, 0)->CFBAR = LAYER0_ADDRESS + 400 * 4; __HAL_LTDC_RELOAD_CONFIG(&hltdc_eval); /* Enable DSI Wrapper */ __HAL_DSI_WRAPPER_ENABLE(&hdsi_eval); HAL_DSI_LongWrite(hdsi, 0, DSI_DCS_LONG_PKT_WRITE, 4, OTM8009A_CMD_CASET, pColRight); /* Refresh the right part of the display */ HAL_DSI_Refresh(hdsi); } else if(active_area == RIGHT_AREA) { /* Disable DSI Wrapper */ __HAL_DSI_WRAPPER_DISABLE(&hdsi_eval); /* Update LTDC configuaration */ LTDC_LAYER(&hltdc_eval, 0)->CFBAR = LAYER0_ADDRESS; __HAL_LTDC_RELOAD_CONFIG(&hltdc_eval); /* Enable DSI Wrapper */ __HAL_DSI_WRAPPER_ENABLE(&hdsi_eval); HAL_DSI_LongWrite(hdsi, 0, DSI_DCS_LONG_PKT_WRITE, 4, OTM8009A_CMD_CASET, pColLeft); pending_buffer = -1; } } active_area = (active_area == LEFT_AREA)? RIGHT_AREA : LEFT_AREA; }