RT-Thread RTOS
1.2.0
An open source embedded real-time operating system
载入中...
搜索中...
未找到
platform.h
浏览该文件的文档.
1
/*
2
* Copyright (c) 2006-2021, RT-Thread Development Team
3
*
4
* SPDX-License-Identifier: Apache-2.0
5
*
6
* Change Logs:
7
* Date Author Notes
8
* 2023-04-12 ErikChan the first version
9
* 2023-10-13 zmshahaha distinguish ofw and none-ofw situation
10
*/
11
12
#ifndef __PLATFORM_H__
13
#define __PLATFORM_H__
14
15
#include <
drivers/ofw.h
>
16
#include <drivers/core/driver.h>
17
18
struct
rt_platform_device
19
{
20
struct
rt_device
parent
;
21
22
int
dev_id
;
23
24
const
char
*
name
;
25
const
struct
rt_ofw_node_id
*
id
;
26
27
void
*
priv
;
28
};
29
30
struct
rt_platform_driver
31
{
32
struct
rt_driver
parent
;
33
34
const
char
*
name
;
35
const
struct
rt_ofw_node_id
*
ids
;
36
37
rt_err_t
(*
probe
)(
struct
rt_platform_device
*pdev);
38
rt_err_t
(*
remove
)(
struct
rt_platform_device
*pdev);
39
rt_err_t
(*
shutdown
)(
struct
rt_platform_device
*pdev);
40
};
41
42
struct
rt_platform_device
*
rt_platform_device_alloc
(
const
char
*
name
);
43
44
rt_err_t
rt_platform_driver_register
(
struct
rt_platform_driver
*pdrv);
45
rt_err_t
rt_platform_device_register
(
struct
rt_platform_device
*pdev);
46
47
rt_err_t
rt_platform_ofw_device_probe_child
(
struct
rt_ofw_node
*np);
48
rt_err_t
rt_platform_ofw_request
(
struct
rt_ofw_node
*np);
49
rt_err_t
rt_platform_ofw_free
(
struct
rt_platform_device
*pdev);
50
51
#define RT_PLATFORM_DRIVER_EXPORT(driver) RT_DRIVER_EXPORT(driver, platform, BUILIN)
52
53
#endif
/* __PLATFORM_H__ */
ofw.h
rt_platform_ofw_free
rt_err_t rt_platform_ofw_free(struct rt_platform_device *pdev)
rt_platform_device_register
rt_err_t rt_platform_device_register(struct rt_platform_device *pdev)
rt_platform_device_alloc
struct rt_platform_device * rt_platform_device_alloc(const char *name)
rt_platform_ofw_request
rt_err_t rt_platform_ofw_request(struct rt_ofw_node *np)
rt_platform_ofw_device_probe_child
rt_err_t rt_platform_ofw_device_probe_child(struct rt_ofw_node *np)
rt_platform_driver_register
rt_err_t rt_platform_driver_register(struct rt_platform_driver *pdrv)
rt_err_t
rt_base_t rt_err_t
定义
rttypes.h:84
rt_device
定义
rtdef.h:1370
rt_ofw_node_id
定义
ofw.h:69
rt_ofw_node
定义
ofw.h:33
rt_platform_device
定义
platform.h:19
rt_platform_device::id
const struct rt_ofw_node_id * id
定义
platform.h:25
rt_platform_device::priv
void * priv
定义
platform.h:27
rt_platform_device::name
const char * name
定义
platform.h:24
rt_platform_device::parent
struct rt_device parent
定义
platform.h:20
rt_platform_device::dev_id
int dev_id
定义
platform.h:22
rt_platform_driver
定义
platform.h:31
rt_platform_driver::ids
const struct rt_ofw_node_id * ids
定义
platform.h:35
rt_platform_driver::remove
rt_err_t(* remove)(struct rt_platform_device *pdev)
定义
platform.h:38
rt_platform_driver::parent
struct rt_driver parent
定义
platform.h:32
rt_platform_driver::probe
rt_err_t(* probe)(struct rt_platform_device *pdev)
定义
platform.h:37
rt_platform_driver::name
const char * name
定义
platform.h:34
rt_platform_driver::shutdown
rt_err_t(* shutdown)(struct rt_platform_device *pdev)
定义
platform.h:39
components
drivers
include
drivers
platform.h
制作者
1.13.1