[lcd] add support for operating on virtual framebuffers
Current implementation contains full support for: - transparent switching between direct and framebuffer rendering modes - writing characters to framebuffers - loading frame from memory to physical display As well as partial support for instruction writes including: - resetting the display (clears memory, sets cursor at 0:0, switches to increment mode) - switching between increment/decrement modes - setting cursor position
This commit is contained in:
+24
-2
@@ -30,7 +30,6 @@
|
||||
#include "CS43L22.h"
|
||||
#include "SST25VF016B.h"
|
||||
#include "LIS302DL.h"
|
||||
#include "DHT11.h"
|
||||
#include "MP45DT02.h"
|
||||
#include "LSM9DS1.h"
|
||||
|
||||
@@ -65,6 +64,8 @@ SPI_HandleTypeDef hspi1;
|
||||
|
||||
TIM_HandleTypeDef htim2;
|
||||
|
||||
extern size_t display_current_frame;
|
||||
|
||||
/* USER CODE BEGIN PV */
|
||||
|
||||
void ((*executors[])(void)) = {
|
||||
@@ -305,10 +306,30 @@ int main(void)
|
||||
GPIOD->ODR = 0xF000;
|
||||
button_init_and_test();
|
||||
|
||||
// perform all tests
|
||||
display_to_framebuffer();
|
||||
|
||||
for (display_current_frame = 0; display_current_frame < 11; display_current_frame++)
|
||||
{
|
||||
executors[display_current_frame]();
|
||||
}
|
||||
|
||||
display_to_direct();
|
||||
display_current_frame = 0;
|
||||
|
||||
while (1) {
|
||||
display_load(display_current_frame);
|
||||
display_current_frame++;
|
||||
display_current_frame %= 11;
|
||||
HAL_Delay(1000);
|
||||
}
|
||||
|
||||
/* USER CODE END 2 */
|
||||
|
||||
/* Infinite loop */
|
||||
/* USER CODE BEGIN WHILE */
|
||||
|
||||
/*
|
||||
while (1)
|
||||
{
|
||||
if (delay_between_runs[current_executor_id] == -1 && buttons_interrupt_enabled)
|
||||
@@ -334,10 +355,11 @@ int main(void)
|
||||
} else {
|
||||
HAL_Delay(delay_between_runs[current_executor_id]);
|
||||
}
|
||||
*/
|
||||
/* USER CODE END WHILE */
|
||||
|
||||
/* USER CODE BEGIN 3 */
|
||||
}
|
||||
//}
|
||||
/* USER CODE END 3 */
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user