This repository has been archived by the owner on Aug 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 199
/
arduino.h
94 lines (69 loc) · 2.24 KB
/
arduino.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/** \file
\brief Pin definitions supervisor.
Here we map to the pin definition file of the architecture at hand and also
do some fundamental platform related stuff.
*/
#ifndef _ARDUINO_H
#define _ARDUINO_H
/**
Only AVRs have a Harvard Architecture, which has distinct address spaces
for RAM, Flash and EEPROM. All other supported targets have a single address
space, so all the macros PROGMEM, PSTR() & co. are obsolete. Define them to
do nothing.
For the AVR definitions, see /usr/lib/avr/include/avr/pgmspace.h on Linux.
*/
#ifdef __AVR__
#include <avr/pgmspace.h>
#else
#define PROGMEM
#define PGM_P const char *
#define PSTR(s) ((const PROGMEM char *)(s))
#define pgm_read_byte(x) (*((uint8_t *)(x)))
#define pgm_read_word(x) (*((uint16_t *)(x)))
#define pgm_read_dword(x) (*((uint32_t *)(x)))
#endif /* __AVR__, ! __AVR__ */
/*
ports and functions
added as necessary or if I feel like it- not a comprehensive list!
*/
#if defined __AVR__
#if defined (__AVR_ATmega168__) || defined (__AVR_ATmega328__) || \
defined (__AVR_ATmega328P__)
#include "arduino_168_328p.h"
#endif
#if defined (__AVR_ATmega644__) || defined (__AVR_ATmega644P__) || \
defined (__AVR_ATmega644PA__) || defined (__AVR_ATmega1284__) || \
defined (__AVR_ATmega1284P__)
#include "arduino_644.h"
#endif
#if defined (__AVR_ATmega1280__) || defined (__AVR_ATmega2560__)
#include "arduino_1280.h"
#endif
#if defined (__AVR_AT90USB1286__)
#include "arduino_usb1286.h"
#endif
#if defined (__AVR_AT90USB1287__)
#include "arduino_usb1287.h"
#endif
#if defined (__AVR_ATmega32U4__)
#include "arduino_32U4.h"
#endif
#elif defined __ARMEL__
#if defined (__ARM_LPC1114__)
#include "arduino_lpc1114.h"
#endif
#if defined (__ARM_STM32__)
#include "arduino_stm32f411.h"
#endif
#endif /* __AVR__, __ARMEL__, SIMULATOR */
#ifndef SIMULATOR
#if ! defined DIO0_PIN && ! defined PIO0_1_PIN && ! defined PA_1_PIN
#error Pins for this chip not defined in arduino.h! If you write an \
appropriate pin definition and have this firmware work on your chip, \
please tell us via Github or the forum thread.
#endif
#endif
#ifndef BSS
#define BSS __attribute__ ((__section__ (".bss")))
#endif
#endif /* _ARDUINO_H */