Adding support for UART0 (#14094)
[betaflight.git] / src / main / pg / timerio.c
blob118e83cc4f82f2469d1c46425fe489447a7af7f2
1 /*
2 * This file is part of Cleanflight and Betaflight.
4 * Cleanflight and Betaflight are free software. You can redistribute
5 * this software and/or modify this software under the terms of the
6 * GNU General Public License as published by the Free Software
7 * Foundation, either version 3 of the License, or (at your option)
8 * any later version.
10 * Cleanflight and Betaflight are distributed in the hope that they
11 * will be useful, but WITHOUT ANY WARRANTY; without even the implied
12 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 * See the GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this software.
18 * If not, see <http://www.gnu.org/licenses/>.
21 #include <string.h>
23 #include "platform.h"
25 #ifdef USE_TIMER_MGMT
27 #include "drivers/dma_reqmap.h"
28 #include "drivers/timer.h"
30 #include "timerio.h"
33 Details of the TIMER_PIN_MAP macro:
34 i => is the index in the PG timer IO config array,
35 p => is the hardware pin to be mapped,
36 o => is the hardware pin occurrence (1 based index) within timerHardware (full) that should be used
37 e.g. 1 = first occurence of the pin, 2 = second occurence, etc.
38 d => the configured dma opt for the pin
40 #define TIMER_PIN_MAP(i, p, o, d) \
41 { config[i].ioTag = IO_TAG(p); config[i].index = o; config[i].dmaopt = d; }
43 PG_REGISTER_ARRAY_WITH_RESET_FN(timerIOConfig_t, MAX_TIMER_PINMAP_COUNT, timerIOConfig, PG_TIMER_IO_CONFIG, 0);
45 void pgResetFn_timerIOConfig(timerIOConfig_t *config)
47 #ifdef TIMER_PIN_MAPPING
48 TIMER_PIN_MAPPING
49 #else
50 UNUSED(config);
51 #endif
53 #endif