37 int main(
int argc,
char **argv)
52 alarm_time = &user_alarm;
60 printf(
"MPL pin level is %d\r\n",(
unsigned char)pval);
65 printf(
"Alarm interrupt status %d\r\n",(
unsigned int)s);
70 printf(
"MPL pin level is %d\r\n",(
unsigned char)pval);
74 printf(
"now: %d-%d-%d %d:%d:%d\n", current_time->
year, current_time->
month, current_time->
date, current_time->
hour, current_time->
min, current_time->
sec);
#define MCP79410_ADDRESS
The I2C address of the MCP79410 real time clock and calendar.
void MCP79410_SetAlarmMatch(Match_t match, Alarm_t alarm)
Alarm Asserts on Match on seconds, minutes ,hours depending on match parameter.
void MCP79410_DisableOscillator(void)
Disables the clock oscillator.The RTCC does not operate once the oscillator is stopped.
unsigned char MCP79410_IsRunning(void)
Checks if the chip clock is running.
void I2C_Close(void)
Closes the I2C peripheral.
unsigned char date
Weekday.
void MCP79410_SetAlarmMFPPolarity(Polarity_t MFP_pol, Alarm_t alarm)
This function sets the MFP polarity either high or low.
RTCC_Struct * MCP79410_GetTime(void)
The function returns a time structure with the current time from the RTCC.
unsigned char month
Date of the month.
PinLevel_t ReadPinStatus(PIN_t pin)
Configures the pins as input and returns the pin status.
void MCP79410_ClearInterruptFlag(Alarm_t alarm)
Clears the interrupt alarm flag.
void I2C_Initialize(unsigned char address)
Initializes the I2C peripheral.
AlarmStatus_t MCP79410_GetAlarmStatus(Alarm_t alarm)
This function gets the status of the alarm interrupt flag.
void MCP79410_Initialize(void)
Initializes the RTCC with the system time.
int main(int argc, char **argv)
void MCP79410_SetAlarmTime(RTCC_Struct *time, Alarm_t alarm)
This function sets the alarm time for one of the two alarms.
void delay_ms(unsigned int ms)
Delay in ms.
unsigned char min
Seconds.
unsigned char hour
Minutes.
enum AlarmStatus AlarmStatus_t
void MCP79410_SetMFP_Functionality(MFP_t mode)
This function sets the MFP pin mode.