/** * @brief Se escribe el texto correspondiente a cada estado en la pantalla. * * @return - * * Se escribe en el FrameBuffer el texto que indica el estado. */ void DISPLAY_indicar_estado(int state) { char *texto; /*Variable que guarda el texto a escribir en cada caso*/ /* * Se coge el texto a escribir */ switch (state) { case 0: /*Estado "esperar"*/ texto = "en espera"; break; case 1: /*Estado "leyendo on"*/ texto = "leyendo on"; break; case 2: /*Estado "leyendo off"*/ texto = "leyendo off"; break; case 3: /*Estado "leyendo on 2"*/ texto = "leyendo on 2"; break; case 4: /*Estado "leyendo off 2"*/ texto = "leyendo off 2"; break; case 5: /*Estado "preguntar"*/ texto = " "; break; case 6: /*Estado "activado"*/ texto = "activado"; break; case 7: /*Estado "leyendo off 3"*/ texto = "leyendo off 3"; break; case 8: /*Estado "leyendo on 3"*/ texto = "leyendo on 3"; break; case 9: /*Estado "leyendo off 4"*/ texto = "leyendo off 4"; break; case 10: /*Estado "leyendo on 4"*/ texto = "leyendo on 4"; break; } /* * Se escribe en el framebuffer */ FRAME_BUFFER_change_text(texto, 1); FRAME_BUFFER_change_text(" ", 2); FRAME_BUFFER_change_text(" ", 3); FRAME_BUFFER_change_text(" ", 4); /* * Se vuelca en la pantalla */ FRAME_BUFFER_write_to_display(); }
/** * @brief Función para escribir en la pantalla * @par Lógica: * - Se inserta un texto en el buffer * - Se vuelca el buffer en el display * @param *puc Guarda el texto a escribir en pantalla * @param x Coordenada \e x donde debe escribirse el texto * @param y Coordenada \e y donde debe escribirse el texto * @return void * * Se inserta un texto en el buffer y se vuelca el buffer en el display * */ void DISPLAY_escribir_en_pantalla(unsigned char *puc, int x, int y){ //Variable donde se guardará el id de los elementos creados int identificador; identificador = FRAME_BUFFER_insert_text(puc, x, y); //Volcamos el buffer en la pantalla FRAME_BUFFER_write_to_display(); FRAME_BUFFER_delete_element(identificador); }
/** * @brief Escribe en pantalla la petición de seguimiento. * * @return - * * */ void DISPLAY_peticion_seguimiento() { /* * Se escriben la pregunta y las opciones en el framebuffer */ FRAME_BUFFER_change_text(" ", 1); FRAME_BUFFER_change_text("activar seguimiento?", 2); //id=2 FRAME_BUFFER_change_text("izq: desactivar", 3); //id=3 FRAME_BUFFER_change_text("dcha: activar", 4); //id=4 /* * Se vuelca a la pantalla */ FRAME_BUFFER_write_to_display(); }
/** * @brief Inicialización del display. * * @return - * * Se inicializa el Frame Buffer y se escribe en pantalla. */ void DISPLAY_inicializar() { /* * Se inicializa la pantalla y el framebuffer */ FRAME_BUFFER_init(); /* * Se escribe en el framebuffer */ FRAME_BUFFER_insert_text("Hello POPBL", 25, 1); //id=0 FRAME_BUFFER_insert_text(" ", 1, 10); //id=1 FRAME_BUFFER_insert_text(" ", 1, 20); //id=2 FRAME_BUFFER_insert_text(" ", 1, 30); //id=3 FRAME_BUFFER_insert_text(" ", 1, 40); //id=4 /* * Se vuelcan todos los elementos a la pantalla */ FRAME_BUFFER_write_to_display(); }