Added support for ports J and K to GPIOv2.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8149 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
parent
b2ce02c741
commit
15e182dd82
|
@ -20,7 +20,7 @@
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This is a periodic thread that does absolutely nothing except flashing
|
* This is a periodic thread that does absolutely nothing except flashing
|
||||||
* a LED.
|
* a LED attached to TP1.
|
||||||
*/
|
*/
|
||||||
static THD_WORKING_AREA(waThread1, 128);
|
static THD_WORKING_AREA(waThread1, 128);
|
||||||
static THD_FUNCTION(Thread1, arg) {
|
static THD_FUNCTION(Thread1, arg) {
|
||||||
|
@ -28,9 +28,9 @@ static THD_FUNCTION(Thread1, arg) {
|
||||||
(void)arg;
|
(void)arg;
|
||||||
chRegSetThreadName("blinker");
|
chRegSetThreadName("blinker");
|
||||||
while (true) {
|
while (true) {
|
||||||
palSetPad(GPIOD, GPIOD_LED3); /* Orange. */
|
palSetPad(GPIOH, GPIOH_TP1);
|
||||||
chThdSleepMilliseconds(500);
|
chThdSleepMilliseconds(500);
|
||||||
palClearPad(GPIOD, GPIOD_LED3); /* Orange. */
|
palClearPad(GPIOH, GPIOH_TP1);
|
||||||
chThdSleepMilliseconds(500);
|
chThdSleepMilliseconds(500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -51,12 +51,9 @@ int main(void) {
|
||||||
chSysInit();
|
chSysInit();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Activates the serial driver 2 using the driver default configuration.
|
* Activates the serial driver 1 using the driver default configuration.
|
||||||
* PA2(TX) and PA3(RX) are routed to USART2.
|
|
||||||
*/
|
*/
|
||||||
sdStart(&SD2, NULL);
|
sdStart(&SD1, NULL);
|
||||||
palSetPadMode(GPIOA, 2, PAL_MODE_ALTERNATE(7));
|
|
||||||
palSetPadMode(GPIOA, 3, PAL_MODE_ALTERNATE(7));
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Creates the example thread.
|
* Creates the example thread.
|
||||||
|
@ -68,8 +65,8 @@ int main(void) {
|
||||||
* sleeping in a loop and check the button state.
|
* sleeping in a loop and check the button state.
|
||||||
*/
|
*/
|
||||||
while (true) {
|
while (true) {
|
||||||
if (palReadPad(GPIOA, GPIOA_BUTTON))
|
if (palReadPad(GPIOI, GPIOI_BUTTON_USER))
|
||||||
TestThread(&SD2);
|
TestThread(&SD1);
|
||||||
chThdSleepMilliseconds(500);
|
chThdSleepMilliseconds(500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -257,8 +257,8 @@
|
||||||
/*
|
/*
|
||||||
* SERIAL driver system settings.
|
* SERIAL driver system settings.
|
||||||
*/
|
*/
|
||||||
#define STM32_SERIAL_USE_USART1 FALSE
|
#define STM32_SERIAL_USE_USART1 TRUE
|
||||||
#define STM32_SERIAL_USE_USART2 TRUE
|
#define STM32_SERIAL_USE_USART2 FALSE
|
||||||
#define STM32_SERIAL_USE_USART3 FALSE
|
#define STM32_SERIAL_USE_USART3 FALSE
|
||||||
#define STM32_SERIAL_USE_UART4 FALSE
|
#define STM32_SERIAL_USE_UART4 FALSE
|
||||||
#define STM32_SERIAL_USE_UART5 FALSE
|
#define STM32_SERIAL_USE_UART5 FALSE
|
||||||
|
|
|
@ -57,7 +57,15 @@ const PALConfig pal_default_config = {
|
||||||
#endif
|
#endif
|
||||||
#if STM32_HAS_GPIOI
|
#if STM32_HAS_GPIOI
|
||||||
{VAL_GPIOI_MODER, VAL_GPIOI_OTYPER, VAL_GPIOI_OSPEEDR, VAL_GPIOI_PUPDR,
|
{VAL_GPIOI_MODER, VAL_GPIOI_OTYPER, VAL_GPIOI_OSPEEDR, VAL_GPIOI_PUPDR,
|
||||||
VAL_GPIOI_ODR, VAL_GPIOI_AFRL, VAL_GPIOI_AFRH}
|
VAL_GPIOI_ODR, VAL_GPIOI_AFRL, VAL_GPIOI_AFRH},
|
||||||
|
#endif
|
||||||
|
#if STM32_HAS_GPIOJ
|
||||||
|
{VAL_GPIOJ_MODER, VAL_GPIOJ_OTYPER, VAL_GPIOJ_OSPEEDR, VAL_GPIOJ_PUPDR,
|
||||||
|
VAL_GPIOJ_ODR, VAL_GPIOJ_AFRL, VAL_GPIOJ_AFRH},
|
||||||
|
#endif
|
||||||
|
#if STM32_HAS_GPIOK
|
||||||
|
{VAL_GPIOK_MODER, VAL_GPIOK_OTYPER, VAL_GPIOK_OSPEEDR, VAL_GPIOK_PUPDR,
|
||||||
|
VAL_GPIOK_ODR, VAL_GPIOK_AFRL, VAL_GPIOK_AFRH}
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -143,6 +143,8 @@
|
||||||
#undef GPIOG
|
#undef GPIOG
|
||||||
#undef GPIOH
|
#undef GPIOH
|
||||||
#undef GPIOI
|
#undef GPIOI
|
||||||
|
#undef GPIOJ
|
||||||
|
#undef GPIOK
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @name GPIO ports definitions
|
* @name GPIO ports definitions
|
||||||
|
@ -157,6 +159,8 @@
|
||||||
#define GPIOG ((stm32_gpio_t *)GPIOG_BASE)
|
#define GPIOG ((stm32_gpio_t *)GPIOG_BASE)
|
||||||
#define GPIOH ((stm32_gpio_t *)GPIOH_BASE)
|
#define GPIOH ((stm32_gpio_t *)GPIOH_BASE)
|
||||||
#define GPIOI ((stm32_gpio_t *)GPIOI_BASE)
|
#define GPIOI ((stm32_gpio_t *)GPIOI_BASE)
|
||||||
|
#define GPIOJ ((stm32_gpio_t *)GPIOJ_BASE)
|
||||||
|
#define GPIOK ((stm32_gpio_t *)GPIOK_BASE)
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
@ -251,6 +255,14 @@ typedef struct {
|
||||||
/** @brief Port I setup data.*/
|
/** @brief Port I setup data.*/
|
||||||
stm32_gpio_setup_t PIData;
|
stm32_gpio_setup_t PIData;
|
||||||
#endif
|
#endif
|
||||||
|
#if STM32_HAS_GPIOJ || defined(__DOXYGEN__)
|
||||||
|
/** @brief Port I setup data.*/
|
||||||
|
stm32_gpio_setup_t PJData;
|
||||||
|
#endif
|
||||||
|
#if STM32_HAS_GPIOK || defined(__DOXYGEN__)
|
||||||
|
/** @brief Port I setup data.*/
|
||||||
|
stm32_gpio_setup_t PKData;
|
||||||
|
#endif
|
||||||
} PALConfig;
|
} PALConfig;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue