-
Notifications
You must be signed in to change notification settings - Fork 0
/
hardware.h
77 lines (66 loc) · 1.56 KB
/
hardware.h
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/*
This file has been auto-generated by WebbotLib tools V2.1
** DO NOT MODIFY BY HAND **
*/
#ifndef _HARDWARE_H_
#define _HARDWARE_H_
#if !defined (_LIB_HARDWARE_C_) && !defined(_LIB_HARDWARE_CPP_)
#define BUILDING_LIBRARY
#define _LIB_HARDWARE_C_
#endif
#ifndef F_CPU
#warning No CPU speed specified - assuming running at 16000000
#define F_CPU 16000000
#endif
#if F_CPU != 16000000
# warning "Board runs at 16000000 but you have defined a different value"
#endif
#if defined (__AVR_ATtiny85__)
#else
# error You must set the device to the ATtiny85
#endif
#define FLASH_SIZE 8192
#define RAM_SIZE 512
#define EEPROM_SIZE 512
#define _NUM_PCINT_PINS 4
// Include library files
#include <libdefs.h>
#include <core.h>
#include <timer.h>
#include <a2d.h>
#include <rprintf.h>
#include <led.h>
#include <stdlib.h>
#include <avr/eeprom.h>
#include <iopin.h>
#include "lib/lib_timerdef.h"
#include "lib/lib_iopins.h"
#ifdef __cplusplus
extern "C" {
#endif
// ----------- Define the ADC channels ----------
#define ADC0 ADC_NUMBER_TO_CHANNEL(0)
#define ADC1 ADC_NUMBER_TO_CHANNEL(1)
#define ADC2 ADC_NUMBER_TO_CHANNEL(2)
#define ADC3 ADC_NUMBER_TO_CHANNEL(3)
extern const uint8_t NUM_ADC_CHANNELS;
// ----------- My devices -----------------------
#define outputB0 B0
void initHardware(void);
#ifdef __cplusplus
}
#endif
#endif
// undefine all ports so the user cannot change them directly
#undef PORTB
#undef DDRB
#undef PINB
// Undefine timer registers to stop users changing them
#undef TCNT0
#undef TCCR0B
#undef OCR0A
#undef OCR0B
#undef TCNT1
#undef TCCR1
#undef OCR1A
#undef OCR1B