Open Garden  0.10.1-21
Functions
rtc.c File Reference

Counters handler and IRQ routine. More...

#include <stdint.h>
#include <stdlib.h>
#include <avr/io.h>
#include <avr/interrupt.h>
#include "rtc.h"
Include dependency graph for rtc.c:

Functions

 ISR (TIMER2_OVF_vect)
 
void rtc_setup (void)
 
void rtc_start (void)
 
void rtc_stop (void)
 

Detailed Description

Counters handler and IRQ routine.

Function Documentation

◆ ISR()

ISR ( TIMER2_OVF_vect  )

IRQ wakes up on the timer oveflow and increment the global seconds.

◆ rtc_setup()

void rtc_setup ( void  )

setup timer/counter on 32Khz external clock.

enable interrupt on timer 2 overflow

◆ rtc_start()

void rtc_start ( void  )

setup prescaler to scale to 1 sec counter and start counter.

counter prescaler 1024

counter prescaler 128

◆ rtc_stop()

void rtc_stop ( void  )

stop the counter.