palWritePort & palWritePad

mculover
2010-11-13
2013-04-06
  • mculover
    mculover
    2010-11-13

    Hi Giovanni,

    I confuse about palWritePort and palWritePad,

    What is difference between Port and Pad ?.
    Which one is good choice ?.
    What is function to do like these ?.
    GPIO_WriteBit (GPIOB, GPIO_Pin_8 | GPIO_Pin_9 | GPIO_Pin_10 , Bit_SET);

    Thanks you.
    mculover

     
  • Hi,

    palWritePort() writes a whole GPIO port, palWritePad() writes a single bit (by position 0…15).

    I think the closest equivalent to GPIO_WriteBit(…, Bit_SET) is:

    palSetPort(GPIOB, GPIO_Pin_8 | GPIO_Pin_9 | GPIO_Pin_10);

    This function sets the specified bits to 1 but does not touch the others.

    Giovanni

     
  • mculover
    mculover
    2010-11-13

    Thanks you very much.
    :D