aboutsummaryrefslogtreecommitdiffstats
path: root/ports/ARMCM3-STM32F103
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-06-02 10:59:32 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-06-02 10:59:32 +0000
commit1aa2773ad03807e3d5c9822ea108bc2e280281db (patch)
tree80b497459a6236662487a0651c8b5164b7e7903f /ports/ARMCM3-STM32F103
parent8020fc3d67244318840a337811f2f8a33185603a (diff)
downloadChibiOS-1aa2773ad03807e3d5c9822ea108bc2e280281db.tar.gz
ChibiOS-1aa2773ad03807e3d5c9822ea108bc2e280281db.tar.bz2
ChibiOS-1aa2773ad03807e3d5c9822ea108bc2e280281db.zip
STM32 initialization cleanup.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1015 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'ports/ARMCM3-STM32F103')
-rw-r--r--ports/ARMCM3-STM32F103/ioports_lld.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/ports/ARMCM3-STM32F103/ioports_lld.h b/ports/ARMCM3-STM32F103/ioports_lld.h
index fd028e4d3..df12f4bd5 100644
--- a/ports/ARMCM3-STM32F103/ioports_lld.h
+++ b/ports/ARMCM3-STM32F103/ioports_lld.h
@@ -111,7 +111,7 @@ typedef GPIO_TypeDef * ioportid_t;
* @brief GPIO ports subsystem initialization.
* @details Ports A-D enabled, AFIO enabled.
*/
-#define ioport_init() { \
+#define ioport_init_lld() { \
RCC->APB2ENR |= RCC_APB2ENR_AFIOEN | RCC_APB2ENR_IOPAEN | \
RCC_APB2ENR_IOPBEN | RCC_APB2ENR_IOPCEN | \
RCC_APB2ENR_IOPDEN; \
@@ -201,6 +201,16 @@ typedef GPIO_TypeDef * ioportid_t;
#define ioport_readbus_lld(bus) \
(((bus)->bus_portid->IDR & (bus)->bus_mask) >> (bus)->bus_offset)
+/**
+ * @brief GPIO port setup.
+ * @details This function initializes a GPIO port, note that this functionality
+ * is STM32 specific and non portable.
+ */
+#define ioport_stm32_setup_lld(port, crh, crl) { \
+ (port)->CRH = (crh); \
+ (port)->CRL = (crl); \
+}
+
#endif /* _IOPORTS_LLD_H_ */
/** @} */