summaryrefslogtreecommitdiffstats
path: root/hardware.cpp
blob: e652dda3c86036faec56ce62330c186e3bfc33c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include "hardware.h"

#include "adc.h"
#include "i2c.h"

#include <avr/io.h>
#include <avr/interrupt.h>


void initHardware() {
  DDRA = 0x00;
  PORTA = 0xFF;
  
  DDRB = 0xFF;
  PORTB = 0x00;
  
  DDRC = 0x7C;
  PORTC = 0x83;
  
  DDRD = 0xFF;
  PORTD = 0x00;
  
  TCCR0 = 0x62;
  TCCR1A = 0xA1;
  TCCR1B = 0x82;
  TCCR2 = 0x18;
  
  TIMSK = 0x01;
  
  initADC();
  initI2C();
  
  sei();
}