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
This commit is contained in:
parent
10ff25a6d3
commit
8020fc3d67
|
@ -61,7 +61,7 @@ void hwinit0(void) {
|
|||
/*
|
||||
* I/O ports initialization as specified in board.h.
|
||||
*/
|
||||
RCC->APB2ENR = 0x0000003D; // Ports A-D enabled, AFIO enabled.
|
||||
ioport_init();
|
||||
GPIOA->CRL = VAL_GPIOACRL;
|
||||
GPIOA->CRH = VAL_GPIOACRH;
|
||||
GPIOA->ODR = VAL_GPIOAODR;
|
||||
|
|
|
@ -107,6 +107,16 @@ typedef GPIO_TypeDef * ioportid_t;
|
|||
/* functions, please put them in a file named ioports_lld.c if so. */
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @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.
|
||||
*
|
||||
|
|
|
@ -65,6 +65,14 @@ typedef uint32_t ioportid_t;
|
|||
/* functions, please put them in a file named ioports_lld.c if so. */
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief I/O ports subsystem initialization.
|
||||
*
|
||||
* @note This function is not invoked by a system API, it should be invoked
|
||||
* from the system initialization code.
|
||||
*/
|
||||
#define ioport_init()
|
||||
|
||||
/**
|
||||
* @brief Writes a bits mask on a I/O port.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue