aboutsummaryrefslogtreecommitdiffstats
path: root/libmaple/gpio.h
diff options
context:
space:
mode:
Diffstat (limited to 'libmaple/gpio.h')
-rw-r--r--libmaple/gpio.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/libmaple/gpio.h b/libmaple/gpio.h
index 353f965..b15124c 100644
--- a/libmaple/gpio.h
+++ b/libmaple/gpio.h
@@ -315,6 +315,36 @@ typedef enum {
#define AFIO_MAPR2_TIM10_REMAP BIT(6)
#define AFIO_MAPR2_TIM9_REMAP BIT(5)
+/* HACK: Use upper bit to denote MAPR2, Bit 31 is reserved and
+ * not used in either MAPR or MAPR2 */
+#define AFIO_REMAP_USE_MAPR2 (1 << 31)
+typedef enum AFIORemapPeripheral {
+ AFIO_REMAP_ADC2_ETRGREG = AFIO_MAPR_ADC2_ETRGREG_REMAP,
+ AFIO_REMAP_ADC2_ETRGINJ = AFIO_MAPR_ADC2_ETRGINJ_REMAP,
+ AFIO_REMAP_ADC1_ETRGREG = AFIO_MAPR_ADC1_ETRGREG_REMAP,
+ AFIO_REMAP_ADC1_ETRGINJ = AFIO_MAPR_ADC1_ETRGINJ_REMAP,
+ AFIO_REMAP_TIM5CH4_I = AFIO_MAPR_TIM5CH4_IREMAP,
+ AFIO_REMAP_PD01 = AFIO_MAPR_PD01_REMAP,
+ AFIO_REMAP_CAN = AFIO_MAPR_CAN_REMAP,
+ AFIO_REMAP_TIM4 = AFIO_MAPR_TIM4_REMAP,
+ AFIO_REMAP_TIM3 = AFIO_MAPR_TIM3_REMAP,
+ AFIO_REMAP_TIM2 = AFIO_MAPR_TIM2_REMAP,
+ AFIO_REMAP_TIM1 = AFIO_MAPR_TIM1_REMAP,
+ AFIO_REMAP_USART3 = AFIO_MAPR_USART3_REMAP,
+ AFIO_REMAP_USART2 = AFIO_MAPR_USART2_REMAP,
+ AFIO_REMAP_USART1 = AFIO_MAPR_USART1_REMAP,
+ AFIO_REMAP_I2C1 = AFIO_MAPR_I2C1_REMAP,
+ AFIO_REMAP_SPI1 = AFIO_MAPR_SPI1_REMAP,
+ AFIO_REMAP_FSMC_NADV = AFIO_MAPR2_FSMC_NADV | AFIO_REMAP_USE_MAPR2,
+ AFIO_REMAP_TIM14 = AFIO_MAPR2_TIM14_REMAP | AFIO_REMAP_USE_MAPR2,
+ AFIO_REMAP_TIM13 = AFIO_MAPR2_TIM13_REMAP | AFIO_REMAP_USE_MAPR2,
+ AFIO_REMAP_TIM11 = AFIO_MAPR2_TIM11_REMAP | AFIO_REMAP_USE_MAPR2,
+ AFIO_REMAP_TIM10 = AFIO_MAPR2_TIM10_REMAP | AFIO_REMAP_USE_MAPR2,
+ AFIO_REMAP_TIM9 = AFIO_MAPR2_TIM9_REMAP | AFIO_REMAP_USE_MAPR2
+} AFIORemapPeripheral;
+
+void afio_remap(AFIORemapPeripheral p);
+
/*
* AFIO convenience routines
*/