aboutsummaryrefslogtreecommitdiffstats
path: root/ports
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-06-02 10:42:49 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-06-02 10:42:49 +0000
commit8020fc3d67244318840a337811f2f8a33185603a (patch)
treeb95aea22b1fe9cd8547151e2e4d95dd43cdb32b7 /ports
parent10ff25a6d35e23728ebb5f42788975452d8978a4 (diff)
downloadChibiOS-8020fc3d67244318840a337811f2f8a33185603a.tar.gz
ChibiOS-8020fc3d67244318840a337811f2f8a33185603a.tar.bz2
ChibiOS-8020fc3d67244318840a337811f2f8a33185603a.zip
Added initialization function to the I/O port low level driver.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1014 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'ports')
-rw-r--r--ports/ARMCM3-STM32F103/ioports_lld.h10
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