这是最新(主)开发分支的文档。如果您正在查找以前版本的文档,使用左侧的下拉菜单选择所需的版本。

DT 参考

DT

enum device_status_enumeration

device status

Values:

enumerator WM_DEV_ST_UNINIT
enumerator WM_DEV_ST_INITING
enumerator WM_DEV_ST_INITED
enumerator WM_DEV_ST_UNKNOWN
typedef enum device_status_enumeration wm_device_status_t

device status

typedef struct device_structure wm_device_t

device structure

Structure of the device entity

struct device_structure

device structure

Structure of the device entity

Public Members

char *name

device name

void *hw

hardware info, ref wm_dt_hw_xxx_t

void *ops

device operation interface

void *drv

driver context data

wm_device_status_t state

device state

void *priv

user private data

wm_device_t *wm_dt_get_device_by_name(const char *device_name)

Get the device.

参数:

device_name[in] device name

返回:

  • NULL : failed

  • others: succeed

int wm_dt_set_device_table_name(const char *default_name)

Set the device table name.

警告

It must be invoked before any use of wm_dt_get_device_by_name, and will fail if invoked after wm_dt_get_device_by_name.

参数:

default_name[in] device table name

返回:

  • WM_ERR_SUCCESS : succeed

  • others : failed

int wm_dt_free_device_by_name(const char *device_name)

Free the device.

参数:

device_name[in] device name

返回:

  • WM_ERR_SUCCESS : succeed

  • others : failed

int wm_dt_free_device(wm_device_t *device)

Free the device.

参数:

device[in] device pointer

返回:

  • WM_ERR_SUCCESS : succeed

  • others : failed

int wm_dt_free_all_device(void)

Free all devices.

返回:

  • WM_ERR_SUCCESS : succeed

  • others : failed

int wm_dt_dump_all_device(void)

dump in the default serial

返回:

  • WM_ERR_SUCCESS : succeed

  • others : failed

int wm_dt_auto_init_device(void)

auto init system device

返回:

  • WM_ERR_SUCCESS : succeed

  • others : failed