Macros | Typedefs | Functions | Variables
Arduino.h File Reference
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <math.h>
#include <avr/pgmspace.h>
#include <avr/io.h>
#include <avr/interrupt.h>
#include "binary.h"
#include "pins_arduino.h"
Include dependency graph for Arduino.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define _NOP()   do { __asm__ volatile ("nop"); } while (0)
 
#define abs(x)   ((x)>0?(x):-(x))
 
#define analogInPinToBit(P)   (P)
 
#define analogInPinToBit(P)   (P)
 
#define bit(b)   (1UL << (b))
 
#define bitClear(value, bit)   ((value) &= ~(1UL << (bit)))
 
#define bitRead(value, bit)   (((value) >> (bit)) & 0x01)
 
#define bitSet(value, bit)   ((value) |= (1UL << (bit)))
 
#define bitWrite(value, bit, bitvalue)   (bitvalue ? bitSet(value, bit) : bitClear(value, bit))
 
#define CHANGE   1
 
#define clockCyclesPerMicrosecond()   ( F_CPU / 1000000L )
 
#define clockCyclesToMicroseconds(a)   ( (a) / clockCyclesPerMicrosecond() )
 
#define constrain(amt, low, high)   ((amt)<(low)?(low):((amt)>(high)?(high):(amt)))
 
#define DEFAULT   1
 
#define DEG_TO_RAD   0.017453292519943295769236907684886
 
#define degrees(rad)   ((rad)*RAD_TO_DEG)
 
#define digitalPinToBitMask(P)   ( pgm_read_byte( digital_pin_to_bit_mask_PGM + (P) ) )
 
#define digitalPinToPort(P)   ( pgm_read_byte( digital_pin_to_port_PGM + (P) ) )
 
#define digitalPinToTimer(P)   ( pgm_read_byte( digital_pin_to_timer_PGM + (P) ) )
 
#define DISPLAY   0x1
 
#define EULER   2.718281828459045235360287471352
 
#define EXTERNAL   0
 
#define FALLING   2
 
#define HALF_PI   1.5707963267948966192313216916398
 
#define HIGH   0x1
 
#define highByte(w)   ((uint8_t) ((w) >> 8))
 
#define INPUT   0x0
 
#define INPUT_PULLUP   0x2
 
#define INTERNAL   3
 
#define interrupts()   sei()
 
#define LOW   0x0
 
#define lowByte(w)   ((uint8_t) ((w) & 0xff))
 
#define LSBFIRST   0
 
#define max(a, b)   ((a)>(b)?(a):(b))
 
#define microsecondsToClockCycles(a)   ( (a) * clockCyclesPerMicrosecond() )
 
#define min(a, b)   ((a)<(b)?(a):(b))
 
#define MSBFIRST   1
 
#define noInterrupts()   cli()
 
#define NOT_A_PIN   0
 
#define NOT_A_PORT   0
 
#define NOT_AN_INTERRUPT   -1
 
#define NOT_ON_TIMER   0
 
#define OUTPUT   0x1
 
#define PI   3.1415926535897932384626433832795
 
#define portInputRegister(P)   ( (volatile uint8_t *)( pgm_read_word( port_to_input_PGM + (P))) )
 
#define portModeRegister(P)   ( (volatile uint8_t *)( pgm_read_word( port_to_mode_PGM + (P))) )
 
#define portOutputRegister(P)   ( (volatile uint8_t *)( pgm_read_word( port_to_output_PGM + (P))) )
 
#define RAD_TO_DEG   57.295779513082320876798154814105
 
#define radians(deg)   ((deg)*DEG_TO_RAD)
 
#define RISING   3
 
#define round(x)   ((x)>=0?(long)((x)+0.5):(long)((x)-0.5))
 
#define SERIAL   0x0
 
#define sq(x)   ((x)*(x))
 
#define TIMER0A   1
 
#define TIMER0B   2
 
#define TIMER1A   3
 
#define TIMER1B   4
 
#define TIMER1C   5
 
#define TIMER2   6
 
#define TIMER2A   7
 
#define TIMER2B   8
 
#define TIMER3A   9
 
#define TIMER3B   10
 
#define TIMER3C   11
 
#define TIMER4A   12
 
#define TIMER4B   13
 
#define TIMER4C   14
 
#define TIMER4D   15
 
#define TIMER5A   16
 
#define TIMER5B   17
 
#define TIMER5C   18
 
#define TWO_PI   6.283185307179586476925286766559
 

Typedefs

typedef bool boolean
 
typedef uint8_t byte
 
typedef unsigned int word
 

Functions

int analogRead (uint8_t)
 
void analogReference (uint8_t mode)
 
void analogWrite (uint8_t, int)
 
int atexit (void(*func)()) __attribute__((weak))
 
void attachInterrupt (uint8_t, void(*)(void), int mode)
 
void delay (unsigned long)
 
void delayMicroseconds (unsigned int us)
 
void detachInterrupt (uint8_t)
 
int digitalRead (uint8_t)
 
void digitalWrite (uint8_t, uint8_t)
 
void init (void)
 
void initVariant (void)
 
void loop (void)
 
unsigned long micros (void)
 
unsigned long millis (void)
 
void pinMode (uint8_t, uint8_t)
 
unsigned long pulseIn (uint8_t pin, uint8_t state, unsigned long timeout)
 
unsigned long pulseInLong (uint8_t pin, uint8_t state, unsigned long timeout)
 
void setup (void)
 
uint8_t shiftIn (uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder)
 
void shiftOut (uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder, uint8_t val)
 
void yield (void)
 

Variables

const uint8_t PROGMEM digital_pin_to_bit_mask_PGM []
 
const uint8_t PROGMEM digital_pin_to_port_PGM []
 
const uint8_t PROGMEM digital_pin_to_timer_PGM []
 
const uint16_t PROGMEM port_to_input_PGM []
 
const uint16_t PROGMEM port_to_mode_PGM []
 
const uint16_t PROGMEM port_to_output_PGM []
 

Macro Definition Documentation

#define _NOP ( )    do { __asm__ volatile ("nop"); } while (0)

Definition at line 118 of file Arduino.h.

#define abs (   x)    ((x)>0?(x):-(x))

Definition at line 94 of file Arduino.h.

#define analogInPinToBit (   P)    (P)

Definition at line 180 of file Arduino.h.

#define analogInPinToBit (   P)    (P)

Definition at line 180 of file Arduino.h.

#define bit (   b)    (1UL << (b))

Definition at line 123 of file Arduino.h.

#define bitClear (   value,
  bit 
)    ((value) &= ~(1UL << (bit)))

Definition at line 113 of file Arduino.h.

#define bitRead (   value,
  bit 
)    (((value) >> (bit)) & 0x01)

Definition at line 111 of file Arduino.h.

#define bitSet (   value,
  bit 
)    ((value) |= (1UL << (bit)))

Definition at line 112 of file Arduino.h.

#define bitWrite (   value,
  bit,
  bitvalue 
)    (bitvalue ? bitSet(value, bit) : bitClear(value, bit))

Definition at line 114 of file Arduino.h.

#define CHANGE   1

Definition at line 60 of file Arduino.h.

#define clockCyclesPerMicrosecond ( )    ( F_CPU / 1000000L )

Definition at line 104 of file Arduino.h.

#define clockCyclesToMicroseconds (   a)    ( (a) / clockCyclesPerMicrosecond() )

Definition at line 105 of file Arduino.h.

#define constrain (   amt,
  low,
  high 
)    ((amt)<(low)?(low):((amt)>(high)?(high):(amt)))

Definition at line 95 of file Arduino.h.

#define DEFAULT   1

Definition at line 83 of file Arduino.h.

#define DEG_TO_RAD   0.017453292519943295769236907684886

Definition at line 50 of file Arduino.h.

#define degrees (   rad)    ((rad)*RAD_TO_DEG)

Definition at line 98 of file Arduino.h.

#define digitalPinToBitMask (   P)    ( pgm_read_byte( digital_pin_to_bit_mask_PGM + (P) ) )

Definition at line 178 of file Arduino.h.

#define digitalPinToPort (   P)    ( pgm_read_byte( digital_pin_to_port_PGM + (P) ) )

Definition at line 177 of file Arduino.h.

#define digitalPinToTimer (   P)    ( pgm_read_byte( digital_pin_to_timer_PGM + (P) ) )

Definition at line 179 of file Arduino.h.

#define DISPLAY   0x1

Definition at line 55 of file Arduino.h.

#define EULER   2.718281828459045235360287471352

Definition at line 52 of file Arduino.h.

#define EXTERNAL   0

Definition at line 84 of file Arduino.h.

#define FALLING   2

Definition at line 61 of file Arduino.h.

#define HALF_PI   1.5707963267948966192313216916398

Definition at line 48 of file Arduino.h.

#define HIGH   0x1

Definition at line 40 of file Arduino.h.

#define highByte (   w)    ((uint8_t) ((w) >> 8))

Definition at line 109 of file Arduino.h.

#define INPUT   0x0

Definition at line 43 of file Arduino.h.

#define INPUT_PULLUP   0x2

Definition at line 45 of file Arduino.h.

#define INTERNAL   3

Definition at line 81 of file Arduino.h.

#define interrupts ( )    sei()

Definition at line 101 of file Arduino.h.

#define LOW   0x0

Definition at line 41 of file Arduino.h.

#define lowByte (   w)    ((uint8_t) ((w) & 0xff))

Definition at line 108 of file Arduino.h.

#define LSBFIRST   0

Definition at line 57 of file Arduino.h.

#define max (   a,
  b 
)    ((a)>(b)?(a):(b))

Definition at line 93 of file Arduino.h.

#define microsecondsToClockCycles (   a)    ( (a) * clockCyclesPerMicrosecond() )

Definition at line 106 of file Arduino.h.

#define min (   a,
  b 
)    ((a)<(b)?(a):(b))

Definition at line 92 of file Arduino.h.

#define MSBFIRST   1

Definition at line 58 of file Arduino.h.

#define noInterrupts ( )    cli()

Definition at line 102 of file Arduino.h.

#define NOT_A_PIN   0

Definition at line 185 of file Arduino.h.

#define NOT_A_PORT   0

Definition at line 186 of file Arduino.h.

#define NOT_AN_INTERRUPT   -1

Definition at line 188 of file Arduino.h.

#define NOT_ON_TIMER   0

Definition at line 204 of file Arduino.h.

#define OUTPUT   0x1

Definition at line 44 of file Arduino.h.

#define PI   3.1415926535897932384626433832795

Definition at line 47 of file Arduino.h.

#define portInputRegister (   P)    ( (volatile uint8_t *)( pgm_read_word( port_to_input_PGM + (P))) )

Definition at line 182 of file Arduino.h.

#define portModeRegister (   P)    ( (volatile uint8_t *)( pgm_read_word( port_to_mode_PGM + (P))) )

Definition at line 183 of file Arduino.h.

#define portOutputRegister (   P)    ( (volatile uint8_t *)( pgm_read_word( port_to_output_PGM + (P))) )

Definition at line 181 of file Arduino.h.

#define RAD_TO_DEG   57.295779513082320876798154814105

Definition at line 51 of file Arduino.h.

#define radians (   deg)    ((deg)*DEG_TO_RAD)

Definition at line 97 of file Arduino.h.

#define RISING   3

Definition at line 62 of file Arduino.h.

#define round (   x)    ((x)>=0?(long)((x)+0.5):(long)((x)-0.5))

Definition at line 96 of file Arduino.h.

#define SERIAL   0x0

Definition at line 54 of file Arduino.h.

#define sq (   x)    ((x)*(x))

Definition at line 99 of file Arduino.h.

#define TIMER0A   1

Definition at line 205 of file Arduino.h.

#define TIMER0B   2

Definition at line 206 of file Arduino.h.

#define TIMER1A   3

Definition at line 207 of file Arduino.h.

#define TIMER1B   4

Definition at line 208 of file Arduino.h.

#define TIMER1C   5

Definition at line 209 of file Arduino.h.

#define TIMER2   6

Definition at line 210 of file Arduino.h.

#define TIMER2A   7

Definition at line 211 of file Arduino.h.

#define TIMER2B   8

Definition at line 212 of file Arduino.h.

#define TIMER3A   9

Definition at line 214 of file Arduino.h.

#define TIMER3B   10

Definition at line 215 of file Arduino.h.

#define TIMER3C   11

Definition at line 216 of file Arduino.h.

#define TIMER4A   12

Definition at line 217 of file Arduino.h.

#define TIMER4B   13

Definition at line 218 of file Arduino.h.

#define TIMER4C   14

Definition at line 219 of file Arduino.h.

#define TIMER4D   15

Definition at line 220 of file Arduino.h.

#define TIMER5A   16

Definition at line 221 of file Arduino.h.

#define TIMER5B   17

Definition at line 222 of file Arduino.h.

#define TIMER5C   18

Definition at line 223 of file Arduino.h.

#define TWO_PI   6.283185307179586476925286766559

Definition at line 49 of file Arduino.h.

Typedef Documentation

typedef bool boolean

Definition at line 125 of file Arduino.h.

typedef uint8_t byte

Definition at line 126 of file Arduino.h.

typedef unsigned int word

Definition at line 121 of file Arduino.h.

Function Documentation

int analogRead ( uint8_t  )

Definition at line 38 of file wiring_analog.c.

void analogReference ( uint8_t  mode)

Definition at line 30 of file wiring_analog.c.

void analogWrite ( uint8_t  ,
int   
)

Definition at line 104 of file wiring_analog.c.

int atexit ( void(*)()  func)

Definition at line 23 of file ArduinoCore/src/core/main.cpp.

void attachInterrupt ( uint8_t  ,
void(*)(void ,
int  mode 
)

Definition at line 70 of file WInterrupts.c.

void delay ( unsigned  long)

Definition at line 106 of file wiring.c.

void delayMicroseconds ( unsigned int  us)

Definition at line 120 of file wiring.c.

void detachInterrupt ( uint8_t  )

Definition at line 187 of file WInterrupts.c.

int digitalRead ( uint8_t  )

Definition at line 165 of file wiring_digital.c.

void digitalWrite ( uint8_t  ,
uint8_t   
)

Definition at line 138 of file wiring_digital.c.

void init ( void  )

Definition at line 241 of file wiring.c.

void initVariant ( void  )

Definition at line 28 of file ArduinoCore/src/core/main.cpp.

void loop ( void  )

Definition at line 53 of file arduino_daq/main.cpp.

unsigned long micros ( void  )

Definition at line 79 of file wiring.c.

unsigned long millis ( void  )

Definition at line 65 of file wiring.c.

void pinMode ( uint8_t  ,
uint8_t   
)

Definition at line 29 of file wiring_digital.c.

unsigned long pulseIn ( uint8_t  pin,
uint8_t  state,
unsigned long  timeout 
)

Definition at line 33 of file wiring_pulse.c.

unsigned long pulseInLong ( uint8_t  pin,
uint8_t  state,
unsigned long  timeout 
)

Definition at line 63 of file wiring_pulse.c.

void setup ( void  )

Definition at line 48 of file arduino_daq/main.cpp.

uint8_t shiftIn ( uint8_t  dataPin,
uint8_t  clockPin,
uint8_t  bitOrder 
)

Definition at line 25 of file wiring_shift.c.

void shiftOut ( uint8_t  dataPin,
uint8_t  clockPin,
uint8_t  bitOrder,
uint8_t  val 
)

Definition at line 40 of file wiring_shift.c.

void yield ( void  )

Variable Documentation

const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[]
const uint8_t PROGMEM digital_pin_to_port_PGM[]
const uint8_t PROGMEM digital_pin_to_timer_PGM[]
const uint16_t PROGMEM port_to_input_PGM[]
const uint16_t PROGMEM port_to_mode_PGM[]
const uint16_t PROGMEM port_to_output_PGM[]


arduino_daq
Author(s):
autogenerated on Mon Jun 10 2019 12:46:03