Version 1.1
This commit is contained in:
34
Core/Inc/DS_Button.h
Normal file
34
Core/Inc/DS_Button.h
Normal file
@@ -0,0 +1,34 @@
|
||||
#ifndef DS_BUTTON_H
|
||||
#define DS_BUTTON_H
|
||||
|
||||
#include "stm32f0xx_hal.h"
|
||||
#include <stdbool.h>
|
||||
|
||||
typedef struct DS_Button
|
||||
{
|
||||
GPIO_TypeDef* Port;
|
||||
uint16_t Pin;
|
||||
bool Pressed, Released, PressedLong, PressedLongLong;
|
||||
uint32_t PrevTick, PressStartTick, PressStartTickLong;
|
||||
uint8_t Storage;
|
||||
|
||||
bool FallingEdge, RisingEdge;
|
||||
}DS_Button;
|
||||
|
||||
void DS_ButtonInit(DS_Button* Button, GPIO_TypeDef* Port, uint16_t Pin);
|
||||
|
||||
void DS_ButtonUpdate(DS_Button* Button);
|
||||
|
||||
bool DS_ButtonPressed(DS_Button* Button);
|
||||
|
||||
bool DS_ButtonReleased(DS_Button* Button);
|
||||
|
||||
bool DS_Button_PressedLong(DS_Button* Button);
|
||||
|
||||
bool DS_Button_PressedLongLong(DS_Button* Button);
|
||||
|
||||
bool DS_ButtonRisingEdge(DS_Button* Button);
|
||||
|
||||
bool DS_ButtonFallingEdge(DS_Button* Button);
|
||||
|
||||
#endif //DS_BUTTON_H
|
||||
35
Core/Inc/DS_MAX7219.h
Normal file
35
Core/Inc/DS_MAX7219.h
Normal file
@@ -0,0 +1,35 @@
|
||||
#ifndef DS_MAX7219_H
|
||||
#define DS_MAX7219_H
|
||||
|
||||
#include "stm32f0xx_hal.h"
|
||||
#include "stdbool.h"
|
||||
|
||||
typedef struct DS_MAX7219
|
||||
{
|
||||
SPI_HandleTypeDef* SPI;
|
||||
char DisplaData[8];
|
||||
uint8_t Dots;
|
||||
uint8_t DecodeMode, Intensivity, ScanLimit;
|
||||
bool EnableDecodeMode;
|
||||
GPIO_TypeDef* PORT_CS;
|
||||
uint16_t Pin_CS;
|
||||
}DS_MAX7219;
|
||||
|
||||
|
||||
void DS_MAX7219_Init(DS_MAX7219* Display, SPI_HandleTypeDef* SPI, GPIO_TypeDef* PORT_CS, uint16_t Pin_CS);
|
||||
|
||||
void DS_MAX7219_EnableDots(DS_MAX7219* Display);
|
||||
|
||||
void DS_MAX7219_UpdateDisplay(DS_MAX7219* Display);
|
||||
|
||||
void DS_MAX7219_ConfigureDisplay(DS_MAX7219* Display, uint8_t DecodeMode, uint8_t Intensivity, uint8_t ScanLimit);
|
||||
|
||||
void DS_MAX7219_Print(DS_MAX7219* Display, int64_t Number);
|
||||
|
||||
void __DS_MAX7219_SendConfigData(DS_MAX7219* Display);
|
||||
|
||||
uint8_t __DS_MAX7219_ConvertSymbol(char Symbol);
|
||||
|
||||
|
||||
|
||||
#endif// DS_MAX7219_H
|
||||
Reference in New Issue
Block a user