Page 1 of 1

palWriteGroup or palWritePort for PoRT data

Posted: Sun Oct 09, 2016 8:55 am
by ep.hobbyiest
Hi,

I want to write some data on port. So, i got api' for that. But i am not sure which one to use.
i want to write data on GPIOC port. data is 16- bit.

Code: Select all

palWriteGroup (GPIOC,0xFF,0,data);
palWritePort(GPIOC,data) ;


Which one i can use.

Re: palWriteGroup or palWritePort for PoRT data

Posted: Sun Oct 09, 2016 10:46 am
by tfAteba
Hi ep.hobbyiest,

The both function allow to write you date to a Port but not in the same maner.

With PalWriteGroup, you can decide to on write a part of the port by playing with the offset parameter. If some bits don't change for example.
whereas with PalwritePort you write on all the bits of the port even those which didn't change.

For me, in your case, because of you offset of "0", you can use both API. But because you write all the bit of the port it is then better to use PalWritePort.