Real Time Clock Module with I2C Interface  0.3
⇒ back to Project Page
 All Data Structures Files Functions Variables Typedefs Macros Pages
Macros | Functions | Variables
main.c File Reference

Contains the main routine for the real time clock module. More...

#include <avr/io.h>
#include <stdlib.h>
#include <util/delay.h>
#include <avr/interrupt.h>
#include <avr/pgmspace.h>
#include <math.h>
#include "rtc_control.h"
#include "port_definitions.h"
#include "i2c.h"
#include "dcf77.h"
#include "i2c_rtc_control_operation.h"
Include dependency graph for main.c:

Go to the source code of this file.

Macros

#define F_CPU   20000000UL
 Controller Clock Cycle [Hz].
 

Functions

int main (void)
 

Variables

volatile uint8_t time_scale
 counter triggered by timer
 
volatile uint8_t prev_time_scale
 previous counter value (triggered by timer)
 
volatile uint8_t i2c_slave_data_arrived
 indicates new arrived data from I2C master in buffer
 
volatile uint8_t slave_number_bytes
 number of bytes sent by I2C master
 
volatile uint8_t i2c_slave_mode_blocked
 device is blocked an can not receive any data from I2C master
 
volatile uint8_t ctrl_data [I2C_SLAVE_BUFFER_LENGTH]
 buffer for data I/O with an external master (via interrupt)
 
volatile dcf77_config_data dcf77_config
 contains the configuration for the DCF77 module
 
volatile real_time_data dcf77_time
 contains the real time data from DCF77 module
 

Detailed Description

Contains the main routine for the real time clock module.

Author
Michael Skutek
Date
20.03.2013
Version
0.3

Platform: AVR ATmega (tested on ATmega168)

Include Files:

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Definition in file main.c.