hunting/hal/include/IHal.h
2023-08-18 21:50:35 -07:00

31 lines
751 B
C

#ifndef I_HAL_H
#define I_HAL_H
#include "StatusCode.h"
#ifdef __cplusplus
extern "C"
{
#endif
typedef struct i_hal IHal;
typedef struct i_hal
{
StatusCode (*init)(IHal *);
void (*free)(IHal *);
StatusCode (*un_init)(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 create_hal_module(void);
StatusCode destroy_hal_module(void);
#ifdef __cplusplus
}
#endif
#endif