cancel
Showing results for 
Search instead for 
Did you mean: 

Merging flags with OR Standard peripheral library.

lipin
Associate II
Posted on September 01, 2010 at 14:05

Merging flags with OR Standard peripheral library.

5 REPLIES 5
daviddavid94
Associate II
Posted on May 17, 2011 at 14:04

Why not check the source code, and decide for yourself?

Andrew Neil
Evangelist III
Posted on May 17, 2011 at 14:04

It is only ''safe'' in so far as you ensure that the ''merged'' value is valid & meaningful in each specific case...

Posted on May 17, 2011 at 14:05

''THIS PARAMETER CAN BE ANY COMBINATION OF THE FOLLOWING''

/*******************************************************************************

* Function Name  : TIM_ClearITPendingBit

* Description    : Clears the TIMx's interrupt pending bits.

* Input          : - TIMx: where x can be 1 to 8 to select the TIM peripheral.

*                  - TIM_IT: specifies the pending bit to clear.

*                    This parameter can be any combination of the following values:

*                       - TIM_IT_Update: TIM1 update Interrupt source

*                       - TIM_IT_CC1: TIM Capture Compare 1 Interrupt source

*                       - TIM_IT_CC2: TIM Capture Compare 2 Interrupt source

*                       - TIM_IT_CC3: TIM Capture Compare 3 Interrupt source

*                       - TIM_IT_CC4: TIM Capture Compare 4 Interrupt source

*                       - TIM_IT_COM: TIM Commutation Interrupt

*                         source

*                       - TIM_IT_Trigger: TIM Trigger Interrupt source

*                       - TIM_IT_Break: TIM Break Interrupt source

* Output         : None

* Return         : None

*******************************************************************************/

void TIM_ClearITPendingBit(TIM_TypeDef* TIMx, u16 TIM_IT)

{

  /* Check the parameters */

  assert_param(IS_TIM_ALL_PERIPH(TIMx));

  assert_param(IS_TIM_PERIPH_IT(TIMx, TIM_IT));

  /* Clear the IT pending Bit */

  TIMx->SR = (u16)~TIM_IT;

}

The example sources are replete with

RCC_APB2PeriphClockCmd()

enabling multiple clocks.

The bloody awful forum software is from Microsoft.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
lipin
Associate II
Posted on May 17, 2011 at 14:05

Thank you. I guess I am skiping some informations when reading chm manual:

This parameter can be any combination of the following values.

And I always did check code and uc documentation to check if I can do this. And than even asked this obvious question. Argghh I'm sorry.

Regards

Thomas

Andrew Neil
Evangelist III
Posted on May 17, 2011 at 14:05

User litom said, ''This forum editor drive me nuts'';

User clive1 said, ''bloody awful forum software''.

Agreed! See: [DEAD LINK /public/STe2ecommunities/e2esupport/Lists/Functionality%20issues/Flat.aspx?RootFolder=/public/STe2ecommunities/e2esupport/Lists/Functionality issues/Probably the worst forum software in the world&FolderCTID=0x01200200770978C69A1141439FE559EB459D758000C1184011A4DEFF4BA0E41441DCAEC568&TopicsView=https://my.st.com/public/STe2ecommunities/e2esupport/Lists/Functionality%2520issues/AllItems.aspx&currentviews=0]https://my.st.com/public/STe2ecommunities/e2esupport/Lists/Functionality%20issues/Flat.aspx?RootFolder=%2fpublic%2fSTe2ecommunities%2fe2esupport%2fLists%2fFunctionality%20issues%2fProbably%20the%20worst%20forum%20software%20in%20the%20world&FolderCTID=0x01200200770978C69A1141439FE559EB459D758000C1184011A4DEFF4BA0E41441DCAEC568&TopicsView=https%3A%2F%2Fmy%2Est%2Ecom%2Fpublic%2FSTe2ecommunities%2Fe2esupport%2FLists%2FFunctionality%2520issues%2FAllItems%2Easpx&currentviews=0

(yes, the stupidly-long links are on the list)