hunting/hal/include/IHal.h
2023-11-17 07:46:03 -08:00

24 lines
650 B
C

#ifndef IHAL_H
#define IHAL_H
#include "StatusCode.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct i_hal IHal;
typedef struct i_hal
{
StatusCode (*init)(IHal *);
StatusCode (*un_init)(IHal *);
void (*free)(IHal *);
} IHal;
IHal *GetHalIntance(void);
StatusCode NewIHal(IHal **object);
void ResetHalImpl(IHal *impl);
static inline StatusCode IHalInit(void) { return GetHalIntance()->init(GetHalIntance()); }
static inline StatusCode IHalUnInit(void) { return GetHalIntance()->un_init(GetHalIntance()); }
StatusCode CreateHalModule(void);
StatusCode DestroyHalModule(void);
#ifdef __cplusplus
}
#endif
#endif