DMD.h
Go to the documentation of this file.
1 // SPDX-License-Identifier: Beerware
2 /**
3  * @file DMD.h
4  * @ingroup DMD
5  * @brief Dot Matrix Display driver
6  */
7 #pragma once
8 
9 #include <stdint.h>
10 #include "MCAL.h"
11 
12 #ifndef DMD_OE_Pin
13  #define DMD_OE_Pin GPIO_PIN_2 ///< DMD OE pin
14 #endif
15 #ifndef DMD_SCLK_Pin
16  #define DMD_SCLK_Pin GPIO_PIN_3 ///< DMD SCLK pin
17 #endif
18 #ifndef DMD_A_Pin
19  #define DMD_A_Pin GPIO_PIN_1 ///< DMD A pin
20 #endif
21 #ifndef DMD_B_Pin
22  #define DMD_B_Pin GPIO_PIN_0 ///< DMD B pin
23 #endif
24 #ifndef DMD_GPIO_Port
25  #define DMD_GPIO_Port GPIO_PORT_A ///< DMD GPIO port
26 #endif
27 
28 /**
29  * @enum DMDRows
30  * @brief Dot Matrix Display rows
31  */
32 typedef enum
33 {
34  DMD_ROWS_1_5_9_13 = 0, ///< DMD rows 1, 5, 9 and 13
35  DMD_ROWS_2_6_10_14, ///< DMD rows 2, 6, 10 and 14
36  DMD_ROWS_3_7_11_15, ///< DMD rows 3, 7, 11 and 15
37  DMD_ROWS_4_8_12_16 ///< DMD rows 4, 8, 12 and 16
38 
39 } DMDRows;
40 
41 void DMD_Latch(void);
42 void DMD_LightRows(DMDRows eRows);
43 void DMD_OE_RowsOff(void);
44 void DMD_OE_RowsOn(void);
45 void DMD_SetBuffer(uint8_t* pucBuffer);
46 void DMD_Update(void);
@ DMD_ROWS_2_6_10_14
DMD rows 2, 6, 10 and 14.
Definition: DMD.h:35
void DMD_OE_RowsOff(void)
Set OE pin low; all rows off.
Definition: DMD.c:73
DMDRows
Dot Matrix Display rows.
Definition: DMD.h:32
Microcontroller Abstraction Layer.
@ DMD_ROWS_4_8_12_16
DMD rows 4, 8, 12 and 16.
Definition: DMD.h:37
@ DMD_ROWS_3_7_11_15
DMD rows 3, 7, 11 and 15.
Definition: DMD.h:36
void DMD_Update(void)
Update dot matrix display.
Definition: DMD.c:100
void DMD_SetBuffer(uint8_t *pucBuffer)
Set DMD image buffer.
Definition: DMD.c:91
void DMD_OE_RowsOn(void)
Set OE pin high; all rows on.
Definition: DMD.c:81
void DMD_Latch(void)
Latch shift register data to output.
Definition: DMD.c:35
@ DMD_ROWS_1_5_9_13
DMD rows 1, 5, 9 and 13.
Definition: DMD.h:34
void DMD_LightRows(DMDRows eRows)
Light up row group.
Definition: DMD.c:47