2012-10-13 11:22 AM
when I build my project,an error ''User\main.c(12): error: &sharp136: struct ''<unnamed>'' has no field ''BSRR'' '' was appeared .
k yes,I check the '' STM32F2xx_StdPeriph_Lib_V1.1.0 '' of STM32F2XX , it doesn't exits the BSRR but BSRRL and BSRRH.as follows://in the stm32f2xx.h
typedef struct { __IO uint32_t MODER; /*!< GPIO port mode register, Address offset: 0x00 */ __IO uint32_t OTYPER; /*!< GPIO port output type register, Address offset: 0x04 */ __IO uint32_t OSPEEDR; /*!< GPIO port output speed register, Address offset: 0x08 */ __IO uint32_t PUPDR; /*!< GPIO port pull-up/pull-down register, Address offset: 0x0C */ __IO uint32_t IDR; /*!< GPIO port input data register, Address offset: 0x10 */ __IO uint32_t ODR; /*!< GPIO port output data register, Address offset: 0x14 */ __IO uint16_t BSRRL; /*!< GPIO port bit set/reset low register, Address offset: 0x18 */ __IO uint16_t BSRRH; /*!< GPIO port bit set/reset high register, Address offset: 0x1A */ __IO uint32_t LCKR; /*!< GPIO port configuration lock register, Address offset: 0x1C */ __IO uint32_t AFR[2]; /*!< GPIO alternate function registers, Address offset: 0x24-0x28 */ } GPIO_TypeDef;But all the Manual Reference incluces the latest mention the GPIOx_BSRR and tell the user how to use it .
No any document indicate the BSRRH and BSRRL . And now,for the mismatch between the latest Manual Reference(RM0033) and its STM32F2xx_StdPeriph_Lib , I don't know how to solve it?who tells me?
thanks.---------David
mailto:---------hao741100265@gmail.com
#help-bsrr-bsrrl-bsrrh2012-10-13 12:39 PM
2012-10-13 05:35 PM
You could also cast it to 32-bit and set/reset multiple bits atomically.
2012-10-13 10:14 PM
2012-10-14 04:00 AM
*((__IO uint32_t *)&GPIOx->BSRRL) = 0x10002000;
[DEAD LINK /public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/STM32F4 Bit Set Reset Register&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B¤tviews=200]https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=%2Fpublic%2FSTe2ecommunities%2Fmcu%2FLists%2Fcortex_mx_stm32%2FSTM32F4%20Bit%20Set%20Reset%20Register&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B¤tviews=200