arduino.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 Freie Universit├Ąt Berlin
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
21 #ifndef ARDUINO_H
22 #define ARDUINO_H
23 
24 extern "C" {
25 #include "periph/gpio.h"
26 #include "arduino_board.h"
27 }
28 
29 #include "serialport.hpp"
30 
34 enum {
38 };
39 
43 enum {
44  LOW = 0,
45  HIGH = 1
46 };
47 
48 #ifndef ARDUINO_UART_DEV
49 
52 #define ARDUINO_UART_DEV UART_DEV(0)
53 #endif
54 
59 
66 void pinMode(int pin, int mode);
67 
74 void digitalWrite(int pin, int state);
75 
83 int digitalRead(int pin);
84 
90 void delay(unsigned long msec);
91 
97 void delayMicroseconds(unsigned long usec);
98 
104 unsigned long micros();
105 
114 int analogRead(int pin);
115 
116 #endif /* ARDUINO_H */
117 
#define ARDUINO_UART_DEV
UART device to use for Arduino serial.
Definition: arduino.hpp:52
Low-level GPIO peripheral driver interface definitions.
configure pin as input
Definition: arduino.hpp:35
Definition of the Arduino 'Serial' interface.
int analogRead(int pin)
Read the current value of the given analog pin.
configure pin as input with pull-up resistor
Definition: arduino.hpp:37
static SerialPort Serial(ARDUINO_UART_DEV)
Primary serial port (mapped to ARDUINO_UART_DEV)
configure pin as output
Definition: arduino.hpp:36
void delay(unsigned long msec)
Sleep for a given amount of time [milliseconds].
pin is cleared
Definition: arduino.hpp:44
void pinMode(int pin, int mode)
Configure a pin as either input or output.
void digitalWrite(int pin, int state)
Set the value for the given pin.
pin is set
Definition: arduino.hpp:45
unsigned long micros()
Returns the number of microseconds since start.
void delayMicroseconds(unsigned long usec)
Sleep for a given amount of time [microseconds].
int digitalRead(int pin)
Read the current state of the given pin.
Arduino Serial Interface.
Definition: serialport.hpp:45