AVR library
Macros | Functions | Variables
rtc_timer2.c File Reference

RTC implementation with AVR async Timer2. More...

#include <inttypes.h>
#include <avr/io.h>
#include <avr/interrupt.h>
#include <string.h>
#include <avr/pgmspace.h>
#include "time.h"

Macros

#define RTC_XTAL
 
#define USEC_PER_TICK   15625
 

Functions

void rtc_start (void)
 
void rtc_stop (void)
 
void rtc_init (void)
 
uint8_t rtc_getsec (void)
 
void rtc_gettime (struct rtc_t *t)
 
void rtc_settime (const struct rtc_t *t)
 
int8_t rtc_getcal (void)
 
void rtc_setcal (int8_t c)
 
 ISR (TIMER2_COMPA_vect)
 

Variables

const char RTC_IMPL[] PROGMEM = "TMR"
 

Detailed Description

RTC implementation with AVR async Timer2.

RTC implementation with 32kHz crystal on Timer2 pins. Can also be used with main crystal, but you need to calculate USEC_PER_TICK.

Author
Matej Kogovsek (matej.nosp@m.@ham.nosp@m.radio.nosp@m..si)
Note
This file is part of mat-avr-lib