Macros | |
#define | enable_LSE(mode) RCC_BDCRbits.LSEON = mode |
#define | enable_GPIOG(mode) RCC_APB2ENRbits.IOPGEN = mode |
#define | enable_power_control_module(mode) RCC_APB1ENRbits.PWREN = mode |
#define | rtc_access_code 0x9999 |
#define | set_button_pin 0 |
#define | inc_button_pin 1 |
#define | dec_button_pin 2 |
#define | esc_button_pin 3 |
Functions | |
void | setup_mcu () |
void | setup_GPIOs () |
unsigned char | RTC_init () |
void | get_RTC () |
void | set_RTC (unsigned int year, unsigned char month, unsigned char date, unsigned char hour, unsigned char minute, unsigned char second) |
unsigned char | check_for_leap_year (unsigned int year) |
void | show_value (unsigned char x_pos, unsigned char y_pos, unsigned char value) |
void | show_year (unsigned char x_pos, unsigned char y_pos, unsigned int value) |
unsigned int | change_value (unsigned char x_pos, unsigned char y_pos, signed int value, signed int value_min, signed int value_max, unsigned char value_type) |
void | settings () |
void | RTC_ISR () |
void | main () |
Variables | |
const unsigned char | month_table [12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31} |
unsigned char | cal_hour = 0 |
unsigned char | cal_date = 1 |
unsigned char | cal_month = 1 |
unsigned char | cal_minute = 0 |
unsigned char | cal_second = 0 |
unsigned int | cal_year = 1970 |
#define dec_button_pin 2 |
#define enable_GPIOG | ( | mode | ) | RCC_APB2ENRbits.IOPGEN = mode |
#define enable_LSE | ( | mode | ) | RCC_BDCRbits.LSEON = mode |
#define enable_power_control_module | ( | mode | ) | RCC_APB1ENRbits.PWREN = mode |
#define esc_button_pin 3 |
#define inc_button_pin 1 |
#define rtc_access_code 0x9999 |
#define set_button_pin 0 |
unsigned int change_value | ( | unsigned char | x_pos, |
unsigned char | y_pos, | ||
signed int | value, | ||
signed int | value_min, | ||
signed int | value_max, | ||
unsigned char | value_type | ||
) |
unsigned char check_for_leap_year | ( | unsigned int | year | ) |
void get_RTC | ( | ) |
unsigned char RTC_init | ( | ) |
void RTC_ISR | ( | ) |
void set_RTC | ( | unsigned int | year, |
unsigned char | month, | ||
unsigned char | date, | ||
unsigned char | hour, | ||
unsigned char | minute, | ||
unsigned char | second | ||
) |
void settings | ( | ) |
void setup_GPIOs | ( | ) |
void setup_mcu | ( | ) |
void show_value | ( | unsigned char | x_pos, |
unsigned char | y_pos, | ||
unsigned char | value | ||
) |
void show_year | ( | unsigned char | x_pos, |
unsigned char | y_pos, | ||
unsigned int | value | ||
) |
unsigned char cal_date = 1 |
unsigned char cal_hour = 0 |
unsigned char cal_minute = 0 |
unsigned char cal_month = 1 |
unsigned char cal_second = 0 |
unsigned int cal_year = 1970 |
const unsigned char month_table[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31} |