-
Notifications
You must be signed in to change notification settings - Fork 0
Library documentation
The hereby documented library includes 4ilo/HD44780-Stm32HAL library intended for handling the LCD display functionality.
The hereby documented library includes lcdkpd4stm32f401 library for handling the LCD shield keyboard functinality. The files contained in this project (provided in the appropriate folder) were modified to suit the STM32F1 family microcontroller used in this application.
// Weekdays labels (modify as needed)
// NOTE: The labels must contain 3 characters only
#define MONDAY_TEXT "Mon"
#define TUESDAY_TEXT "Tue"
#define WEDNESDAY_TEXT "Wed"
#define THURSDAY_TEXT "Thu"
#define FRIDAY_TEXT "Fri"
#define SATURDAY_TEXT "Sat"
#define SUNDAY_TEXT "Sun"The definitions above are related to the labels referring to the weekdays for displaying in the according date format. Users should replace them if needed, depending on the language used with the digital clock.
// Month labels (modify as needed)
// NOTE: The labels must contain 3 characters only
#define JANUARY_TEXT "Jan"
#define FEBRUARY_TEXT "Feb"
#define MARCH_TEXT "Mar"
#define APRIL_TEXT "Apr"
#define MAY_TEXT "May"
#define JUNE_TEXT "Jun"
#define JULY_TEXT "Jul"
#define AUGUST_TEXT "Aug"
#define SEPTEMBER_TEXT "Sep"
#define OCTOBER_TEXT "Oct"
#define NOVEMBER_TEXT "Nov"
#define DECEMBER_TEXT "Dec"The definitions above are related to the labels referring to the months for displaying in the according date format. Users should replace them if needed, depending on the language used with the digital clock.
// Alarm indicator (keep the 16 characters or move the cursor for smaller text arrays)
#define ALARM_TEXT " ALARM!!! "The definition above is related to the label referring to the alarm event. Users should replace them if needed, depending on the language used with the digital clock.
typedef enum {
DATE_WWW_DD_MM_YY,
DATE_WWW_DD_MMM_YY,
DATE_DD_MM_YY,
DATE_DD_MMM_YY,
DATE_WWW_MM_DD_YY,
DATE_WWW_MMM_DD_YY,
DATE_MM_DD_YY,
DATE_MMM_DD_YY,
} DC_DateTypeDef;The definition above is related to the date format displayed. Users must not replace them unless needed, in order to keep the program functionality.
typedef enum {
TIME_HH_MM_SS,
TIME_HH_MM,
} DC_TimeTypeDef;The definition above is related to the time format displayed. Users must not replace them unless needed, in order to keep the program functionality.
void RTC_DC_Init();This function provides the appropriate digital clock initialization. It replaces the individual library initializations with HAL functions.
Parameters:
Returns:
void RTC_DC_SetDateTime(uint8_t date, uint8_t month, uint16_t year, uint8_t hour, uint8_t minute, uint8_t second);This function sets the date and time to the RTC peripheral. It replaces the multiple HAL functions required.
Parameters:
uint8_t dateuint8_t monthuint8_t yearuint8_t houruint8_t minuteuint8_t secondReturns:
void RTC_DC_SetAlarm(uint8_t hour, uint8_t minute, uint8_t second);This function sets the time to the RTC peripheral alarm feature. It replaces the multiple HAL functions required.
Parameters:
uint8_t houruint8_t minuteuint8_t secondReturns:
uint8_t RTC_DC_CheckDate(uint8_t date, uint8_t month, uint16_t year);This function sets the time to the RTC peripheral alarm feature. It replaces the multiple HAL functions required.
Parameters:
uint8_t dateuint8_t monthuint8_t yearReturns:
uint8_t statusIf the status value is equal to 1, the date provided is valid. Otherwise, if the status is equal to 0, the date provided has an error.
void RTC_DC_Display();This function provides a complete digital clock with alarm and configuration menu functions. It replaces the multiple HAL functions required.
Parameters:
Returns: