-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathledDisplay.h
83 lines (62 loc) · 2.79 KB
/
ledDisplay.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#ifndef _LEDDISPLAY_H_
#define _LEDDISPLAY_H_
#include "systemLib.h"
// REFRESCO DISPLAY
#define TIMEOUT_COLUMNA_DISPLAY 15
#define NUM_COLUMNAS_DISPLAY 8
#define NUM_FILAS_DISPLAY 7
// FLAGS FSM CONTROL DE EXCITACION DISPLAY
// ATENCION: Valores a modificar por el alumno
#define FLAG_TIMEOUT_COLUMNA_DISPLAY 0x01
enum estados_excitacion_display_fsm {
DISPLAY_ESPERA_COLUMNA
};
enum columnas_display{
COLUMNA_DISPLAY_1,
COLUMNA_DISPLAY_2,
COLUMNA_DISPLAY_3,
COLUMNA_DISPLAY_4,
COLUMNA_DISPLAY_5,
COLUMNA_DISPLAY_6,
COLUMNA_DISPLAY_7,
COLUMNA_DISPLAY_8,
};
typedef struct {
int matriz[NUM_COLUMNAS_DISPLAY][NUM_FILAS_DISPLAY];
} tipo_pantalla;
typedef struct {
int columnas[NUM_COLUMNAS_DISPLAY]; // Array con los valores BCM de los pines GPIO empleados para cada columna
int filas[NUM_FILAS_DISPLAY]; // Array con los valores BCM de los pines GPIO empleados para cada fila
int columna_actual; // Variable que almacena el valor de la columna que esta activa
tipo_pantalla pantalla; // Objeto que almacena el estado encendido o apagado de cada uno de los leds de la matriz
tmr_t* tmr_refresco_display; // Temporizador responsable de medir el tiempo de activacion de cada columna
int flags; // Variable para gestion de flags especificamente ligados a la gestion del display
} TipoLedDisplay;
extern TipoLedDisplay led_display;
extern tipo_pantalla pantalla_inicial;
extern tipo_pantalla pantalla_final;
extern fsm_trans_t fsm_trans_excitacion_display[];
//------------------------------------------------------
// PROCEDIMIENTOS DE INICIALIZACION DE LOS OBJETOS ESPECIFICOS
//------------------------------------------------------
void InicializaLedDisplay (TipoLedDisplay *led_display);
//------------------------------------------------------
// OTROS PROCEDIMIENTOS PROPIOS DE LA LIBRERIA
//------------------------------------------------------
void ApagaFilas (TipoLedDisplay *led_display);
void ExcitaColumnas (int columna);
void ActualizaLedDisplay (TipoLedDisplay *led_display);
void PintaPantallaPorTerminal (tipo_pantalla *p_pantalla);
//------------------------------------------------------
// FUNCIONES DE ENTRADA O DE TRANSICION DE LA MAQUINA DE ESTADOS
//------------------------------------------------------
int CompruebaTimeoutColumnaDisplay (fsm_t* this);
//------------------------------------------------------
// FUNCIONES DE SALIDA O DE ACCION DE LA MAQUINA DE ESTADOS
//------------------------------------------------------
void ActualizaExcitacionDisplay (fsm_t* this);
//------------------------------------------------------
// SUBRUTINAS DE ATENCION A LAS INTERRUPCIONES
//------------------------------------------------------
void timer_refresco_display_isr (union sigval value);
#endif /* _LEDDISPLAY_H_ */