Files
microchip-application-bmd38…/sw_drv.c
T

63 lines
923 B
C

#include "app_config.h"
#include "sw_drv.h"
#if (DEF_ADGS1412_ENABLED)
#include "adgs1412.h"
const sw_drv_if_t *p_inst = &adgs1412;
#else
const sw_drv_if_t *p_inst = NULL;
#endif /* ! DEF_ADGS1412_ENABLED */
#if (DEF_SW_DRV_ENABLED)
int sw_init(void)
{
if (p_inst == NULL)
{
return SW_DRV_ERROR;
}
return p_inst->init();
}
int sw_reset(void)
{
if (p_inst == NULL)
{
return SW_DRV_ERROR;
}
return p_inst->reset();
}
int sw_write(sw_t sw_mask)
{
if (p_inst == NULL)
{
return SW_DRV_ERROR;
}
return p_inst->write(sw_mask);
}
int sw_read(sw_t *p_sw_mask)
{
if (p_inst == NULL)
{
return SW_DRV_ERROR;
}
return p_inst->read(p_sw_mask);
}
int sw_count(uint32_t *p_sw_count)
{
if (p_inst == NULL)
{
return SW_DRV_ERROR;
}
return p_inst->get_sw_count(p_sw_count);
}
#endif /* ! DEF_SW_DRV_ENABLED */