
#include "extern.h"
#include "TLE94x1.h"
#include <string.h>
#include "drivers/reset/reset_drv.h"
#include "mcu.h"

static const unsigned char SW_VERSION[16] = "SW0101_20240510";
static const unsigned char HW_VERSION[8] = "HW01";
extern McuType mcu;

void getSW_VERSION(unsigned char *pdata)
{
    memcpy(pdata, SW_VERSION, sizeof(SW_VERSION));
}

void getHW_VERSION(unsigned char *pdata)
{
    memcpy(pdata, HW_VERSION, sizeof(HW_VERSION));
}

void getBuildTime(unsigned char *pdata)
{
    memcpy(pdata, (unsigned char *)0x00010410, 12);
    memcpy(pdata + 12,  (unsigned char *)0x00010404, 8);
    pdata[11] = ' ';
}

void extHardwareReset(void)
{
    SBC_Write_RegField(SBC_M_S_CTRL, SBC_M_S_CTRL_MODE_Msk, SBC_M_S_CTRL_MODE_Pos, SBC_MODE_RESET, NULL);
}
void extSortwareReset(void)
{
    ResetDrv_SoftwareResetModule(&mcu.resetDrv,RESETDRV_SWRESET_SYS);
}