RT-Thread设备驱动框架

RT-Thread设备驱动框架

1、什么是I/O设备?

I/O设备是input/output设备,串口,定时器,adc,i2c,spi,flash,SD,USB等都是I/O设备。

2、rt-thread怎么管理I/O设备?

RT-Thread设计了I/O设备框架。从上到下共有3层。
应用
设备管理层
设备驱动框架层
设备驱动

硬件

2.1设备管理层

设备管理层统一定义了6个设备操作接口,具体到某类设备的话,可能只用到其中的部分接口。

#define device_init     (dev->ops->init)
#define device_open     (dev->ops->open)
#define device_close    (dev->ops->close)
#define device_read     (dev->ops->read)
#define device_write    (dev->ops->write)
#define device_control  (dev->ops->control)

你可能感兴趣的:(RT-Thread,单片机)