eLooM for STM32 application  v3.3.0
A framework for multitasking low power embedded applications powerd by STM32
Loading...
Searching...
No Matches
IDriver_vtbl.h
1
24#ifndef INCLUDE_DRIVERS_IDRIVER_VTBL_H_
25#define INCLUDE_DRIVERS_IDRIVER_VTBL_H_
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
32
33
34typedef struct _IDriver_vtbl IDriver_vtbl;
35
36
37struct _IDriver_vtbl {
38 sys_error_code_t (*Init)(IDriver *_this, void *pParams);
39 sys_error_code_t (*Start)(IDriver *_this);
40 sys_error_code_t (*Stop)(IDriver *_this);
41 sys_error_code_t (*DoEnterPowerMode)(IDriver *_this, const EPowerMode eActivePowerMode, const EPowerMode eNewPowerMode);
42 sys_error_code_t (*Reset)(IDriver *_this, void *pParams);
43};
44
49struct _IDriver {
50 const IDriver_vtbl *vptr;
51};
52
53// Inline function definition.
54// ***************************
55
57sys_error_code_t IDrvInit(IDriver *_this, void *pParams) {
58 return _this->vptr->Init(_this, pParams);
59}
60
63 return _this->vptr->Start(_this);
64}
65
68 return _this->vptr->Stop(_this);
69}
70
72sys_error_code_t IDrvDoEnterPowerMode(IDriver *_this, const EPowerMode eActivePowerMode, const EPowerMode eNewPowerMode) {
73 return _this->vptr->DoEnterPowerMode(_this, eActivePowerMode, eNewPowerMode);
74}
75
77sys_error_code_t IDrvReset(IDriver *_this, void *pParams) {
78 return _this->vptr->Reset(_this, pParams);
79}
80
81#ifdef __cplusplus
82}
83#endif
84
85
86#endif /* INCLUDE_DRIVERS_IDRIVER_VTBL_H_ */
static sys_error_code_t IDrvDoEnterPowerMode(IDriver *_this, const EPowerMode eActivePowerMode, const EPowerMode eNewPowerMode)
Definition IDriver_vtbl.h:72
static sys_error_code_t IDrvReset(IDriver *_this, void *pParams)
Definition IDriver_vtbl.h:77
static sys_error_code_t IDrvStart(IDriver *_this)
Definition IDriver_vtbl.h:62
static sys_error_code_t IDrvStop(IDriver *_this)
Definition IDriver_vtbl.h:67
static sys_error_code_t IDrvInit(IDriver *_this, void *pParams)
Definition IDriver_vtbl.h:57
Umbrella header for the basic system features.
Definition IDriver_vtbl.h:49
uint16_t sys_error_code_t
Definition syserror.h:41
#define SYS_DEFINE_STATIC_INLINE
Definition systp.h:95