From 1aa2773ad03807e3d5c9822ea108bc2e280281db Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 2 Jun 2009 10:59:32 +0000 Subject: STM32 initialization cleanup. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1015 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- ports/ARMCM3-STM32F103/ioports_lld.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'ports/ARMCM3-STM32F103') 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_ */ /** @} */ -- cgit v1.2.3