"High Performance" & "Easy To Use" library for 7-Segment display in AVR - ARM Cortex M
- Init()
- PinConfig()
- Sync()
- SyncLoop()
- DisplayOff()
- DisplayOn()
- Shift()
- Clear()
- Show()
- ShowASync()
- _ENABLE_CUSTOM_PIN
using namespace Display;
-
Config type:
using namespace Display; SSegmentCfg_TypeDef
-
Parameters:
- ControlGPIO = Connected GPIO for enable PINs
- ControlPinA = Segment 1 enable pin
- DataGPIO = Connected GPIO for data PINs (A ~ F with dot point)
- DataPinA = Data PIN A
- Type = Type of Segments (CommonCathode / CommonAnode)
-
Example:
using namespace Display; SSegmentCfg_TypeDef disp_cfg; disp_cfg.ControlGPIO = GPIOA; disp_cfg.ControlPinA = 1; disp_cfg.DataGPIO = GPIOA; disp_cfg.DataPinA = 5; disp_cfg.Type = CommonAnode;
-
-
Object Initializer:
SSegment(uint8_t _nmb_of_segments, uint8_t _refresh_rate, uint8_t _buffer_length);
-
Parameters:
- _nmb_of_segments : Number of connected segments (uint8 value - Max 255)
- _refresh_rate : Display refresh rate (uint8 value - Max 255)
- _buffer_length : Buffer length of data (uint8 value - Max 255)
-
Example:
SSegment MainDisplay(4, 50, 8); MainDisplay.Init(disp_cfg); // disp_cfg Is from the previous step
-
-
-
Object Initializer:
SSegment(SSegmentCfg_TypeDef _cfg, uint8_t _nmb_of_segments, uint8_t _refresh_rate, uint8_t _buffer_length);
-
Parameters:
- _cfg : Configuration of segments (SSegmentCfg_TypeDef type)
- _nmb_of_segments : Number of connected segments (uint8 value - Max 255)
- _refresh_rate : Display refresh rate (uint8 value - Max 255)
- _buffer_length : Buffer length of data (uint8 value - Max 255)
-
Example:
SSegment MainDisplay(disp_cfg, 4, 50, 8); MainDisplay.Init(disp_cfg); // disp_cfg Is from the previous step
-
-
void Timer_Interrupt(void) { MainDisplay.Sync(); }
-
int main() { //Your codes while(1) { MainDisplay.SyncLoop(); } }
int main()
{
//Your codes
MainDisplay.Clear();
MainDisplay.Show("Hello");
while(1)
{
MainDisplay.SyncLoop();
}
}
- Run on AVR
- Run on STM32 Fx cores