mirror of
https://gitee.com/jiuyilian/embedded-framework.git
synced 2025-01-06 10:16:51 -05:00
39 lines
1.2 KiB
C
39 lines
1.2 KiB
C
#ifndef HAL_MAKE_PTR_H
|
|
#define HAL_MAKE_PTR_H
|
|
#include "ReturnCode.h"
|
|
#include "i_hal.h"
|
|
/*
|
|
** Make sure we can call this stuff from C++.
|
|
*/
|
|
#ifdef __cplusplus
|
|
extern "C"
|
|
{
|
|
#endif
|
|
typedef struct hal_make_ptr HalMakePtr;
|
|
typedef struct hal_make_ptr
|
|
{
|
|
RETURN_CODE_C (*init)(HalMakePtr *);
|
|
RETURN_CODE_C (*create_hal_instance)(HalMakePtr *, IHal **);
|
|
void (*free)(HalMakePtr *);
|
|
RETURN_CODE_C (*un_init)(HalMakePtr *);
|
|
} HalMakePtr;
|
|
HalMakePtr *get_hal_make_ptr_instance(void);
|
|
void hal_make_ptr_object_init(HalMakePtr *object);
|
|
void reset_hal_make_ptr_impl(HalMakePtr *impl);
|
|
static inline RETURN_CODE_C hal_make_ptr_init(void)
|
|
{
|
|
return get_hal_make_ptr_instance()->init(get_hal_make_ptr_instance());
|
|
}
|
|
static inline RETURN_CODE_C hal_make_ptr_un_init(void)
|
|
{
|
|
return get_hal_make_ptr_instance()->un_init(get_hal_make_ptr_instance());
|
|
}
|
|
static inline RETURN_CODE_C create_hal_instance(IHal **hal)
|
|
{
|
|
return get_hal_make_ptr_instance()->create_hal_instance(get_hal_make_ptr_instance(), hal);
|
|
}
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif |