diff options
Diffstat (limited to 'ports')
-rw-r--r-- | ports/ARMCM3-STM32F103/ioports_lld.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/ports/ARMCM3-STM32F103/ioports_lld.h b/ports/ARMCM3-STM32F103/ioports_lld.h index 2194c3869..fd028e4d3 100644 --- a/ports/ARMCM3-STM32F103/ioports_lld.h +++ b/ports/ARMCM3-STM32F103/ioports_lld.h @@ -108,6 +108,16 @@ typedef GPIO_TypeDef * ioportid_t; /*===========================================================================*/
/**
+ * @brief GPIO ports subsystem initialization.
+ * @details Ports A-D enabled, AFIO enabled. + */
+#define ioport_init() { \
+ RCC->APB2ENR |= RCC_APB2ENR_AFIOEN | RCC_APB2ENR_IOPAEN | \
+ RCC_APB2ENR_IOPBEN | RCC_APB2ENR_IOPCEN | \
+ RCC_APB2ENR_IOPDEN; \
+}
+
+/**
* @brief Writes a bits mask on a I/O port.
*
* @param[in] port the port identifier
|