Articles
4
Home
文本处理工具
代码生成器
bes
Arduino
python
freertos
zklx
C#
xilinx
3D打印实用工具
Archives
找到我
Fun
Home
文本处理工具
代码生成器
bes
Arduino
python
freertos
zklx
C#
xilinx
3D打印实用工具
Archives
找到我
Fun
复制粘贴工程师专用工具
GPIO初始化
gpio_t xx_io; bsp_gpio_cfg_init(&xx_io,IO_PB1); iokey_cfg_port_init(&xx_io); //读 iokey_cfg_port_pressed(&xx_io); //写 static gpio_t xx_gpio; void xx_gpio_init(u8 io_num,u8 is_out)// None: 0, PA3: 4, PA4: 5, PA5: 6, PA6: 7, PA7: 8, PB0: 9, PB1: 10, PB2: 11, PB3: 12, PB4: 13, PB5/WKO: 26, PE0: 14, PE4: 18, PE5: 19, PE6: 20, PE7: 21, PF0: 22, PF1: 23, PF2: 24, PF3: 25 { gpio_t *p = &xx_gpio; bsp_gpio_cfg_init(p, io_num);//用io num初始化xx_gpio结构体 if (p->sfr == NULL) { return; } if(is_out) { p->sfr[GPIOxDE] |= BIT(p->num); p->sfr[GPIOxDIR] &= ~BIT(p->num); } else { p->sfr[GPIOxDE] |= BIT(p->num); p->sfr[GPIOxPU] |= BIT(p->num);//上拉 p->sfr[GPIOxDIR] |= BIT(p->num); } } AT(.com_text.mute) bool xx_gpio_read(void) { gpio_t *p = &xx_gpio; return (p->sfr[GPIOx] & BIT(p->num)); } AT(.com_text.mute) void xx_gpio_write(bool val) { gpio_t *p = &mute_gpio; if (p->sfr == NULL) { return; } if (val) { p->sfr[GPIOxSET] = BIT(p->num); } else { p->sfr[GPIOxCLR] = BIT(p->num); } }
LED操作
void led_cfg_port_init(gpio_t *g); void led_cfg_set_onoff(gpio_t *g, bool onoff);
mail
void msg_queue_init(void); void msg_queue_clear(void); void msg_enqueue(u16 msg); u16 msg_dequeue(void); void msg_queue_detach(u16 msg, u8 flag); //flag=0,消息池中剔除msg消息; flag=1,消息池只保留msg消息
timer
nv
i2c
zhoushenglin
Articles
4
Bookmark
Announcement
Hello!
Recent Post
WSL下安装petalinux
2022-08-19
video
2020-08-14
关于这个网站
2020-08-10
更新记录
2020-08-10
Archives
August 2022
1
August 2020
3
Info
Article :
4
UV :
PV :
2