fast I/O, digitalWrite vs BSRR

Post here first, or if you can't find a relevant section!
Post Reply
paksoft
Posts: 15
Joined: Sun Apr 10, 2016 3:16 am

fast I/O, digitalWrite vs BSRR

Post by paksoft » Sat Jan 06, 2018 1:16 pm

Hello Dude,
Come to fast I/O programming, I've to use

Code: Select all

GPIOA->BSRR |= GPIO_BSRR_BS5;  //Set PA5 -> High
Instead of

Code: Select all

digitalWrite(PA5, HIGH);
What are pros and cons of those above two lines?

Thanks in adv,
pak

dannyf
Posts: 228
Joined: Wed May 11, 2016 4:29 pm

Re: fast I/O, digitalWrite vs BSRR

Post by dannyf » Sat Jan 06, 2018 1:18 pm

I've to use
No.

Code: Select all

GPIOA->BSRR = GPIO_BSRR_BS5;  //Set PA5 -> High
is all it takes.

Plus, there are other ways to do it as well.

User avatar
mrburnette
Posts: 2207
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: fast I/O, digitalWrite vs BSRR

Post by mrburnette » Sun Jan 07, 2018 2:37 am

paksoft wrote:
Sat Jan 06, 2018 1:16 pm
<...>
What are pros and cons of those above two lines?

pak,

Seriously? Asking obvious questions just waste forum digital ink....

Maybe read:
http://forums.reprap.org/read.php?147,90194

Lot more results by asking Google.

Ray

Post Reply