AVR library
Functions | Variables
time.c File Reference

Time functions. More...

#include "time.h"

Functions

uint32_t rtc_mktime (const struct rtc_t *t)
 Convert rtc_t to unix time. More...
 
uint8_t rtc_timevalid (const struct rtc_t *t)
 
void rtc_inct (struct rtc_t *t)
 Increase rtc_t by 1 second. More...
 

Variables

const uint32_t MINUTE = 60
 
const uint32_t HOUR = 3600
 
const uint32_t DAY = 86400
 
const uint32_t YEAR = 31536000
 
const uint8_t month_days [12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}
 

Detailed Description

Time functions.

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

Function Documentation

void rtc_inct ( struct rtc_t t)

Increase rtc_t by 1 second.

Parameters
[in]tPointer to rtc_t
uint32_t rtc_mktime ( const struct rtc_t t)

Convert rtc_t to unix time.

Parameters
[in]tPointer to rtc_t
Returns
Unix time

Variable Documentation

const uint32_t DAY = 86400

seconds in day

const uint32_t HOUR = 3600

seconds in hour

const uint32_t MINUTE = 60

seconds in minute

const uint8_t month_days[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}

month length

const uint32_t YEAR = 31536000

seconds in day