DA14580 底层IO操作

版权声明:本文为博主原创加整合,欢迎大家转载,转载注明出处。 https://blog.csdn.net/jiangchao3392/article/details/88654839

GPIO端口:P28  (即P2_8)寄存器地址:0x50003056

通过对底层 P2_8 的控制。

如:GPIO_SetPinFunction   P2_8 为 Output

SetWord16(0x50003056, 0x0300);      //GPIO_SetPinFunction   P2_8

意为设置16位寄存器0x50003056的值为0x0300,   即可配置 P2_8 为输出。

附:

SetWord16的定义

    #define SetWord8(a,d)       (* ( volatile uint8*) (a)=(d) )
    #define SetWord16(a,d)      (* ( volatile uint16*)(a)=(d) )
    #define SetWord32(a,d)      (* ( volatile uint32*)(a)=(d) )
    #define SetWord64(a,d)      (* ( volatile uint64*)(a)=(d) )

猜你喜欢

转载自blog.csdn.net/jiangchao3392/article/details/88654839
今日推荐