Kinetis SDK v.1.2 Demo Applications User's Guide  Rev. 0
Freescale Semiconductor, Inc.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
demo_apps/rtc_func/main.c File Reference
#include <stdio.h>
#include "fsl_rtc_driver.h"
#include "fsl_clock_manager.h"
#include "board.h"
#include "fsl_debug_console.h"

Functions

void RTC_IRQHandler (void)
 override the RTC IRQ handler More...
 
void RTC_Seconds_IRQHandler (void)
 override the RTC Second IRQ handler More...
 
static void cmd_alarm (uint8_t offsetSec)
 set alarm command. More...
 
static void cmd_get_datetime (void)
 get the current date time. More...
 
static void cmd_seconds (void)
 run the digital clock in 20s. More...
 
static void cmd_comp (uint32_t cycles, uint32_t interval)
 demo the compansation of RTC More...
 
static void recv_from_console (char *buf, uint32_t size)
 receive the console input and echo More...
 
int main (void)
 main demo function. More...
 

Variables

static volatile uint8_t gAlarmPending
 
static volatile bool gSecsFlag
 
static const char gStrMenu []
 
static const char gStrNewline []
 
static const char gStrInvalid []
 

Function Documentation

static void cmd_alarm ( uint8_t  offsetSec)
static

This function set the alarm which will be trigerred x secs later. The alarm trigger will print a notification on the console.

static void cmd_comp ( uint32_t  cycles,
uint32_t  interval 
)
static

This function set the compansation value and it's interval value. Demo the compansation result by the RTC_CLKOUT pin.

static void cmd_get_datetime ( void  )
static

This function get the current date time

static void cmd_seconds ( void  )
static

This function show the digital clock on console

int main ( void  )

Function prototype for main function.

Parameters
receiveBuffBuffer used to hold received data
static void recv_from_console ( char *  buf,
uint32_t  size 
)
static
void RTC_IRQHandler ( void  )
void RTC_Seconds_IRQHandler ( void  )

Variable Documentation

volatile uint8_t gAlarmPending
static
volatile bool gSecsFlag
static
const char gStrInvalid[]
static
const char gStrMenu[]
static
const char gStrNewline[]
static