Skip to main content
Marek Nowak_2
Visitor II
Jul 4, 2018 6:38 PM UTC
Question

Deinit one pin - is it possible?

Posted on July 04, 2018 at 20:38

Hello, I have one question: Is it possible to deinit one pin instead of whole port? I have STM8S00F3 and ST Visual Develop.

    This topic has been closed for replies.

    2 replies

    henry.dick
    Associate II
    Jul 4, 2018 11:44 PM UTC
    Posted on July 05, 2018 at 01:44

    '

    Is it possible to deinit one pin instead of whole port?'

    the answer depends on your or your toolchain's definition of 'deinit'.

    Associate III
    Jul 5, 2018 8:34 AM UTC
    Posted on July 05, 2018 at 10:34

    Yes. It is very simple by using HAL driver. See example how to do it. .../STM8S_StdPeriph_Lib/Project/STM8S_StdPeriph_Examples/GPIO/GPIO_Toggle/main.c   I'll add. To deinitialize a single port pin, use the function with  GPIO_Init(...) with mode GPIO_MODE_IN_FL_NO_IT. It is equivalent to deinit. I wish you success.