用GPIO翻转方式喂狗外部watchdog

Nuvoton_N329 |浏览220次
检举|收藏|2022/09/07 17:02
全部回答(1)
  •  NUC980 sample code

    "#include <mach/regs-gpio.h>

    #define GPIO_PIN_DATA(port, pin)    (*((volatile uint32_t *)((GPIO_PIN_DATA_BASE+(0x40*(port))) + ((pin)<<2))))

    #define GPIO_OFFSET 0x20

    Wdt 驱动中

    #define PC14 0x4E

    Port = PC14/ GPIO_OFFSET

    Pin=PC14% GPIO_OFFSET

     

    If(GPIO_PIN_DATA(Port, Pin)==1)

           GPIO_PIN_DATA(Port, Pin)=0;

    else

           GPIO_PIN_DATA(Port, Pin)=1;

    ""

    回答于 2022/09/08 10:32
0人关注该问题
 加载中...