GPIO_ToggleBits(GPIOD,GPIO_Pin_9);
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-11-09 3:46 AM
Posted on November 09, 2014 at 12:46
Dear All,
I am using CMSIS '' STM32F0-Discovery_FW_V1.0.0 '' library files for STM32F0 MCU programming which does not support GPIO_ToggleBits(GPIOD,GPIO_Pin_9); instructionI already checked the ''gpio'' file which do not have Toggle functionplease advice
This discussion is locked. Please start a new topic to ask your question.
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-11-09 7:19 AM
Posted on November 09, 2014 at 16:19
Ok, neither the F0 or F1 libraries have this. Pretty simple though, and more efficient ways of setting/clearing.
/**
* @brief Toggles the specified GPIO pins..
* @param GPIOx: where x can be (A..I) to select the GPIO peripheral.
* @param GPIO_Pin: Specifies the pins to be toggled.
* @retval None
*/
void GPIO_ToggleBits(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin)
{
/* Check the parameters */
assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
GPIOx->ODR ^= GPIO_Pin;
}
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Up vote any posts that you find helpful, it shows what's working..
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-11-09 7:43 AM
Posted on November 09, 2014 at 16:43
Dear clive
Grate thanks for the replyI used following old methodGPIOC->ODR ^= GPIO_Pin_8;Can I know the instruction base on CMSIS type