Loading...
Searching...
No Matches
arduino_board_pwm.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2023 Otto-von-Guericke-Universität Magdeburg
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
23#ifndef ARDUINO_BOARD_PWM_H
24#define ARDUINO_BOARD_PWM_H
25
26#include "arduino_iomap.h"
27#include "periph/pwm.h"
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
33#ifdef DOXYGEN
37#define ARDUINO_PWM_FREQU /* implementation defined */
38#else
39# ifndef ARDUINO_PWM_FREQU
40# define ARDUINO_PWM_FREQU (490U)
41# endif
42#endif
43
60static const arduino_pwm_t arduino_pwm_list[] = {
61#ifdef ARDUINO_PIN_0_PWM_DEV
62 { .dev = ARDUINO_PIN_0_PWM_DEV, .chan = ARDUINO_PIN_0_PWM_CHAN, .pin = 0 },
63#endif
64#ifdef ARDUINO_PIN_1_PWM_DEV
65 { .dev = ARDUINO_PIN_1_PWM_DEV, .chan = ARDUINO_PIN_1_PWM_CHAN, .pin = 1 },
66#endif
67#ifdef ARDUINO_PIN_2_PWM_DEV
68 { .dev = ARDUINO_PIN_2_PWM_DEV, .chan = ARDUINO_PIN_2_PWM_CHAN, .pin = 2 },
69#endif
70#ifdef ARDUINO_PIN_3_PWM_DEV
71 { .dev = ARDUINO_PIN_3_PWM_DEV, .chan = ARDUINO_PIN_3_PWM_CHAN, .pin = 3 },
72#endif
73#ifdef ARDUINO_PIN_4_PWM_DEV
74 { .dev = ARDUINO_PIN_4_PWM_DEV, .chan = ARDUINO_PIN_4_PWM_CHAN, .pin = 4 },
75#endif
76#ifdef ARDUINO_PIN_5_PWM_DEV
77 { .dev = ARDUINO_PIN_5_PWM_DEV, .chan = ARDUINO_PIN_5_PWM_CHAN, .pin = 5 },
78#endif
79#ifdef ARDUINO_PIN_6_PWM_DEV
80 { .dev = ARDUINO_PIN_6_PWM_DEV, .chan = ARDUINO_PIN_6_PWM_CHAN, .pin = 6 },
81#endif
82#ifdef ARDUINO_PIN_7_PWM_DEV
83 { .dev = ARDUINO_PIN_7_PWM_DEV, .chan = ARDUINO_PIN_7_PWM_CHAN, .pin = 7 },
84#endif
85#ifdef ARDUINO_PIN_8_PWM_DEV
86 { .dev = ARDUINO_PIN_8_PWM_DEV, .chan = ARDUINO_PIN_8_PWM_CHAN, .pin = 8 },
87#endif
88#ifdef ARDUINO_PIN_9_PWM_DEV
89 { .dev = ARDUINO_PIN_9_PWM_DEV, .chan = ARDUINO_PIN_9_PWM_CHAN, .pin = 9 },
90#endif
91#ifdef ARDUINO_PIN_10_PWM_DEV
92 { .dev = ARDUINO_PIN_10_PWM_DEV, .chan = ARDUINO_PIN_10_PWM_CHAN, .pin = 10 },
93#endif
94#ifdef ARDUINO_PIN_11_PWM_DEV
95 { .dev = ARDUINO_PIN_11_PWM_DEV, .chan = ARDUINO_PIN_11_PWM_CHAN, .pin = 11 },
96#endif
97#ifdef ARDUINO_PIN_12_PWM_DEV
98 { .dev = ARDUINO_PIN_12_PWM_DEV, .chan = ARDUINO_PIN_12_PWM_CHAN, .pin = 12 },
99#endif
100#ifdef ARDUINO_PIN_13_PWM_DEV
101 { .dev = ARDUINO_PIN_13_PWM_DEV, .chan = ARDUINO_PIN_13_PWM_CHAN, .pin = 13 },
102#endif
103#ifdef ARDUINO_PIN_14_PWM_DEV
104 { .dev = ARDUINO_PIN_14_PWM_DEV, .chan = ARDUINO_PIN_14_PWM_CHAN, .pin = 14 },
105#endif
106#ifdef ARDUINO_PIN_15_PWM_DEV
107 { .dev = ARDUINO_PIN_15_PWM_DEV, .chan = ARDUINO_PIN_15_PWM_CHAN, .pin = 15 },
108#endif
109#ifdef ARDUINO_PIN_16_PWM_DEV
110 { .dev = ARDUINO_PIN_16_PWM_DEV, .chan = ARDUINO_PIN_16_PWM_CHAN, .pin = 16 },
111#endif
112#ifdef ARDUINO_PIN_17_PWM_DEV
113 { .dev = ARDUINO_PIN_17_PWM_DEV, .chan = ARDUINO_PIN_17_PWM_CHAN, .pin = 17 },
114#endif
115#ifdef ARDUINO_PIN_18_PWM_DEV
116 { .dev = ARDUINO_PIN_18_PWM_DEV, .chan = ARDUINO_PIN_18_PWM_CHAN, .pin = 18 },
117#endif
118#ifdef ARDUINO_PIN_19_PWM_DEV
119 { .dev = ARDUINO_PIN_19_PWM_DEV, .chan = ARDUINO_PIN_19_PWM_CHAN, .pin = 19 },
120#endif
121#ifdef ARDUINO_PIN_20_PWM_DEV
122 { .dev = ARDUINO_PIN_20_PWM_DEV, .chan = ARDUINO_PIN_20_PWM_CHAN, .pin = 20 },
123#endif
124#ifdef ARDUINO_PIN_21_PWM_DEV
125 { .dev = ARDUINO_PIN_21_PWM_DEV, .chan = ARDUINO_PIN_21_PWM_CHAN, .pin = 21 },
126#endif
127#ifdef ARDUINO_PIN_22_PWM_DEV
128 { .dev = ARDUINO_PIN_22_PWM_DEV, .chan = ARDUINO_PIN_22_PWM_CHAN, .pin = 22 },
129#endif
130#ifdef ARDUINO_PIN_23_PWM_DEV
131 { .dev = ARDUINO_PIN_23_PWM_DEV, .chan = ARDUINO_PIN_23_PWM_CHAN, .pin = 23 },
132#endif
133#ifdef ARDUINO_PIN_24_PWM_DEV
134 { .dev = ARDUINO_PIN_24_PWM_DEV, .chan = ARDUINO_PIN_24_PWM_CHAN, .pin = 24 },
135#endif
136#ifdef ARDUINO_PIN_25_PWM_DEV
137 { .dev = ARDUINO_PIN_25_PWM_DEV, .chan = ARDUINO_PIN_25_PWM_CHAN, .pin = 25 },
138#endif
139#ifdef ARDUINO_PIN_26_PWM_DEV
140 { .dev = ARDUINO_PIN_26_PWM_DEV, .chan = ARDUINO_PIN_26_PWM_CHAN, .pin = 26 },
141#endif
142#ifdef ARDUINO_PIN_27_PWM_DEV
143 { .dev = ARDUINO_PIN_27_PWM_DEV, .chan = ARDUINO_PIN_27_PWM_CHAN, .pin = 27 },
144#endif
145#ifdef ARDUINO_PIN_28_PWM_DEV
146 { .dev = ARDUINO_PIN_28_PWM_DEV, .chan = ARDUINO_PIN_28_PWM_CHAN, .pin = 28 },
147#endif
148#ifdef ARDUINO_PIN_29_PWM_DEV
149 { .dev = ARDUINO_PIN_29_PWM_DEV, .chan = ARDUINO_PIN_29_PWM_CHAN, .pin = 29 },
150#endif
151#ifdef ARDUINO_PIN_30_PWM_DEV
152 { .dev = ARDUINO_PIN_30_PWM_DEV, .chan = ARDUINO_PIN_30_PWM_CHAN, .pin = 30 },
153#endif
154#ifdef ARDUINO_PIN_31_PWM_DEV
155 { .dev = ARDUINO_PIN_31_PWM_DEV, .chan = ARDUINO_PIN_31_PWM_CHAN, .pin = 31 },
156#endif
157};
158
159#ifdef __cplusplus
160}
161#endif
162
163#endif /* ARDUINO_BOARD_PWM_H */
static const arduino_pwm_t arduino_pwm_list[]
List of PWM GPIO mappings.
Low-level PWM peripheral driver interface definitions.