Files
kunlun/app/smart_grid/driver/cco/iot_sg_cco_drv.c

61 lines
1.9 KiB
C
Raw Normal View History

2024-09-28 14:24:04 +08:00
/****************************************************************************
Copyright(c) 2019 by Aerospace C.Power (Chongqing) Microelectronics. ALL RIGHTS RESERVED.
This Information is proprietary to Aerospace C.Power (Chongqing) Microelectronics and MAY NOT
be copied by any method or incorporated into another program without
the express written consent of Aerospace C.Power. This Information or any portion
thereof remains the property of Aerospace C.Power. The Information contained herein
is believed to be accurate and Aerospace C.Power assumes no responsibility or
liability for its use in any way and conveys no license or title under
any patent or copyright and makes no representation or warranty that this
Information is free from patent or copyright infringement.
****************************************************************************/
/* os_shim header files */
#include "os_types_api.h"
/* smart grid internal header files */
#include "iot_sg_fr.h"
#include "iot_sg_cco_drv_api.h"
#include "iot_sg_cco_drv.h"
#if (IOT_SMART_GRID_ENABLE && PLC_SUPPORT_CCO_ROLE)
#if (IOT_GW_CCO_DRIVER_ENABLE)
/* driver for state grid concentrator */
extern iot_sg_cco_drv_t g_sg_cctt_drv;
#endif
#if (IOT_NW_CCO_DRIVER_ENABLE)
extern iot_sg_cco_drv_t g_spg_cctt_drv;
#endif
extern iot_sg_cco_drv_t iot_sg_cli_drv;
iot_sg_cco_drv_t *g_cco_drv_table[IOT_SG_CCO_DRV_TABLE_SIZE] = {
#if (IOT_GW_CCO_DRIVER_ENABLE)
&g_sg_cctt_drv,
#else
NULL,
#endif
#if (IOT_NW_CCO_DRIVER_ENABLE)
&g_spg_cctt_drv,
#else
NULL,
#endif
&iot_sg_cli_drv,
NULL
};
iot_sg_cco_drv_t* iot_sg_cco_get_drv_by_id(uint8_t drv_id)
{
for (uint8_t i = 0; i < IOT_SG_CCO_DRV_TABLE_SIZE; ++i) {
if (g_cco_drv_table[i] && g_cco_drv_table[i]->drv_id == drv_id) {
return g_cco_drv_table[i];
}
}
return NULL;
}
#endif /* IOT_SMART_GRID_ENABLE && PLC_SUPPORT_CCO_ROLE */