arduino_board.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016 Freie Universität Berlin
3  * 2016 Inria
4  *
5  * This file is subject to the terms and conditions of the GNU Lesser
6  * General Public License v2.1. See the file LICENSE in the top level
7  * directory for more details.
8  */
9 
21 #ifndef ARDUINO_BOARD_H
22 #define ARDUINO_BOARD_H
23 
24 #include "arduino_pinmap.h"
25 #include "periph/pwm.h"
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
34 #define ARDUINO_LED (13)
35 
39 static const gpio_t arduino_pinmap[] = {
40  ARDUINO_PIN_0,
41  ARDUINO_PIN_1,
42  ARDUINO_PIN_2,
43  ARDUINO_PIN_3,
44  ARDUINO_PIN_4,
45  ARDUINO_PIN_5,
46  ARDUINO_PIN_6,
47  ARDUINO_PIN_7,
48  ARDUINO_PIN_8,
49  ARDUINO_PIN_9,
50  ARDUINO_PIN_10,
51  ARDUINO_PIN_11,
52  ARDUINO_PIN_12,
53  ARDUINO_PIN_13,
54  ARDUINO_PIN_A0,
55  ARDUINO_PIN_A1,
56  ARDUINO_PIN_A2,
57  ARDUINO_PIN_A3,
58  ARDUINO_PIN_A4,
59  ARDUINO_PIN_A5,
60 };
61 
65 static const adc_t arduino_analog_map[] = {
66  ARDUINO_A0,
67  ARDUINO_A1,
68  ARDUINO_A2,
69  ARDUINO_A3,
70  ARDUINO_A4,
71  ARDUINO_A5,
72 };
73 
77 #define ARDUINO_PWM_FREQU (732U)
78 
82 static const arduino_pwm_t arduino_pwm_list[] = {
83  { .pin = 3, .dev = PWM_DEV(0), .chan = 1 },
84  { .pin = 4, .dev = PWM_DEV(0), .chan = 0 },
85  { .pin = 8, .dev = PWM_DEV(1), .chan = 0 },
86  { .pin = 9, .dev = PWM_DEV(1), .chan = 1 },
87 };
88 
89 #ifdef __cplusplus
90 }
91 #endif
92 
93 #endif /* ARDUINO_BOARD_H */
94 
adc_t
unsigned int adc_t
Define default ADC type identifier.
Definition: adc.h:72
arduino_pinmap.h
Mapping from MCU pins to Arduino pins.
arduino_pinmap
static const gpio_t arduino_pinmap[]
Look-up table for the Arduino's digital pins.
Definition: arduino_board.h:39
PWM_DEV
#define PWM_DEV(x)
Default PWM access macro.
Definition: pwm.h:78
arduino_pwm_list
static const arduino_pwm_t arduino_pwm_list[]
List of PWM GPIO mappings.
Definition: arduino_board.h:82
arduino_analog_map
static const adc_t arduino_analog_map[]
Look-up table for the Arduino's analog pins.
Definition: arduino_board.h:65
pwm.h
Low-level PWM peripheral driver interface definitions.