initial commit
This commit is contained in:
57
hal/hal_rf433/hal_interface_rf433.c
Executable file
57
hal/hal_rf433/hal_interface_rf433.c
Executable file
@@ -0,0 +1,57 @@
|
||||
/********************************************************************************************/
|
||||
/* 白泽平台硬件适配层(HAL) RF433 接口实现C文件. */
|
||||
/* BAIZE Platform Adaptater Layer (PAL) RF433 interface implement C file */
|
||||
/* */
|
||||
/* 定义音频对外接口函数实现 */
|
||||
/* Define RF433 external interface function implementation */
|
||||
/* */
|
||||
/* Copyright (C) 2020 Anker Innovations Co.,Ltd */
|
||||
/********************************************************************************************/
|
||||
|
||||
/* History
|
||||
2021-03-16 amir.liang 建立初始文件
|
||||
*/
|
||||
|
||||
#include "hal_interface.h"
|
||||
#include "hal_product_config.h"
|
||||
#include "hal_interface_rf433.h"
|
||||
|
||||
|
||||
#ifndef HAL_CFG_RF433_TYPE
|
||||
#error HAL_CFG_RF433_TYPE undefined!!! Go to "hal_gernerate_product_config_h.sh" settings
|
||||
#endif
|
||||
|
||||
#if (HAL_CFG_RF433_TYPE == HAL_CFG_RF433_TYPE_T31)
|
||||
#include "rf433/rf433.h"
|
||||
#endif
|
||||
|
||||
ST_HAL_RF433_INTERFACE g_HAL_RF433_Itf[] =
|
||||
{
|
||||
#if (HAL_CFG_RF433_TYPE == HAL_CFG_RF433_TYPE_T31)
|
||||
{
|
||||
.pfnInit = HAL_RF433_Init,
|
||||
.pfnDeinit = HAL_RF433_Deinit,
|
||||
.pfnSetPowerEnable = HAL_RF433_SetPowerEnable,
|
||||
.pfnSetRFEnable = HAL_RF433_SetRFEnable,
|
||||
.pfnSetChimeBind = HAL_RF433_SetChimeBind,
|
||||
},
|
||||
#endif
|
||||
};
|
||||
|
||||
ST_HAL_RF433_INTERFACE * HAL_RF433_GetInterface(int32_t Channel)
|
||||
{
|
||||
#if (HAL_CFG_RF433_TYPE == HAL_TYPE_NONE)
|
||||
return NULL;
|
||||
#else
|
||||
HAL_ITF_INDEX idx = HAL_SELF;
|
||||
if (Channel == HAL_CHANNEL_SELF) {
|
||||
idx = HAL_SELF;
|
||||
} else {
|
||||
// 需要从NV获取通道号Channel对应的设备类型对应的hal
|
||||
//idx = HAL_REMOTE_SUB1G;
|
||||
return NULL;
|
||||
}
|
||||
return &g_HAL_RF433_Itf[idx];
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user