arduino.hpp File Reference

Main interface definition of the Arduino API. More...

Detailed Description

Main interface definition of the Arduino API.

Author
Hauke Petersen hauke.nosp@m..pet.nosp@m.ersen.nosp@m.@fu-.nosp@m.berli.nosp@m.n.de

Definition in file arduino.hpp.

#include <stdint.h>
#include "periph/gpio.h"
#include "arduino_board.h"
#include "serialport.hpp"
+ Include dependency graph for arduino.hpp:

Go to the source code of this file.

Macros

#define ARDUINO_UART_DEV   UART_DEV(0)
 UART device to use for Arduino serial.
 
#define ARDUINO_PWM_FREQU   (1000U)
 PWM default frequency. More...
 
#define ARDUINO_PWM_MODE   PWM_LEFT
 PWM mode.
 
#define ARDUINO_PWM_STEPS   (256U)
 PWM steps.
 

Typedefs

typedef bool boolean
 Arduino boolean data type definion.
 
typedef uint8_t byte
 Arduino byte data type definion.
 

Enumerations

enum  { INPUT, OUTPUT, INPUT_PULLUP }
 Possible pin configurations. More...
 
enum  { LOW = 0, HIGH = 1 }
 Possible pin states. More...
 

Functions

void pinMode (int pin, int mode)
 Configure a pin as either input or output. More...
 
void digitalWrite (int pin, int state)
 Set the value for the given pin. More...
 
int digitalRead (int pin)
 Read the current state of the given pin. More...
 
void delay (unsigned long msec)
 Sleep for a given amount of time [milliseconds]. More...
 
void delayMicroseconds (unsigned long usec)
 Sleep for a given amount of time [microseconds]. More...
 
unsigned long micros ()
 Returns the number of microseconds since start. More...
 
unsigned long millis ()
 Returns the number of milliseconds since start. More...
 
int analogRead (int pin)
 Read the current value of the given analog pin. More...
 
void analogWrite (int pin, int value)
 Write an analog value to a pin. More...
 

Variables

static SerialPort Serial (ARDUINO_UART_DEV)
 Primary serial port (mapped to ARDUINO_UART_DEV)