blob: ad27bbaf05edf54a515746159d568b9ff496533c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
|
/*
* Copyright : (C) 2022 Phytium Information Technology, Inc.
* All Rights Reserved.
*
* This program is OPEN SOURCE software: you can redistribute it and/or modify it
* under the terms of the Phytium Public License as published by the Phytium Technology Co.,Ltd,
* either version 1.0 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the Phytium Public License for more details.
*
*
* FilePath: fooxx.h
* Date: 2022-02-10 14:53:42
* LastEditTime: 2022-02-18 08:25:35
* Description: This files is for
*
* Modify History:
* Ver Who Date Changes
* ----- ------ -------- --------------------------------------
*/
#ifndef DRIVERS_模块名_FOOXX_H
#define DRIVERS_模块名_FOOXX_H
#ifdef __cplusplus
extern "C"
{
#endif
/***************************** Include Files *********************************/
#include "ftypes.h"
#include "fassert.h"
/************************** Constant Definitions *****************************/
/* Configuration options */
#define FOOXX_OPTION_XX
/* Operational Mode */
#define FOOXX_OPER_MODE_XX
/**************************** Type Definitions *******************************/
/**
* This typedef contains configuration information for the device.
*/
typedef struct
{
u32 instance_id; /**< Device instance id */
uintptr base_addr; /**< Device base address */
} FooxxConfig;
/**
* This typedef contains driver instance data. The user is required to allocate a
* variable of this type for every device in the system. A pointer
* to a variable of this type is then passed to the driver API functions.
*/
typedef struct
{
FooxxConfig config; /**< Current active configs */
u32 is_ready; /**< Device is initialized and ready */
} Fooxx; /**< Device instance */
/************************** Variable Definitions *****************************/
/***************** Macros (Inline Functions) Definitions *********************/
/************************** Function Prototypes ******************************/
/**
* @name: FXxxLookupConfig
* @msg: Get the device instance default configure
* @return {*}
* @param {u32} instance_id
*/
const FooxxConfig *FXxxLookupConfig(u32 instance_id);
/*
* @name: FooxxCfgInitialize
* @msg: Initializes a specific instance such that it is ready to be used.
* @param {Fooxx} *instance_p is a pointer to the driver instance.
* @param {FooxxConfig} *config_p is a reference to a structure containing information
* about a specific driver.
* @return SUCCESS if initialization was successful
* ERROR
*/
FError FooxxCfgInitialize(Fooxx *instance_p, const FooxxConfig *cofig_p);
/**
* @name: FooxxDeInitialize
* @msg: DeInitialization function for the device instance
* @return {*}
* @param {Fooxx} *instance_p
*/
void FooxxDeInitialize(Fooxx *instance_p);
#ifdef __cplusplus
}
#endif
#endif
|