DA14580 底层IO操作
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) )