summaryrefslogtreecommitdiffstats
path: root/hardware.cpp
blob: 51ae18eb6b3863ba8e5dfb872853acfdb03f300f (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
35
36
#include "hardware.h"

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

#include <avr/io.h>


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