RT-Thread RTOS 1.2.0
An open source embedded real-time operating system
载入中...
搜索中...
未找到
rt_device结构体 参考

#include <rtdef.h>

成员变量

struct rt_object parent
 
enum rt_device_class_type type
 
rt_uint16_t flag
 
rt_uint16_t open_flag
 
rt_uint8_t ref_count
 
rt_uint8_t device_id
 
rt_err_t(* rx_indicate )(rt_device_t dev, rt_size_t size)
 
rt_err_t(* tx_complete )(rt_device_t dev, void *buffer)
 
rt_err_t(* init )(rt_device_t dev)
 
rt_err_t(* open )(rt_device_t dev, rt_uint16_t oflag)
 
rt_err_t(* close )(rt_device_t dev)
 
rt_ssize_t(* read )(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size)
 
rt_ssize_t(* write )(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size)
 
rt_err_t(* control )(rt_device_t dev, int cmd, void *args)
 
rt_err_t(* readlink )(rt_device_t dev, char *buf, int len)
 
void * user_data
 

详细描述

Device structure

在文件 rtdef.h1369 行定义.

结构体成员变量说明

◆ parent

struct rt_object rt_device::parent

inherit from rt_object

在文件 rtdef.h1371 行定义.

◆ type

enum rt_device_class_type rt_device::type

device type

在文件 rtdef.h1386 行定义.

◆ flag

rt_uint16_t rt_device::flag

device flag

在文件 rtdef.h1387 行定义.

◆ open_flag

rt_uint16_t rt_device::open_flag

device open flag

在文件 rtdef.h1388 行定义.

◆ ref_count

rt_uint8_t rt_device::ref_count

reference count

在文件 rtdef.h1390 行定义.

◆ device_id

rt_uint8_t rt_device::device_id

0 - 255

在文件 rtdef.h1394 行定义.

◆ rx_indicate

rt_err_t(* rt_device::rx_indicate) (rt_device_t dev, rt_size_t size)

在文件 rtdef.h1397 行定义.

◆ tx_complete

rt_err_t(* rt_device::tx_complete) (rt_device_t dev, void *buffer)

在文件 rtdef.h1398 行定义.

◆ init

rt_err_t(* rt_device::init) (rt_device_t dev)

在文件 rtdef.h1404 行定义.

◆ open

rt_err_t(* rt_device::open) (rt_device_t dev, rt_uint16_t oflag)

在文件 rtdef.h1405 行定义.

◆ close

rt_err_t(* rt_device::close) (rt_device_t dev)

在文件 rtdef.h1406 行定义.

◆ read

rt_ssize_t(* rt_device::read) (rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size)

在文件 rtdef.h1407 行定义.

◆ write

rt_ssize_t(* rt_device::write) (rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size)

在文件 rtdef.h1408 行定义.

◆ control

rt_err_t(* rt_device::control) (rt_device_t dev, int cmd, void *args)

在文件 rtdef.h1409 行定义.

◆ readlink

rt_err_t(* rt_device::readlink) (rt_device_t dev, char *buf, int len)

for dynamic device

在文件 rtdef.h1417 行定义.

◆ user_data

void* rt_device::user_data

device private data

在文件 rtdef.h1420 行定义.