RT-Thread RTOS  1.2.0
An open source embedded real-time operating system
rt_device Struct Reference

#include <rtdef.h>

Data Fields

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(* readlink )(rt_device_t dev, char *buf, int len)
 
void * user_data
 

Detailed Description

Device structure

Field Documentation

◆ parent

struct rt_object rt_device::parent

inherit from rt_object

◆ type

enum rt_device_class_type rt_device::type

device type

◆ flag

rt_uint16_t rt_device::flag

device flag

◆ open_flag

rt_uint16_t rt_device::open_flag

device open flag

◆ ref_count

rt_uint8_t rt_device::ref_count

reference count

◆ device_id

rt_uint8_t rt_device::device_id

0 - 255

◆ readlink

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

for dynamic device

◆ user_data

void* rt_device::user_data

device private data