VSF Documented
Main Page
Related Pages
Topics
Namespaces
Data Structures
Files
File List
Globals
source
hal
driver
template
__series_name_a__
common
pwm
pwm.h
Go to the documentation of this file.
1
/*****************************************************************************
2
* Copyright(C)2009-2022 by VSF Team *
3
* *
4
* Licensed under the Apache License, Version 2.0 (the "License"); *
5
* you may not use this file except in compliance with the License. *
6
* You may obtain a copy of the License at *
7
* *
8
* http://www.apache.org/licenses/LICENSE-2.0 *
9
* *
10
* Unless required by applicable law or agreed to in writing, software *
11
* distributed under the License is distributed on an "AS IS" BASIS, *
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
13
* See the License for the specific language governing permissions and *
14
* limitations under the License. *
15
* *
16
****************************************************************************/
17
18
#ifndef __HAL_DRIVER_${SERIES/PWM_IP}_PWM_H__
19
#define __HAL_DRIVER_${SERIES/PWM_IP}_PWM_H__
20
21
/*============================ INCLUDES ======================================*/
22
23
#include "
hal/vsf_hal_cfg.h
"
24
25
#if VSF_HAL_USE_PWM == ENABLED
26
27
#include "../../__device.h"
28
29
/*\note Refer to template/README.md for usage cases.
30
* For peripheral drivers, blackbox mode is recommended but not required, reimplementation part MUST be open.
31
* For IPCore drivers, class structure, MULTI_CLASS configuration, reimplementation and class APIs should be open to user.
32
* For emulated drivers, **** No reimplementation ****.
33
*/
34
35
/*\note Includes CAN ONLY be put here. */
36
/*\note If current header is for a peripheral driver(hw driver), and inherit from an IPCore driver, include IPCore header here. */
37
38
// IPCore
39
#if defined(__VSF_HAL_${PWM_IP}_PWM_CLASS_IMPLEMENT)
40
# define __VSF_CLASS_IMPLEMENT__
41
#elif defined(__VSF_HAL_${PWM_IP}_PWM_CLASS_INHERIT__)
42
# define __VSF_CLASS_INHERIT__
43
#endif
44
45
#include "
utilities/ooc_class.h
"
46
// IPCore end
47
48
#ifdef __cplusplus
49
extern
"C"
{
50
#endif
51
52
/*============================ MACROS ========================================*/
53
54
/*\note VSF_${PWM_IP}_PWM_CFG_MULTI_CLASS should be implemented for IP drives and open to user,
55
* while VSF_HW_PWM_CFG_MULTI_CLASS should be in pwm.c.
56
*/
57
58
// IPCore
59
#ifndef VSF_${PWM_IP}_PWM_CFG_MULTI_CLASS
60
# define VSF_${PWM_IP}_PWM_CFG_MULTI_CLASS VSF_PWM_CFG_MULTI_CLASS
61
#endif
62
// IPCore end
63
64
/*============================ MACROFIED FUNCTIONS ===========================*/
65
/*============================ TYPES =========================================*/
66
67
// IPCore
68
vsf_class
(
vsf_$
{pwm_ip}_pwm_t) {
69
#if VSF_${PWM_IP}_CFG_MULTI_CLASS == ENABLED
70
public_member(
71
vsf_pwm_t
vsf_pwm;
72
)
73
#endif
74
75
/*\note You can add more member in vsf_${pwm_ip}_pwm_t instance.
76
* For members accessible from child, put in protected_member.
77
* Else, put in private_member.
78
*/
79
80
protected_member(
81
vsf_$
{pwm_ip}_pwm_reg_t *
reg
;
82
vsf_pwm_isr_t
isr
;
83
)
84
};
85
// IPCore end
86
87
/*============================ INCLUDES ======================================*/
88
89
// IPCore
90
/*\note Extern APIs for ip core diriver.
91
* There is no requirement about how APIs of IPCore drivers should be implemented.
92
* Just consider the simplicity for actual peripheral drivers.
93
*/
94
// IPCore end
95
96
#ifdef __cplusplus
97
}
98
#endif
99
100
// IPCore
101
#undef __VSF_HAL_${PWM_IP}_PWM_CLASS_IMPLEMENT
102
#undef __VSF_HAL_${PWM_IP}_PWM_CLASS_INHERIT__
103
// IPCore end
104
105
#endif
// VSF_HAL_USE_PWM
106
#endif
// __HAL_DRIVER_${SERIES/PWM_IP}_PWM_H__
107
/* EOF */
vsf_$
Definition
adc.h:68
ooc_class.h
vsf_class
#define vsf_class(__name)
Definition
ooc_class.h:48
vsf_pwm_t
Definition
vsf_template_pwm.h:121
isr
vsf_pwm_isr_t isr
Definition
pwm.h:83
reg
class vsf_$ * reg
vsf_hal_cfg.h
Generated by
1.9.8