Commit ae63e8ab authored by 时昊's avatar 时昊

feat:首次上传

parent caf01fcd
/Firmware/Project/Cmsemicon/BAT32A239/MDK_ARM/Objects
/Firmware/Project/Cmsemicon/BAT32A239/MDK_ARM/Listings
/Firmware/Project/Cmsemicon/BAT32A239/MDK_ARM/JLinkLog.txt
/.vscode
*.zip
*.7z
/Firmware/Project/Cmsemicon/BAT32A239/MDK_ARM/*.tyw05
/Firmware/Project/Cmsemicon/BAT32A239/MDK_ARM/*.tyw05
/Firmware/Project/Cmsemicon/BAT32A239/MDK_ARM/*.tyw05
Firmware/Project/Cmsemicon/BAT32A239/MDK_ARM/RunTong.uvoptx
/Firmware/Project/Cmsemicon/BAT32A239/MDK_ARM/*.uvoptx
/Firmware/Project/Cmsemicon/BAT32A239/MDK_ARM/*.VMW10
Firmware/Project/Cmsemicon/BAT32A279/MDK_ARM/Listings/HaoJin.map
/Firmware/Project/Cmsemicon/BAT32A279/MDK_ARM/Objects
<?xml version="1.0" encoding="utf-8"?>
<component_viewer schemaVersion="0.1" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="Component_Viewer.xsd">
<component name="EventRecorderStub" version="1.0.0"/> <!--name and version of the component-->
<events>
</events>
</component_viewer>
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
[BREAKPOINTS]
ForceImpTypeAny = 0
ShowInfoWin = 1
EnableFlashBP = 2
BPDuringExecution = 0
[CFI]
CFISize = 0x00
CFIAddr = 0x00
[CPU]
MonModeVTableAddr = 0xFFFFFFFF
MonModeDebug = 0
MaxNumAPs = 0
LowPowerHandlingMode = 0
OverrideMemMap = 0
AllowSimulation = 1
ScriptFile=""
[FLASH]
RMWThreshold = 0x400
Loaders=""
EraseType = 0x00
CacheExcludeSize = 0x00
CacheExcludeAddr = 0x00
MinNumBytesFlashDL = 0
SkipProgOnCRCMatch = 1
VerifyDownload = 1
AllowCaching = 1
EnableFlashDL = 2
Override = 1
Device="Cortex-M0+"
[GENERAL]
WorkRAMSize = 0x00
WorkRAMAddr = 0x00
RAMUsageLimit = 0x00
[SWO]
SWOLogFile=""
[MEM]
RdOverrideOrMask = 0x00
RdOverrideAndMask = 0xFFFFFFFF
RdOverrideAddr = 0xFFFFFFFF
WrOverrideOrMask = 0x00
WrOverrideAndMask = 0xFFFFFFFF
WrOverrideAddr = 0xFFFFFFFF
[RAM]
VerifyDownload = 0x00
[MEM_MAP]
[DYN_MEM_MAP]
NumUserRegion = 0x00
/*
* Auto generated Run-Time-Environment Configuration File
* *** Do not modify ! ***
*
* Project: 'HaoJin'
* Target: 'HaoJin232'
*/
#ifndef RTE_COMPONENTS_H
#define RTE_COMPONENTS_H
/*
* Define the Device Header File:
*/
#define CMSIS_device_header "BAT32A279.h"
#endif /* RTE_COMPONENTS_H */
/*
* Auto generated Run-Time-Environment Configuration File
* *** Do not modify ! ***
*
* Project: 'HaoJin750TFT'
* Target: 'HaoJin750'
*/
#ifndef RTE_COMPONENTS_H
#define RTE_COMPONENTS_H
/*
* Define the Device Header File:
*/
#define CMSIS_device_header "BAT32A279.h"
#endif /* RTE_COMPONENTS_H */
/*
* Auto generated Run-Time-Environment Configuration File
* *** Do not modify ! ***
*
* Project: 'HaoJin750TFT'
* Target: 'HaoJin750TFT'
*/
#ifndef RTE_COMPONENTS_H
#define RTE_COMPONENTS_H
/*
* Define the Device Header File:
*/
#define CMSIS_device_header "BAT32A279.h"
#endif /* RTE_COMPONENTS_H */
{
"files.associations": {
"n32a455_exti.h": "c",
"n32a455_pwr.h": "c",
"n32a455_iwdg.h": "c"
}
}
\ No newline at end of file
#include "BackLight.h"
#include "Components.h"
#define BACK_LIGHT_DAY 600
#define BACK_LIGHT_NIGHT 200
#define BACK_LIGHT_Val_1 100
#define BACK_LIGHT_Val_2 200
#define BACK_LIGHT_Val_3 400
#define BACK_LIGHT_Val_4 600
#define BACK_LIGHT_Val_5 800
_Light g_Light;
void BackLight_Init(void)
{
MenuInfor.BackLight_Val = BackLight_Val_2;
g_Light.Light_Auto = 0XFFFF;
}
void BackLight_Process(void)
{
if (SYS_OPR_STAT_IGN_ON)
{
if(MenuInfor.BackLight_Val == BackLight_Val_A)
{
//g_Light.Light_Auto = ALS_Get_Data1();
if (g_Light.Light_Auto >= 1000)
{
g_Light.Light_Auto = 1000;
}
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, g_Light.Light_Auto);
}
else if(MenuInfor.BackLight_Val == BackLight_Val_1)
{
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, BACK_LIGHT_Val_1);
}
else if(MenuInfor.BackLight_Val == BackLight_Val_2)
{
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, BACK_LIGHT_Val_2);
}
else if(MenuInfor.BackLight_Val == BackLight_Val_3)
{
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, BACK_LIGHT_Val_3);
}
else if(MenuInfor.BackLight_Val == BackLight_Val_4)
{
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, BACK_LIGHT_Val_4);
}
else if(MenuInfor.BackLight_Val == BackLight_Val_5)
{
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, BACK_LIGHT_Val_5);
}
else
{
;
}
}
else
{
g_Light.Light_Auto = 0;
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, 0);
}
}
#ifndef _BACKLIGHT_H_
#define _BACKLIGHT_H_
#include "common.h"
typedef struct
{
uint16_t Light_Auto;
} _Light;
extern _Light g_Light;
void BackLight_Init(void);
void BackLight_Process(void);
#endif
This diff is collapsed.
#ifndef _COMMON_INTERFACE_H_
#define _COMMON_INTERFACE_H_
#include "stdint.h"
/*COMMON INTERFACE*/
typedef enum
{
CAN_SIG_NORMAL = 0u,
CAN_SIG_LOST = 0x55U,
} CAN_MSG_Status_t;
typedef enum
{
EX_OK = 0u,
EX_ERR,
} _Fun_Res;
typedef enum
{
COMMON_POWER_OFF = 0x00u,
COMMON_POWER_ON = 0x01u,
COMMON_POWER_UNKNOW = 0xFFu,
} COMMON_PowerStatus_t;
typedef enum
{
COMMON_InValid = 0X00U,
COMMON_Valid = 0X01U,
COMMON_Valid_UNKNOW = 0XFFU,
} DataValid_t;
typedef enum
{
CAN_MSG_TX_CYCLE = 0u,
CAN_MSG_TX_CYCKE_EVENT,
} CAN_TX_Type_t;
typedef enum
{
MSG_STD = 0u,
MSG_EXT,
} CAN_MSG_FORMAT_t;
/*COMMON INTERFACE END*/
typedef enum
{
Bus_Sleep_Mode,
Pre_Bus_Sleep_Mode,
Network_Mode,
} NM_Mode_t;
extern void Common_DataInit(void);
extern void Common_Input_Para(void);
extern uint8_t Common_Get_IG_Sts(void);
extern DataValid_t Common_Get_IG_Sts_Valid(void);
extern void Common_Set_IG_Sts(COMMON_PowerStatus_t Val);
extern void Common_Set_IG_Sts_Valid(DataValid_t Val);
extern uint16_t Common_Get_Act_V_Speed(void);
extern uint16_t Common_Get_Disp_V_Speed(void);
extern DataValid_t Common_Get_Act_V_Speed_Valid(void);
extern DataValid_t Common_Get_Disp_V_Speed_Valid(void);
extern void Common_Set_Act_V_Speed(uint16_t Val);
extern void Common_Set_Disp_V_Speed(uint16_t Val);
extern uint16_t Common_Get_TireSize(void);
extern void Common_Set_Act_V_Speed_Valid(DataValid_t Val);
extern void Common_Set_Disp_V_Speed_Valid(DataValid_t Val);
extern uint16_t Common_Get_DispSpeed(void);
extern uint32_t Common_GetIgnOnTime(void); /*ms*/
extern uint32_t Common_GetIgnOffTime(void); /*ms*/
extern uint16_t Common_Get_Act_V_Speed_Limit(void);
extern uint32_t Data_Km_To_Mile(uint32_t Km);
extern uint32_t Data_Mile_To_Km(uint32_t Mile);
void Data_SwapWord(uint32_t *pData1, uint32_t *pData2);
void Data_SortNWord(uint32_t *SortData, uint32_t len);
#endif
This diff is collapsed.
#ifndef DATA_FUEL_H
#define DATA_FUEL_H
#include "stdint.h"
typedef enum{
FuelSensorNormal = 0,
FuelSensorShortCircuit,
FuelSensorOpenCircuit,
}FuelSensorSts_t;
extern void Fuel_KL15_Init(void);
extern void Fuel_KL30_Init(void);
extern void Fuel_Cal_Sevice(uint8_t deltaTime);
extern uint8_t Get_CurFuelSetp(void);
extern FuelSensorSts_t Get_Fuel_Sensor_State(void);
void Fuel_R_Cal(uint8_t deltaTime);
#endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/**
* @file Protocol_CRC16.c
* @brief CRC16计算
* @details CRC16计算
* @author myliu
* @date 2022.05.09
* @version V1.0
* @copyright myiu
*/
#include "Protocol_CRC16.h"
static const Protocol_uint8_t CRC16_TAB_H [ 256 ] = {0x00u, 0xC1u, 0x81u, 0x40u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x00u, 0xC1u, 0x81u, 0x40u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x01u, 0xC0u, 0x80u, 0x41u, 0x00u, 0xC1u, 0x81u, 0x40u};
static const Protocol_uint8_t CRC16_TAB_L [ 256 ] = {0x00u, 0xC0u, 0xC1u, 0x01u, 0xC3u, 0x03u, 0x02u, 0xC2u, 0x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, 0x68u, 0x78u, 0xB8u, 0xB9u, 0x79u, 0xBBu, 0x7Bu, 0x7Au, 0xBAu, 0xBEu, 0x7Eu, 0x7Fu, 0xBFu, 0x7Du, 0xBDu, 0xBCu, 0x7Cu, 0xB4u, 0x74u, 0x75u, 0xB5u, 0x77u, 0xB7u, 0xB6u, 0x76u, 0x72u, 0xB2u, 0xB3u, 0x73u, 0xB1u, 0x71u, 0x70u, 0xB0u, 0x50u, 0x90u, 0x91u, 0x51u, 0x93u, 0x53u, 0x52u, 0x92u, 0x96u, 0x56u, 0x57u, 0x97u, 0x55u, 0x95u, 0x94u, 0x54u, 0x9Cu, 0x5Cu, 0x5Du, 0x9Du, 0x5Fu, 0x9Fu, 0x9Eu, 0x5Eu, 0x5Au, 0x9Au, 0x9Bu, 0x5Bu, 0x99u, 0x59u, 0x58u, 0x98u, 0x88u, 0x48u, 0x49u, 0x89u, 0x4Bu, 0x8Bu, 0x8Au, 0x4Au, 0x4Eu, 0x8Eu, 0x8Fu, 0x4Fu, 0x8Du, 0x4Du, 0x4Cu, 0x8Cu, 0x44u, 0x84u, 0x85u, 0x45u, 0x87u, 0x47u, 0x46u, 0x86u, 0x82u, 0x42u, 0x43u, 0x83u, 0x41u, 0x81u, 0x80u, 0x40u};
/**
* 获取CRC16校验和
*/
/**
* @brief 计算传入数据的CRC16
* @param[in] pData 计算的数据内容
* @param[in] len 计算的数据长度
*
* @return 校验和
*
* @since 1.0.0
*/
Protocol_uint16_t getCheckSum(const Protocol_uint8_t *pData, int len)
{
Protocol_uint8_t u8_crc_h = 0xFFu;
Protocol_uint8_t u8_crc_l = 0xFFu;
Protocol_uint8_t u8_index = 0u;
Protocol_uint8_t i = 0u;
Protocol_uint16_t re_value;
while ( len-- )
{
u8_index = u8_crc_h ^ (pData [ i++ ]);
u8_crc_h = u8_crc_l ^ CRC16_TAB_H [ u8_index ];
u8_crc_l = CRC16_TAB_L [ u8_index ];
}
re_value = ( Protocol_uint16_t )u8_crc_h << 8u;
re_value |= u8_crc_l;
return re_value;
}
#ifndef PROTOCOL_CRC16_H
#define PROTOCOL_CRC16_H
#include "Protocol_Lib.h"
Protocol_uint16_t getCheckSum(const Protocol_uint8_t *pData, int len);
#endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#ifndef PROTOCOL_USER_H
#define PROTOCOL_USER_H
#include "Protocol_Lib.h"
void Protocol_KL30_Wakeup_Init(void);
void Protocol_Send_Service(void); // 10ms任务调用
void UART_Put(Protocol_uint16_t Data);
#endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#include "eepromManage.h"
#include "eeManager_Interface.h"
#include "Components.h"
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment