AceSegment  0.7.0
A framework for rendering seven segment LED displays using the TM1637, MAX7219, HT16K33, or 74HC595 controller chips
DirectFast4Module.h
1 /*
2 MIT License
3 
4 Copyright (c) 2021 Brian T. Park
5 
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to deal
8 in the Software without restriction, including without limitation the rights
9 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12 
13 The above copyright notice and this permission notice shall be included in all
14 copies or substantial portions of the Software.
15 
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 SOFTWARE.
23 */
24 
25 #ifndef ACE_SEGMENT_DIRECT_FAST_4_MODULE_H
26 #define ACE_SEGMENT_DIRECT_FAST_4_MODULE_H
27 
28 #include <stdint.h>
29 #include "../scanning/ScanningModule.h"
30 #include "../scanning/LedMatrixDirectFast4.h"
31 
32 namespace ace_segment {
33 
52 template <
53  uint8_t e0, uint8_t e1, uint8_t e2, uint8_t e3,
54  uint8_t e4, uint8_t e5, uint8_t e6, uint8_t e7,
55  uint8_t g0, uint8_t g1, uint8_t g2, uint8_t g3,
56  uint8_t T_DIGITS,
57  uint8_t T_SUBFIELDS = 1,
58  typename T_CI = ClockInterface
59 >
61  LedMatrixDirectFast4<e0, e1, e2, e3, e4, e5, e6, e7, g0, g1, g2, g3>,
62  T_DIGITS,
63  T_SUBFIELDS,
64  T_CI
65 > {
66  private:
67  using Super = ScanningModule<
68  LedMatrixDirectFast4<e0, e1, e2, e3, e4, e5, e6, e7, g0, g1, g2, g3>,
69  T_DIGITS,
70  T_SUBFIELDS,
71  T_CI
72  >;
73 
74  public:
76  uint8_t segmentOnPattern,
77  uint8_t digitOnPattern,
78  uint8_t framesPerSecond
79  ) :
80  Super(mLedMatrix, framesPerSecond),
81  mLedMatrix(
82  segmentOnPattern /*elementOnPattern*/,
83  digitOnPattern /*groupOnPattern*/
84  )
85  {}
86 
87  void begin() {
88  mLedMatrix.begin();
89  Super::begin();
90  }
91 
92  void end() {
93  mLedMatrix.end();
94  Super::end();
95  }
96 
97  private:
98  LedMatrixDirectFast4<e0, e1, e2, e3, e4, e5, e6, e7, g0, g1, g2, g3>
99  mLedMatrix;
100 };
101 
102 } // ace_segment
103 
104 #endif
ace_segment::ScanningModule::end
void end()
A no-op end() function for consistency with other classes.
Definition: ScanningModule.h:128
ace_segment::DirectFast4Module
An implementation of LedModule whose segment and digit pins are directly connected to the GPIO pins o...
Definition: DirectFast4Module.h:60
ace_segment::ScanningModule
An implementation of LedModule for display modules which do not have hardware controller chips,...
Definition: ScanningModule.h:80
ace_segment::ScanningModule::begin
void begin()
Configure the driver with the parameters given by in the constructor.
Definition: ScanningModule.h:108