hunting/hal/include/IHal.h
2023-09-13 08:30:23 -07:00

31 lines
749 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 create_hal_module(void);
StatusCode destroy_hal_module(void);
#ifdef __cplusplus
}
#endif
#endif