SW0103:更新BBG单片机,更新诊断信息

This commit is contained in:
sunbeam 2023-07-10 16:33:42 +08:00
parent c75fd21be6
commit 1604c197d8
30 changed files with 9283 additions and 5741 deletions

View File

@ -163,12 +163,12 @@ var DiagStopReq = function(){
} }
mainForm.btnReadSw.oncommand = function(id,event){ mainForm.btnReadSw.oncommand = function(id,event){
DiagReadDID(0xF188); DiagReadDID(0xF195);
} }
mainForm.btnReadHw.oncommand = function(id,event){ mainForm.btnReadHw.oncommand = function(id,event){
DiagReadDID(0xF191); DiagReadDID(0xF193);
} }
mainForm.btnReadF186.oncommand = function(id,event){ mainForm.btnReadF186.oncommand = function(id,event){

View File

@ -23,11 +23,11 @@ FuncDiag22Pro = function(data){
case 0xF186 { case 0xF186 {
FuncDisplay("当前会话: " + data[3]); FuncDisplay("当前会话: " + data[3]);
} }
case 0xF191 { case 0xF193 {
FuncDisplay("硬件版本号"); FuncDisplay("硬件版本号");
FuncDisplay(string.pack(table.slice(data,3))); FuncDisplay(string.pack(table.slice(data,3)));
} }
case 0xF188 { case 0xF195 {
FuncDisplay("软件版本号"); FuncDisplay("软件版本号");
FuncDisplay(string.pack(table.slice(data,3))); FuncDisplay(string.pack(table.slice(data,3)));
} }

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,114 +1,14 @@
QualityReport QualityReport
2023年6月30日 15:42:17 2023年7月10日 16:30:07
------ Start build(ECU_APP, DefaultBuild) ------ ------ Start build(ECU_APP, DefaultBuild) ------
E:\Program Files (x86)\renesas\CS+\CC\CC-RL\V1.11.00\Bin\ccrl.exe user\appTask.c -cpu=S3 -obj_path=DefaultBuild "-dev=E:\Program Files (x86)\renesas\CS+\CC\Device\RL78\Devicefile\DR5F10BGG.DVF" -g -g_line -I diagnose\DTC -I diagnose\CanTrcv -I sys -I . -I rscan_driver -I diagnose -I DataFlash -I CanNw -I diagnose\CanTp -I diagnose\CanIf -I user -D DEBUG1 -c -msg_lang=english ------ Build ended(Error:0, Warning:0)(ECU_APP, DefaultBuild) ------
user\appTask.c(40):W0520172:External/internal linkage conflict with previous declaration
user\appTask.c(257):W0520177:Variable "num" was declared but never referenced
user\appTask.c(258):W0520177:Variable "keyPressCounter" was declared but never referenced
user\appTask.c(259):W0520177:Variable "LastKey" was declared but never referenced
user\appTask.c(399):W0523082:Pointer to the object of even alignment holds the odd address
user\appTask.c(403):W0520513:A value of type "MotorStateEE_Type __near *" cannot be assigned to an entity of type "uint8_t *"
user\appTask.c(441):W0520513:A value of type "MotorStateEE_Type __near *" cannot be assigned to an entity of type "uint8_t *"
user\appTask.c(677):W0523077:Called function should have prototype
user\appTask.c(731):W0523077:Called function should have prototype
E:\Program Files (x86)\renesas\CS+\CC\CC-RL\V1.11.00\Bin\rlink.exe -subcommand=DefaultBuild\ECU_APP.clnk
W0561017:The evaluation period of CC-RL V1 has expired. Please consider purchasing the product.
RAMDATA SECTION: 00000c41 Byte(s)
ROMDATA SECTION: 000005ff Byte(s)
PROGRAM SECTION: 000050b7 Byte(s)
W0561017:The evaluation period of CC-RL V1 has expired. Please consider purchasing the product.
W0561017:The evaluation period of CC-RL V1 has expired. Please consider purchasing the product.
Renesas Optimizing Linker Completed
------ Build ended(Error:0, Warning:12)(ECU_APP, DefaultBuild) ------
--- CommandFile 1 ---
DefaultBuild\ECU_APP.clnk :
-Input=DefaultBuild\cstart.obj
-Input=DefaultBuild\stkinit.obj
-Input=DefaultBuild\r_pfdl.obj
-Input=DefaultBuild\RL78_RCAN.obj
-Input=DefaultBuild\r_rl78_can_drv.obj
-Input=DefaultBuild\r_rl78_can_irq.obj
-Input=DefaultBuild\r_systeminit.obj
-Input=DefaultBuild\r_main.obj
-Input=DefaultBuild\r_cg_wdt_user.obj
-Input=DefaultBuild\r_cg_wdt.obj
-Input=DefaultBuild\r_cg_timer_user.obj
-Input=DefaultBuild\r_cg_timer.obj
-Input=DefaultBuild\r_cg_port_user.obj
-Input=DefaultBuild\r_cg_port.obj
-Input=DefaultBuild\r_cg_cgc_user.obj
-Input=DefaultBuild\r_cg_cgc.obj
-Input=DefaultBuild\r_cg_adc_user.obj
-Input=DefaultBuild\r_cg_adc.obj
-Input=DefaultBuild\VectorTable.obj
-Input=DefaultBuild\CanNw.obj
-Input=DefaultBuild\CanNwConfig.obj
-Input=DefaultBuild\Dcm_App.obj
-Input=DefaultBuild\Dcm_App_Cfg.obj
-Input=DefaultBuild\Dcm_Cfg.obj
-Input=DefaultBuild\Dcm_DID.obj
-Input=DefaultBuild\Dcm_DID_Cfg.obj
-Input=DefaultBuild\Dcm_Key.obj
-Input=DefaultBuild\extern.obj
-Input=DefaultBuild\CanIf.obj
-Input=DefaultBuild\CanIf_Cfg.obj
-Input=DefaultBuild\CanTp_Cfg.obj
-Input=DefaultBuild\CanTrcv.obj
-Input=DefaultBuild\CanTrcv_Cfg.obj
-Input=DefaultBuild\DCM_DTC.obj
-Input=DefaultBuild\Dcm.obj
-Input=DefaultBuild\CanTp.obj
-Input=DefaultBuild\r_cg_intc.obj
-Input=DefaultBuild\r_cg_intc_user.obj
-Input=DefaultBuild\appTask.obj
-Input=DefaultBuild\can_user.obj
-Input=DefaultBuild\hwCtrl.obj
-LIBrary=DataFlash\pfdl.lib
-SECURITY_ID=00000000000000000000
-DEVICE=E:\Program Files (x86)\renesas\CS+\CC\Device\RL78\Devicefile\DR5F10BGG.DVF
-DEBug
-NOCOmpress
-NOOPtimize
-OUtput=DefaultBuild\ECU_APP.abs
-LIBrary=E:\Program Files (x86)\renesas\CS+\CC\CC-RL\V1.11.00\lib\rl78em4s.lib
-LIBrary=E:\Program Files (x86)\renesas\CS+\CC\CC-RL\V1.11.00\lib\malloc_n.lib
-LIBrary=E:\Program Files (x86)\renesas\CS+\CC\CC-RL\V1.11.00\lib\rl78em4r.lib
-OCDBG=04
-USER_OPT_BYTE=E933E8
-LISt=DefaultBuild\ECU_APP.map
-SHow=Reference,Xreference,Total_size,STRUCT
-STARt=VectorRemapingAddr_n,.const,.text,.RLIB,.SLIB,PFDL_COD,.textf,.constf,.data,.sdata/0A000,DID_TBL_f/19C00,KAM_SEG_n/FE500,.dataR,.bss/FE510,.sdataR,.sbss/FFE20
-ROm=.data=.dataR
-ROm=.sdata=.sdataR
-Message
-Total_size
-NOLOgo
-end
-Input=DefaultBuild\ECU_APP.abs
-DEVICE=E:\Program Files (x86)\renesas\CS+\CC\Device\RL78\Devicefile\DR5F10BGG.DVF
-OUtput=DefaultBuild\ECU_APP.mot
-FOrm=Stype
-REcord=S3
-BYte_count=10
-Message
-end
-Input=DefaultBuild\ECU_APP.abs
-DEVICE=E:\Program Files (x86)\renesas\CS+\CC\Device\RL78\Devicefile\DR5F10BGG.DVF
-OUtput=output\ECU_APP.S19= A000-19FFF
-FOrm=Stype
-REcord=S3
-SPace=FF
-BYte_count=10
-Message
-exit
--- SHA1 hash value of output files --- --- SHA1 hash value of output files ---
F:\FCB_project\temp\CFMOTOR\code\ECU_APP\DefaultBuild\ECU_APP.abs: 3efee4d9994113615a010ad13737591e01aa1ea2 F:\FCB_project\temp\CFMOTOR\code\ECU_APP\DefaultBuild\ECU_APP.abs: 44dae78e0591f76aca5fbb3c30e1cf294c2b9f96
F:\FCB_project\temp\CFMOTOR\code\ECU_APP\DefaultBuild\ECU_APP.mot: aa2af9b7ade2ac8fe0b8398000a8832bf79fb7e9 F:\FCB_project\temp\CFMOTOR\code\ECU_APP\DefaultBuild\ECU_APP.mot: 45bb4a68918d8588e5c70500363574695de31a64
F:\FCB_project\temp\CFMOTOR\code\ECU_APP\output\ECU_APP.S19: 302286016a025ae655f22e8553fce88b691a006f F:\FCB_project\temp\CFMOTOR\code\ECU_APP\output\ECU_APP.S19: 99804271a1a76fd13f733a11900ba194fa0fd1ad
--- System Information --- --- System Information ---
@ -136,11 +36,11 @@ F:\FCB_project\temp\CFMOTOR\code\ECU_APP\output\ECU_APP.S19: 302286016a025ae655f
E:\Program Files (x86)\renesas\CS+\CC E:\Program Files (x86)\renesas\CS+\CC
*Memory Usage *Memory Usage
*Private Working Set *Private Working Set
267 MB 268 MB
*Number of GDI Objects *Number of GDI Objects
2079 2068
*Number of USER Objects *Number of USER Objects
1126 1113
*Opened Files *Opened Files
2 editors, 2 files, 24 KB 2 editors, 2 files, 24 KB
@ -273,12 +173,12 @@ Device Information Common Interface
--- Main Project Information --- --- Main Project Information ---
F:\FCB_project\temp\CFMOTOR\code\ECU_APP\ECU_APP.mtpj F:\FCB_project\temp\CFMOTOR\code\ECU_APP\ECU_APP.mtpj
Microcontroller Information Microcontroller Information
*R5F10BGG *R5F10BBG
*File Name: Version *File Name: Version
RL78_Productlist.xml: V8.070000 RL78_Productlist.xml: V8.070000
R5F10BGG_common.xml: V1.13.00.XX.02 R5F10BBG_common.xml: V1.13.00.XX.02
DR5F10BGG.DVF: V1.11 DR5F10BBG.DVF: V1.11
f13_bgx.ti: V1.01 f13_bbx.ti: V1.01
-: - -: -

View File

@ -134,9 +134,17 @@ const TsDcm_h_DidCheckType CaDcm_h_IODidCheckInfoTable[DCM_IO_DIDSUP_COUNT]={
}; };
/*22 服务 DID 条件检查项列表*/ /*22 服务 DID 条件检查项列表*/
const TsDcm_h_DidCheckType CaDcm_h_ReadDidCheckInfoTable[DCM_READ_DIDSUP_COUNT + DCM_PERIODIC_DATA_COUNT]={ const TsDcm_h_DidCheckType CaDcm_h_ReadDidCheckInfoTable[DCM_READ_DIDSUP_COUNT + DCM_PERIODIC_DATA_COUNT]={
{0x07,0x07,13,0xF187,&Dcm_DidServices_0xF187_ReadData},
{0x07,0x07,5,0xF18A,&Dcm_DidServices_0xF18A_ReadData}, {0x07,0x07,10,0xF180,&Dcm_DidServices_0xF180_ReadData},
{0x07,0x07,10,0xF197,&Dcm_DidServices_0xF197_ReadData}, {0x07,0x07, 1,0xF186,&Dcm_DidServices_0xF186_ReadData},
{0x07,0x07,20,0xF187,&Dcm_DidServices_0xF187_ReadData},
{0x07,0x07,10,0xF18A,&Dcm_DidServices_0xF18A_ReadData},
{0x07,0x07, 6,0xF197,&Dcm_DidServices_0xF197_ReadData},
{0x07,0x07,10,0xF195,&Dcm_DidServices_0xF195_ReadData},
{0x07,0x07,10,0xF193,&Dcm_DidServices_0xF191_ReadData},
{0x07,0x07, 4,0xF18C,&Dcm_DidServices_0xF18B_ReadData},
{0x07,0x07,17,0xF190,&Dcm_DidServices_0xF190_ReadData},
{0x07,0x07,13,0xF188,&Dcm_DidServices_0xF195_ReadData}, {0x07,0x07,13,0xF188,&Dcm_DidServices_0xF195_ReadData},
{0x07,0x07,10,0xF191,&Dcm_DidServices_0xF191_ReadData}, {0x07,0x07,10,0xF191,&Dcm_DidServices_0xF191_ReadData},
{0x07,0x07,4,0x1701,&Dcm_DidServices_0x1701_ReadData}, {0x07,0x07,4,0x1701,&Dcm_DidServices_0x1701_ReadData},
@ -147,14 +155,13 @@ const TsDcm_h_DidCheckType CaDcm_h_ReadDidCheckInfoTable[DCM_READ_DIDSUP_COUNT +
{0x07,0x07,1,0x1709,&Dcm_DidServices_0x1709_ReadData}, {0x07,0x07,1,0x1709,&Dcm_DidServices_0x1709_ReadData},
{0x07,0x07,1,0x170B,&Dcm_DidServices_0x170B_ReadData}, {0x07,0x07,1,0x170B,&Dcm_DidServices_0x170B_ReadData},
//REVERSE //REVERSE
{0x07,0x07,13,0xF195,&Dcm_DidServices_0xF195_ReadData},
{0x07,0x07,10,0xF193,&Dcm_DidServices_0xF191_ReadData},
{0x07,0x07, 8,0x0200,&Dcm_DidServices_0x0200_ReadData}, {0x07,0x07, 8,0x0200,&Dcm_DidServices_0x0200_ReadData},
{0x07,0x07, 8,0x0201,&Dcm_DidServices_0x0201_ReadData}, {0x07,0x07, 8,0x0201,&Dcm_DidServices_0x0201_ReadData},
{0x07,0x07,16,0xF180,&Dcm_DidServices_0xF180_ReadData},
{0x07,0x07, 1,0xF186,&Dcm_DidServices_0xF186_ReadData},
{0x07,0x07, 3,0xF18B,&Dcm_DidServices_0xF18B_ReadData},
{0x07,0x07,17,0xF190,&Dcm_DidServices_0xF190_ReadData},
{0x07,0x07,16,0xF189,&Dcm_DidServices_0xF189_ReadData}, {0x07,0x07,16,0xF189,&Dcm_DidServices_0xF189_ReadData},
{0x07,0x07,16,0xF198,&Dcm_DidServices_0xF198_ReadData}, {0x07,0x07,16,0xF198,&Dcm_DidServices_0xF198_ReadData},
{0x07,0x07, 4,0xF199,&Dcm_DidServices_0xF199_ReadData}, {0x07,0x07, 4,0xF199,&Dcm_DidServices_0xF199_ReadData},

View File

@ -212,18 +212,18 @@ uint8 Dcm_DidServices_0xF112_WriteData(uint8* LeDcm_u_data, uint8* LeDcm_u_data
/******************* Read 0xF197 ***************************/ /******************* Read 0xF197 ***************************/
uint8 Dcm_DidServices_0xF197_ReadData(uint8* LeDcm_u_data,uint8* LeDcm_u_dataLength) uint8 Dcm_DidServices_0xF197_ReadData(uint8* LeDcm_u_data,uint8* LeDcm_u_dataLength)
{ {
uint8 LaDCM_u_Buf[10]; uint8 LaDCM_u_Buf[6];
uint8 i; uint8 i;
if( DCM_CHECK_OK == GetRTE_Dcm_DidServices_0xF197_ReadData(LaDCM_u_Buf)) if( DCM_CHECK_OK == GetRTE_Dcm_DidServices_0xF197_ReadData(LaDCM_u_Buf))
{ {
for(i = 0;i < 10;i++) for(i = 0;i < 6;i++)
{ {
LeDcm_u_data[i] = LaDCM_u_Buf[i]; LeDcm_u_data[i] = LaDCM_u_Buf[i];
} }
(*LeDcm_u_dataLength) = 10U; (*LeDcm_u_dataLength) = 6U;
return DCM_CHECK_OK; return DCM_CHECK_OK;
} }
@ -240,18 +240,18 @@ uint8 Dcm_DidServices_0xF197_ReadData(uint8* LeDcm_u_data,uint8* LeDcm_u_dataLen
uint8 Dcm_DidServices_0xF180_ReadData(uint8* LeDcm_u_data,uint8* LeDcm_u_dataLength) uint8 Dcm_DidServices_0xF180_ReadData(uint8* LeDcm_u_data,uint8* LeDcm_u_dataLength)
{ {
uint8 LaDCM_u_Buf[16]; uint8 LaDCM_u_Buf[10];
uint8 i; uint8 i;
if( DCM_CHECK_OK == GetRTE_Dcm_DidServices_0xF180_ReadData(LaDCM_u_Buf)) if( DCM_CHECK_OK == GetRTE_Dcm_DidServices_0xF180_ReadData(LaDCM_u_Buf))
{ {
for(i = 0;i < 16;i++) for(i = 0;i < 10;i++)
{ {
LeDcm_u_data[i] = LaDCM_u_Buf[i]; LeDcm_u_data[i] = LaDCM_u_Buf[i];
} }
(*LeDcm_u_dataLength) = 16U; (*LeDcm_u_dataLength) = 10U;
return DCM_CHECK_OK; return DCM_CHECK_OK;
} }
else else
@ -341,18 +341,18 @@ uint8 Dcm_DidServices_0xF186_ReadData(uint8* LeDcm_u_data,uint8* LeDcm_u_dataLen
uint8 Dcm_DidServices_0xF187_ReadData(uint8* LeDcm_u_data,uint8* LeDcm_u_dataLength) uint8 Dcm_DidServices_0xF187_ReadData(uint8* LeDcm_u_data,uint8* LeDcm_u_dataLength)
{ {
uint8 LaDCM_u_Buf[13]; uint8 LaDCM_u_Buf[20];
uint8 i; uint8 i;
if( DCM_CHECK_OK == GetRTE_Dcm_DidServices_0xF187_ReadData(LaDCM_u_Buf)) if( DCM_CHECK_OK == GetRTE_Dcm_DidServices_0xF187_ReadData(LaDCM_u_Buf))
{ {
for(i = 0;i < 13;i++) for(i = 0;i < 20;i++)
{ {
LeDcm_u_data[i] = LaDCM_u_Buf[i]; LeDcm_u_data[i] = LaDCM_u_Buf[i];
} }
(*LeDcm_u_dataLength) = 13U; (*LeDcm_u_dataLength) = 20U;
return DCM_CHECK_OK; return DCM_CHECK_OK;
} }
else else
@ -393,18 +393,18 @@ uint8 Dcm_DidServices_0xF189_ReadData(uint8* LeDcm_u_data,uint8* LeDcm_u_dataLen
uint8 Dcm_DidServices_0xF18A_ReadData(uint8* LeDcm_u_data,uint8* LeDcm_u_dataLength) uint8 Dcm_DidServices_0xF18A_ReadData(uint8* LeDcm_u_data,uint8* LeDcm_u_dataLength)
{ {
uint8 LaDCM_u_Buf[5]; uint8 LaDCM_u_Buf[10];
uint8 i; uint8 i;
if( DCM_CHECK_OK == GetRTE_Dcm_DidServices_0xF18A_ReadData(LaDCM_u_Buf)) if( DCM_CHECK_OK == GetRTE_Dcm_DidServices_0xF18A_ReadData(LaDCM_u_Buf))
{ {
for(i = 0;i < 5;i++) for(i = 0;i < 10;i++)
{ {
LeDcm_u_data[i] = LaDCM_u_Buf[i]; LeDcm_u_data[i] = LaDCM_u_Buf[i];
} }
(*LeDcm_u_dataLength) = 5U; (*LeDcm_u_dataLength) = 10U;
return DCM_CHECK_OK; return DCM_CHECK_OK;
} }
else else
@ -504,7 +504,7 @@ uint8 Dcm_DidServices_0xF190_WriteData(uint8* LeDcm_u_data, uint8* LeDcm_u_dataL
uint8 Dcm_DidServices_0xF191_ReadData(uint8* LeDcm_u_data,uint8* LeDcm_u_dataLength) uint8 Dcm_DidServices_0xF191_ReadData(uint8* LeDcm_u_data,uint8* LeDcm_u_dataLength)
{ {
uint8 LaDCM_u_Buf[15]; uint8 LaDCM_u_Buf[10];
uint8 i; uint8 i;
if( DCM_CHECK_OK == GetRTE_Dcm_DidServices_0xF191_ReadData(LaDCM_u_Buf)) if( DCM_CHECK_OK == GetRTE_Dcm_DidServices_0xF191_ReadData(LaDCM_u_Buf))
@ -611,18 +611,18 @@ uint8 Dcm_DidServices_0xF194_ReadData(uint8* LeDcm_u_data,uint8* LeDcm_u_dataLen
uint8 Dcm_DidServices_0xF195_ReadData(uint8* LeDcm_u_data,uint8* LeDcm_u_dataLength) uint8 Dcm_DidServices_0xF195_ReadData(uint8* LeDcm_u_data,uint8* LeDcm_u_dataLength)
{ {
uint8 LaDCM_u_Buf[13]; uint8 LaDCM_u_Buf[10];
uint8 i; uint8 i;
if( DCM_CHECK_OK == GetRTE_Dcm_DidServices_0xF195_ReadData(LaDCM_u_Buf)) if( DCM_CHECK_OK == GetRTE_Dcm_DidServices_0xF195_ReadData(LaDCM_u_Buf))
{ {
for(i = 0;i < 13;i++) for(i = 0;i < 10;i++)
{ {
LeDcm_u_data[i] = LaDCM_u_Buf[i]; LeDcm_u_data[i] = LaDCM_u_Buf[i];
} }
(*LeDcm_u_dataLength) = 13U; (*LeDcm_u_dataLength) = 10U;
return DCM_CHECK_OK; return DCM_CHECK_OK;
} }
else else

View File

@ -146,16 +146,12 @@ uint8 GetRTE_Dcm_DidServices_0xF112_ReadData(uint8* data)
uint8 GetRTE_Dcm_DidServices_0xF197_ReadData(uint8* data) uint8 GetRTE_Dcm_DidServices_0xF197_ReadData(uint8* data)
{ {
(void)data; (void)data;
data[0] = 'T'; data[0] = 'M';
data[1] = 'O'; data[1] = 'S';
data[2] = 'N'; data[2] = 'W';
data[3] = 'G'; data[3] = ' ';
data[4] = 'Y'; data[4] = ' ';
data[5] = 'U'; data[5] = ' ';
data[6] = '-';
data[7] = 'S';
data[8] = 'C';
data[9] = 'M';
return DCM_CHECK_OK; return DCM_CHECK_OK;
} }
@ -186,12 +182,6 @@ uint8 GetRTE_Dcm_DidServices_0xF180_ReadData(uint8* data)
data[7] = *p++; data[7] = *p++;
data[8] = *p++; data[8] = *p++;
data[9] = *p++; data[9] = *p++;
data[10] = *p++;
data[11] = *p++;
data[12] = *p++;
data[13] = *p++;
data[14] = *p++;
data[15] = *p++;
return DCM_CHECK_OK; return DCM_CHECK_OK;
} }
@ -249,20 +239,27 @@ uint8 GetRTE_Dcm_DidServices_0xF186_ReadData(uint8* data)
uint8 GetRTE_Dcm_DidServices_0xF187_ReadData(uint8* data) uint8 GetRTE_Dcm_DidServices_0xF187_ReadData(uint8* data)
{ {
(void)data;//RF01-68013200 (void)data;//5HY1-169500-6000
data[0] = 'R'; data[0] = '5';
data[1] = 'F'; data[1] = 'H';
data[2] = '0'; data[2] = 'Y';
data[3] = '1'; data[3] = '1';
data[4] = '-'; data[4] = '-';
data[5] = '6'; data[5] = '1';
data[6] = '8'; data[6] = '6';
data[7] = '0'; data[7] = '9';
data[8] = '1'; data[8] = '5';
data[9] = '3'; data[9] = '0';
data[10] = '2'; data[10] = '0';
data[11] = '0'; data[11] = '-';
data[12] = '0'; data[12] = '6';
data[13] = '0';
data[14] = '0';
data[15] = '0';
data[16] = ' ';
data[17] = ' ';
data[18] = ' ';
data[19] = ' ';
return DCM_CHECK_OK; return DCM_CHECK_OK;
} }
@ -291,11 +288,16 @@ uint8 GetRTE_Dcm_DidServices_0xF189_ReadData(uint8* data)
uint8 GetRTE_Dcm_DidServices_0xF18A_ReadData(uint8* data) uint8 GetRTE_Dcm_DidServices_0xF18A_ReadData(uint8* data)
{ {
(void)data; (void)data;
data[0] = 'C'; data[0] = 'Z';
data[1] = 'L'; data[1] = 'H';
data[2] = '1'; data[2] = 'E';
data[3] = '7'; data[3] = 'N';
data[4] = '7'; data[4] = 'A';
data[5] = 'N';
data[6] = ' ';
data[7] = ' ';
data[8] = ' ';
data[9] = ' ';
return DCM_CHECK_OK; return DCM_CHECK_OK;
} }
@ -319,17 +321,18 @@ uint8 GetRTE_Dcm_DidServices_0xF190_ReadData(uint8* data)
uint8 GetRTE_Dcm_DidServices_0xF191_ReadData(uint8* data) uint8 GetRTE_Dcm_DidServices_0xF191_ReadData(uint8* data)
{ {
__far uint8 *p = DID_F193_ADDR;
(void)data; (void)data;
data[0] = '1'; data[0] = *p++;
data[1] = '.'; data[1] = *p++;
data[2] = '1'; data[2] = *p++;
data[3] = '.'; data[3] = *p++;
data[4] = '1'; data[4] = *p++;
data[5] = ' '; data[5] = *p++;
data[6] = ' '; data[6] = *p++;
data[7] = ' '; data[7] = *p++;
data[8] = ' '; data[8] = *p++;
data[9] = ' '; data[9] = *p++;
return DCM_CHECK_OK; return DCM_CHECK_OK;
} }
uint8 GetRTE_Dcm_DidServices_0xF192_ReadData(uint8* data) uint8 GetRTE_Dcm_DidServices_0xF192_ReadData(uint8* data)

View File

@ -7,49 +7,52 @@
__far const unsigned char HD_VERSION[]={ __far const unsigned char HD_VERSION[]={
'H' , //AC_HD_VERSION_00 'H' , //AC_HD_VERSION_00
'W' , //AC_HD_VERSION_01 'W' , //AC_HD_VERSION_01
'.' , //AC_HD_VERSION_06
'0' , //AC_HD_VERSION_02 '0' , //AC_HD_VERSION_02
'3' , //AC_HD_VERSION_03 '.' , //AC_HD_VERSION_03
'0' , //AC_HD_VERSION_04 '0' , //AC_HD_VERSION_04
'0' , //AC_HD_VERSION_05 '1' , //AC_HD_VERSION_05
' ' , //AC_HD_VERSION_06 '.' , //AC_HD_VERSION_06
' ' , //AC_HD_VERSION_07 '0' , //AC_HD_VERSION_07
' ' , //AC_HD_VERSION_08 '1' , //AC_HD_VERSION_08
' ' , //AC_HD_VERSION_09 ' ' , //AC_HD_VERSION_09
' ' , //AC_HD_VERSION_10 ' ' , //AC_HD_VERSION_10
' ' , //AC_HD_VERSION_11 ' ' , //AC_HD_VERSION_11
' ' , //AC_HD_VERSION_12 ' ' , //AC_HD_VERSION_12
' ' , //AC_HD_VERSION_13 ' ' , //AC_HD_VERSION_13
' ' , //AC_HD_VERSION_14 ' ' , //AC_HD_VERSION_14
' ' , //AC_HD_VERSION_15
}; };
__far const unsigned char SW_VERSION[]={ __far const unsigned char SW_VERSION[]={
'0' , //AC_SW_VERSION_00 'S' , //AC_SW_VERSION_00
'1' , //AC_SW_VERSION_01 'W' , //AC_SW_VERSION_01
'.' , //AC_SW_VERSION_02 '.' , //AC_SW_VERSION_02
'0' , //AC_SW_VERSION_03 '0' , //AC_SW_VERSION_03
'1' , //AC_SW_VERSION_04 '.' , //AC_SW_VERSION_04
'.' , //AC_SW_VERSION_05 '0' , //AC_SW_VERSION_05
'0' , //AC_SW_VERSION_06 '1' , //AC_SW_VERSION_06
'3' , //AC_SW_VERSION_07 '.' , //AC_SW_VERSION_07
' ' , //AC_SW_VERSION_08 '0' , //AC_SW_VERSION_08
' ' , //AC_SW_VERSION_09 '3' , //AC_SW_VERSION_09
' ' , //AC_SW_VERSION_10 ' ' , //AC_SW_VERSION_10
' ' , //AC_SW_VERSION_11 ' ' , //AC_SW_VERSION_11
' ' , //AC_SW_VERSION_12 ' ' , //AC_SW_VERSION_12
' ' , //AC_SW_VERSION_13
' ' , //AC_SW_VERSION_14
' ' , //AC_SW_VERSION_14
}; };
__far const unsigned char SUP_ECU_SW_VERSION[]={ __far const unsigned char SUP_ECU_SW_VERSION[]={
'B' , //
'T' , //
'.' , //
'0' , //
'.' , //
'0' , //
'0' , //
'.' , //
'0' , // '0' , //
'2' , //
'0' , // '0' , //
'1' , //
' ' , //
' ' , //
' ' , //
' ' , //
' ' , //
' ' , //
' ' , // ' ' , //
' ' , // ' ' , //
' ' , // ' ' , //
@ -74,18 +77,18 @@ const unsigned char DID_0xF112_VehicleName[8]={0x20,0x20,0x20,0x20,0x20,0x20,0x2
can_frame_t TxCanMessageT; can_frame_t TxCanMessageT;
//const unsigned char DID_0xF15A[]={}; //const unsigned char DID_0xF15A[]={};
/****************************************************************************************/ /****************************************************************************************/
/* 输入参数 ch : */ /* 输入参数 ch : */
/* 0: 压缩机温度 */ /* 0: 压缩机温度 */
/* 1: 室外温度 */ /* 1: 室外温度 */
/* 2: 室内温度 */ /* 2: 室内温度 */
/* 返回值: */ /* 返回值: */
/* 对应的电压*10即返回的电压值精度是0.1V的) */ /* 对应的电压*10即返回的电压值精度是0.1V的) */
/* */ /* */
unsigned char GetVoltage(unsigned char ch) unsigned char GetVoltage(unsigned char ch)
{ {
/* 这里可以做数组的方式返回,但尽量不要在这里计算,例如下 return Voltage[ch]; */ /* 这里可以做数组的方式返回,但尽量不要在这里计算,例如下 return Voltage[ch]; */
// switch(ch) // switch(ch)
// { // {
// case EVA_SENSOR: // case EVA_SENSOR:
@ -104,13 +107,13 @@ unsigned char GetVoltage(unsigned char ch)
} }
/************************************************************************************/ /************************************************************************************/
/* 输入参数 motor : */ /* 输入参数 motor : */
/* 1: 驾驶员侧温度调节电机 */ /* 1: 驾驶员侧温度调节电机 */
/* 2: 出风模式电机电机 */ /* 2: 出风模式电机电机 */
/* 3: 循环风门调节电机 */ /* 3: 循环风门调节电机 */
/* */ /* */
/* 返回值: */ /* 返回值: */
/* 0: 电机正常 1电机堵转 */ /* 0: 电机正常 1电机堵转 */
/* */ /* */
unsigned char GetMotorLockStatus(unsigned char motor) unsigned char GetMotorLockStatus(unsigned char motor)
{ {
@ -132,18 +135,18 @@ unsigned char GetMotorLockStatus(unsigned char motor)
} }
/************************************************************************************/ /************************************************************************************/
/* 输入参数 p : */ /* 输入参数 p : */
/* 0: TEMP 驾驶员侧温度风门位置 */ /* 0: TEMP 驾驶员侧温度风门位置 */
/* 1: REC 内外循环模式 */ /* 1: REC 内外循环模式 */
/* 2: FAN 鼓风机档位 */ /* 2: FAN 鼓风机档位 */
/* 3: MODE 模式风门位置 */ /* 3: MODE 模式风门位置 */
/* 4: DEFROST 除霜开关 */ /* 4: DEFROST 除霜开关 */
/* 5: REARDEF 后除霜控制 */ /* 5: REARDEF 后除霜控制 */
/* 6: AC A/C制冷按键按键 */ /* 6: AC A/C制冷按键按键 */
/* 7: K30 ECU Supplier voltage */ /* 7: K30 ECU Supplier voltage */
/* */ /* */
/* 返回值: */ /* 返回值: */
/* 0: 对应的data,具体见222F服务 */ /* 0: 对应的data,具体见222F服务 */
/************************************************************************************/ /************************************************************************************/
unsigned char GetIoParameter(unsigned char p) unsigned char GetIoParameter(unsigned char p)
{ {
@ -181,31 +184,31 @@ unsigned char GetIoParameter(unsigned char p)
} }
/************************************************************************************/ /************************************************************************************/
/* 主函数查询 */ /* 主函数查询 */
/*输入参数 p : */ /*输入参数 p : */
/* 0: TEMP 驾驶员侧温度风门位置 */ /* 0: TEMP 驾驶员侧温度风门位置 */
/* 1: REC 内外循环模式 */ /* 1: REC 内外循环模式 */
/* 2: FAN 鼓风机档位 */ /* 2: FAN 鼓风机档位 */
/* 3: MODE 模式风门位置 */ /* 3: MODE 模式风门位置 */
/* 4: DEFROST 无效 */ /* 4: DEFROST 无效 */
/* 5: REARDEF 后除霜控制 */ /* 5: REARDEF 后除霜控制 */
/* 6: AC 无效 */ /* 6: AC 无效 */
/* 7: K30 无效 */ /* 7: K30 无效 */
/* 返回值: */ /* 返回值: */
/* */ /* */
/************************************************************************************/ /************************************************************************************/
void WriteIoParameter(unsigned char p,unsigned char data) void WriteIoParameter(unsigned char p,unsigned char data)
{ {
io_parameter[p].write = 1; //此值为1代表着需要对对应用的参数写入data。APP完成写入操作后面把这个清零。 io_parameter[p].write = 1; //此值为1代表着需要对对应用的参数写入data。APP完成写入操作后面把这个清零。
io_parameter[p].data = data; io_parameter[p].data = data;
} }
/************************************************************************************/ /************************************************************************************/
/* 输入参数 p : */ /* 输入参数 p : */
/* */ /* */
/* */ /* */
/* 返回值: */ /* 返回值: */
/* 0: IGN电源正常 1IGN > 16V 或 IGN < 9V */ /* 0: IGN电源正常 1IGN > 16V 或 IGN < 9V */
/* */ /* */
/************************************************************************************/ /************************************************************************************/
unsigned char GetIgnVoltStatus(void) unsigned char GetIgnVoltStatus(void)
@ -341,32 +344,32 @@ uint32 GetTimerCnt(void)
return Can_1ms_count_alive; return Can_1ms_count_alive;
} }
/************************************************************************************ /************************************************************************************
// 获取data Flash数据存取索引号 // // 获取data Flash数据存取索引号 //
// 输入参数 code : // // 输入参数 code : //
// 0 : 获取APP重编程请求标志索引号 // // 0 : 获取APP重编程请求标志索引号 //
// 1 : 获取2E服务0xF110的索引号 // // 1 : 获取2E服务0xF110的索引号 //
// 2 : 获取2E服务0xF190的索引号 // // 2 : 获取2E服务0xF190的索引号 //
// 3 : 获取2E服务0xF197的索引号 // // 3 : 获取2E服务0xF197的索引号 //
// 4 : 获取2E服务0xF198的索引号 // // 4 : 获取2E服务0xF198的索引号 //
// 5 : 获取2E服务0xF199的索引号 // // 5 : 获取2E服务0xF199的索引号 //
// 6 : 获取2E服务0xF19D的索引号 // // 6 : 获取2E服务0xF19D的索引号 //
// 7 : 获取2E服务0xF112的索引号 // // 7 : 获取2E服务0xF112的索引号 //
// 8 : 获取19服务0xF00616的索引号 // 8 : 获取19服务0xF00616的索引号
// 9 : 获取19服务0xF00617的索引号 // 9 : 获取19服务0xF00617的索引号
// 10: 获取19服务0x918112的索引号 // 10: 获取19服务0x918112的索引号
// 11: 获取19服务0x918114的索引号 // 11: 获取19服务0x918114的索引号
// 12: 获取19服务0x918171的索引号 // 12: 获取19服务0x918171的索引号
// 13: 获取19服务0x918312的索引号 // 13: 获取19服务0x918312的索引号
// 14: 获取19服务0x918314的索引号 // 14: 获取19服务0x918314的索引号
// 15: 获取19服务0x918371的索引号 // 15: 获取19服务0x918371的索引号
// 16: 获取19服务0x918412的索引号 // 16: 获取19服务0x918412的索引号
// 17: 获取19服务0x918414的索引号 // 17: 获取19服务0x918414的索引号
// 18: 获取19服务0x918471的索引号 // 18: 获取19服务0x918471的索引号
// 19: 获取19服务0x918611的索引号 // 19: 获取19服务0x918611的索引号
// 20: 获取19服务0x918614的索引号 // 20: 获取19服务0x918614的索引号
// 21: 获取19服务0xC07300的索引号 // 21: 获取19服务0xC07300的索引号
// 返回值: // // 返回值: //
// 2E 服务数据索引号 // // 2E 服务数据索引号 //
// // // //
************************************************************************************/ ************************************************************************************/
@ -379,20 +382,20 @@ const unsigned char DF_INDEX_TAB[]={
5U , //BLOCK_0xF199, 5U , //BLOCK_0xF199,
6U , //BLOCK_0xF19D, 6U , //BLOCK_0xF19D,
7U , //BLOCK_0xF112, 7U , //BLOCK_0xF112,
8U , //19服务0xF00616 8U , //19服务0xF00616
9U , //19服务0xF00617 9U , //19服务0xF00617
10U , //19服务0x918112 10U , //19服务0x918112
11U , //19服务0x918114 11U , //19服务0x918114
12U , //19服务0x918171 12U , //19服务0x918171
13U , //19服务0x918312 13U , //19服务0x918312
14U , //19服务0x918314 14U , //19服务0x918314
15U , //19服务0x918371 15U , //19服务0x918371
16U , //19服务0x918412 16U , //19服务0x918412
17U , //19服务0x918414 17U , //19服务0x918414
18U , //19服务0x918471 18U , //19服务0x918471
19U , //19服务0x918611 19U , //19服务0x918611
20U , //19服务0x918614 20U , //19服务0x918614
21U //19服务0xC07300 21U //19服务0xC07300
}; };
@ -402,11 +405,11 @@ unsigned char GetIndexNumber(unsigned char code)
} }
/************************************************************************************ /************************************************************************************
// 获取AC硬件版本 // // 获取AC硬件版本 //
// 输入参数 hdv : // // 输入参数 hdv : //
// 指向读取数据存入的缓冲区的地址 // // 指向读取数据存入的缓冲区的地址 //
// // // //
// 返回值: // // 返回值: //
// // // //
// // // //
************************************************************************************/ ************************************************************************************/
@ -424,11 +427,11 @@ void GetHardwareVersion(unsigned char* hdv)
} }
/************************************************************************************ /************************************************************************************
// 获取AC软件版本 // // 获取AC软件版本 //
// 输入参数 swv : // // 输入参数 swv : //
// 指向读取数据存入的缓冲区的地址 // // 指向读取数据存入的缓冲区的地址 //
// // // //
// 返回值: // // 返回值: //
// // // //
// // // //
************************************************************************************/ ************************************************************************************/
@ -437,17 +440,17 @@ void GetSoftwareVersion(unsigned char* swv)
{ {
unsigned char cnt; unsigned char cnt;
for(cnt=0;cnt<13;cnt++){ for(cnt=0;cnt<10;cnt++){
swv[cnt] = SW_VERSION[cnt]; swv[cnt] = SW_VERSION[cnt];
} }
} }
/************************************************************************************ /************************************************************************************
// 获取AC供应商软件版本 // // 获取AC供应商软件版本 //
// 输入参数 swv : // // 输入参数 swv : //
// 指向读取数据存入的缓冲区的地址 // // 指向读取数据存入的缓冲区的地址 //
// // // //
// 返回值: // // 返回值: //
// // // //
// // // //
************************************************************************************/ ************************************************************************************/
@ -465,21 +468,21 @@ void GetSupplierSoftwareVersion(unsigned char* swv)
/************************************************************************************ /************************************************************************************
// 获取AC生产日期 // // 获取AC生产日期 //
// 输入参数 *date : // // 输入参数 *date : //
// data[0] = YEAR // // data[0] = YEAR //
// data[1] = MONTH // // data[1] = MONTH //
// data[0] = DAY // // data[0] = DAY //
// // // //
// 返回值: // // 返回值: //
// // // //
// // // //
************************************************************************************/ ************************************************************************************/
const unsigned char MANUFACTURING_DATE[]={ const unsigned char MANUFACTURING_DATE[]={
0x18, //Year 0x23, //Year
0x06, //Month 0x07, //Month
0x15, //Day 0x10, //Day
}; };
void GetManufacturingDate(unsigned char* date) void GetManufacturingDate(unsigned char* date)
@ -490,8 +493,8 @@ void GetManufacturingDate(unsigned char* date)
} }
/******************************/ /******************************/
//获取can总线出错状态 //获取can总线出错状态
//返回值 //返回值
/******************************/ /******************************/
unsigned char GetCanBusOffErr(void) unsigned char GetCanBusOffErr(void)
{ {
@ -501,8 +504,8 @@ unsigned char GetCanBusOffErr(void)
// return 1; // return 1;
} }
/******************************/ /******************************/
//获取BCM节点丢失状态 //获取BCM节点丢失状态
//返回值 //返回值
/******************************/ /******************************/
unsigned char GetBcmCommFault(void) unsigned char GetBcmCommFault(void)
@ -519,8 +522,8 @@ unsigned char GetBcmCommFault(void)
// } // }
} }
/******************************/ /******************************/
//获取ACP节点丢失状态 //获取ACP节点丢失状态
//返回值 //返回值
/******************************/ /******************************/
unsigned char GetAcpCommFault(void) unsigned char GetAcpCommFault(void)
{ {
@ -537,20 +540,20 @@ unsigned char GetAcpCommFault(void)
} }
/******************************/ /******************************/
//获取历史成功编程次数 //获取历史成功编程次数
//输入参数 //输入参数
// //
//返回值:历史成功编程次数 //返回值:历史成功编程次数
/******************************/ /******************************/
unsigned char GetProgrammingCounter(void) unsigned char GetProgrammingCounter(void)
{ {
return 0; return 0;
} }
/******************************/ /******************************/
//获取历史编程次数 //获取历史编程次数
//输入参数 //输入参数
// //
//返回值:历史编程次数 //返回值:历史编程次数
/******************************/ /******************************/
unsigned char GetProgrammingAttempCounter(void) unsigned char GetProgrammingAttempCounter(void)
{ {
@ -558,10 +561,10 @@ unsigned char GetProgrammingAttempCounter(void)
} }
/******************************/ /******************************/
//清除DTC //清除DTC
//目前仅BusOff //目前仅BusOff
// //
//返回值0 //返回值0
/******************************/ /******************************/
unsigned char Clear_DTC_Data(void) unsigned char Clear_DTC_Data(void)
{ {

View File

@ -20,10 +20,10 @@
/*********************************************************************************************************************** /***********************************************************************************************************************
* File Name : r_cg_adc.c * File Name : r_cg_adc.c
* Version : CodeGenerator for RL78/F13 V2.03.07.02 [08 Nov 2021] * Version : CodeGenerator for RL78/F13 V2.03.07.02 [08 Nov 2021]
* Device(s) : R5F10BGG * Device(s) : R5F10BBG
* Tool-Chain : CCRL * Tool-Chain : CCRL
* Description : This file implements device driver for ADC module. * Description : This file implements device driver for ADC module.
* Creation Date: 2023-05-03 * Creation Date: 2023-07-10
***********************************************************************************************************************/ ***********************************************************************************************************************/
/*********************************************************************************************************************** /***********************************************************************************************************************
@ -63,15 +63,15 @@ void R_ADC_Create(void)
ADPR1 = 1U; ADPR1 = 1U;
ADPR0 = 1U; ADPR0 = 1U;
/* The reset status of ADPC is analog input, so it's unnecessary to set. */ /* The reset status of ADPC is analog input, so it's unnecessary to set. */
/* Set ANI0 - ANI6 pin as analog input */ /* Set ANI0 - ANI4 pin as analog input */
PM8 |= 0x1FU; PM8 |= 0x07U;
PM3 |= 0x18U; PM3 |= 0x18U;
ADM0 = _08_AD_CONVERSION_CLOCK_32 | _00_AD_TIME_MODE_NORMAL_1 | _00_AD_OPERMODE_SELECT; ADM0 = _00_AD_CONVERSION_CLOCK_64 | _00_AD_TIME_MODE_NORMAL_1 | _00_AD_OPERMODE_SELECT;
ADM1 = _C0_AD_TRIGGER_HARDWARE_WAIT | _20_AD_CONVMODE_ONESELECT | _00_AD_TRIGGER_INTTM01; ADM1 = _80_AD_TRIGGER_HARDWARE_NOWAIT | _20_AD_CONVMODE_ONESELECT | _00_AD_TRIGGER_INTTM01;
ADM2 = _00_AD_POSITIVE_VDD | _00_AD_NEGATIVE_VSS | _00_AD_AREA_MODE_1 | _00_AD_RESOLUTION_10BIT; ADM2 = _00_AD_POSITIVE_VDD | _00_AD_NEGATIVE_VSS | _00_AD_AREA_MODE_1 | _00_AD_RESOLUTION_10BIT;
ADUL = _FF_AD_ADUL_VALUE; ADUL = _FF_AD_ADUL_VALUE;
ADLL = _00_AD_ADLL_VALUE; ADLL = _00_AD_ADLL_VALUE;
ADS = _06_AD_INPUT_CHANNEL_6; ADS = _04_AD_INPUT_CHANNEL_4;
ADCE = 1U; /* enable AD comparator */ ADCE = 1U; /* enable AD comparator */
} }
@ -85,6 +85,7 @@ void R_ADC_Start(void)
{ {
ADIF = 0U; /* clear INTAD interrupt flag */ ADIF = 0U; /* clear INTAD interrupt flag */
ADMK = 0U; /* enable INTAD interrupt */ ADMK = 0U; /* enable INTAD interrupt */
ADCS = 1U; /* enable AD conversion */
} }
/*********************************************************************************************************************** /***********************************************************************************************************************

View File

@ -20,10 +20,10 @@
/*********************************************************************************************************************** /***********************************************************************************************************************
* File Name : r_cg_adc.h * File Name : r_cg_adc.h
* Version : CodeGenerator for RL78/F13 V2.03.07.02 [08 Nov 2021] * Version : CodeGenerator for RL78/F13 V2.03.07.02 [08 Nov 2021]
* Device(s) : R5F10BGG * Device(s) : R5F10BBG
* Tool-Chain : CCRL * Tool-Chain : CCRL
* Description : This file implements device driver for ADC module. * Description : This file implements device driver for ADC module.
* Creation Date: 2023-05-03 * Creation Date: 2023-07-10
***********************************************************************************************************************/ ***********************************************************************************************************************/
#ifndef ADC_H #ifndef ADC_H
@ -78,11 +78,6 @@ Macro definitions (Register bit)
#define _05_AD_INPUT_CHANNEL_5 (0x05U) /* ANI5 */ #define _05_AD_INPUT_CHANNEL_5 (0x05U) /* ANI5 */
#define _06_AD_INPUT_CHANNEL_6 (0x06U) /* ANI6 */ #define _06_AD_INPUT_CHANNEL_6 (0x06U) /* ANI6 */
#define _07_AD_INPUT_CHANNEL_7 (0x07U) /* ANI7 */ #define _07_AD_INPUT_CHANNEL_7 (0x07U) /* ANI7 */
#define _08_AD_INPUT_CHANNEL_8 (0x08U) /* ANI8 */
#define _09_AD_INPUT_CHANNEL_9 (0x09U) /* ANI9 */
#define _0A_AD_INPUT_CHANNEL_10 (0x0AU) /* ANI10 */
#define _0B_AD_INPUT_CHANNEL_11 (0x0BU) /* ANI11 */
#define _0C_AD_INPUT_CHANNEL_12 (0x0CU) /* ANI12 */
#define _18_AD_INPUT_CHANNEL_24 (0x18U) /* ANI24 */ #define _18_AD_INPUT_CHANNEL_24 (0x18U) /* ANI24 */
#define _19_AD_INPUT_CHANNEL_25 (0x19U) /* ANI25 */ #define _19_AD_INPUT_CHANNEL_25 (0x19U) /* ANI25 */
#define _80_AD_INPUT_TEMPERSENSOR_0 (0x80U) /* temperature sensor 0 output is used to be the input channel */ #define _80_AD_INPUT_TEMPERSENSOR_0 (0x80U) /* temperature sensor 0 output is used to be the input channel */
@ -93,11 +88,6 @@ Macro definitions (Register bit)
#define _02_AD_INPUT_CHANNEL_2_5 (0x02U) /* ANI2 - ANI5 */ #define _02_AD_INPUT_CHANNEL_2_5 (0x02U) /* ANI2 - ANI5 */
#define _03_AD_INPUT_CHANNEL_3_6 (0x03U) /* ANI3 - ANI6 */ #define _03_AD_INPUT_CHANNEL_3_6 (0x03U) /* ANI3 - ANI6 */
#define _04_AD_INPUT_CHANNEL_4_7 (0x04U) /* ANI4 - ANI7 */ #define _04_AD_INPUT_CHANNEL_4_7 (0x04U) /* ANI4 - ANI7 */
#define _05_AD_INPUT_CHANNEL_5_8 (0x05U) /* ANI5 - ANI8 */
#define _06_AD_INPUT_CHANNEL_6_9 (0x06U) /* ANI6 - ANI9 */
#define _07_AD_INPUT_CHANNEL_7_10 (0x07U) /* ANI7 - ANI10 */
#define _08_AD_INPUT_CHANNEL_8_11 (0x08U) /* ANI8 - ANI11 */
#define _09_AD_INPUT_CHANNEL_9_12 (0x09U) /* ANI9 - ANI12 */
/* /*
AD converter mode register 1 (ADM1) AD converter mode register 1 (ADM1)
@ -168,8 +158,7 @@ Typedef definitions
typedef enum typedef enum
{ {
ADCHANNEL0, ADCHANNEL1, ADCHANNEL2, ADCHANNEL3, ADCHANNEL4, ADCHANNEL5, ADCHANNEL6, ADCHANNEL0, ADCHANNEL1, ADCHANNEL2, ADCHANNEL3, ADCHANNEL4, ADCHANNEL5, ADCHANNEL6,
ADCHANNEL7, ADCHANNEL8, ADCHANNEL9, ADCHANNEL10, ADCHANNEL11, ADCHANNEL12, ADCHANNEL7, ADCHANNEL24 = 24U, ADCHANNEL25, ADTEMPERSENSOR0 = 128U, ADINTERREFVOLT
ADCHANNEL24 = 24U, ADCHANNEL25, ADTEMPERSENSOR0 = 128U, ADINTERREFVOLT
} ad_channel_t; } ad_channel_t;
typedef enum typedef enum
{ {

View File

@ -20,10 +20,10 @@
/*********************************************************************************************************************** /***********************************************************************************************************************
* File Name : r_cg_adc_user.c * File Name : r_cg_adc_user.c
* Version : CodeGenerator for RL78/F13 V2.03.07.02 [08 Nov 2021] * Version : CodeGenerator for RL78/F13 V2.03.07.02 [08 Nov 2021]
* Device(s) : R5F10BGG * Device(s) : R5F10BBG
* Tool-Chain : CCRL * Tool-Chain : CCRL
* Description : This file implements device driver for ADC module. * Description : This file implements device driver for ADC module.
* Creation Date: 2023-05-03 * Creation Date: 2023-07-10
***********************************************************************************************************************/ ***********************************************************************************************************************/
/*********************************************************************************************************************** /***********************************************************************************************************************

View File

@ -20,10 +20,10 @@
/*********************************************************************************************************************** /***********************************************************************************************************************
* File Name : r_cg_cgc.c * File Name : r_cg_cgc.c
* Version : CodeGenerator for RL78/F13 V2.03.07.02 [08 Nov 2021] * Version : CodeGenerator for RL78/F13 V2.03.07.02 [08 Nov 2021]
* Device(s) : R5F10BGG * Device(s) : R5F10BBG
* Tool-Chain : CCRL * Tool-Chain : CCRL
* Description : This file implements device driver for CGC module. * Description : This file implements device driver for CGC module.
* Creation Date: 2023-05-03 * Creation Date: 2023-07-10
***********************************************************************************************************************/ ***********************************************************************************************************************/
/*********************************************************************************************************************** /***********************************************************************************************************************
@ -62,7 +62,7 @@ void R_CGC_Create(void)
/* Set fSL */ /* Set fSL */
SELLOSC = 1U; SELLOSC = 1U;
/* Set fMX */ /* Set fMX */
CMC = _40_CGC_HISYS_OSC | _00_CGC_SUB_PORT | _00_CGC_SYSOSC_UNDER10M | _00_CGC_SUBMODE_DEFAULT; CMC = _40_CGC_HISYS_OSC | _00_CGC_SYSOSC_UNDER10M;
OSTS = _07_CGC_OSCSTAB_SEL18; OSTS = _07_CGC_OSCSTAB_SEL18;
MSTOP = 0U; MSTOP = 0U;
temp_stab_set = _FF_CGC_OSCSTAB_STA18; temp_stab_set = _FF_CGC_OSCSTAB_STA18;
@ -107,8 +107,6 @@ void R_CGC_Create(void)
; ;
} }
/* Set fSUB */
XTSTOP = 1U;
/* Set fCLK */ /* Set fCLK */
CSS = 0U; CSS = 0U;
/* Set fIH */ /* Set fIH */

View File

@ -20,10 +20,10 @@
/*********************************************************************************************************************** /***********************************************************************************************************************
* File Name : r_cg_cgc.h * File Name : r_cg_cgc.h
* Version : CodeGenerator for RL78/F13 V2.03.07.02 [08 Nov 2021] * Version : CodeGenerator for RL78/F13 V2.03.07.02 [08 Nov 2021]
* Device(s) : R5F10BGG * Device(s) : R5F10BBG
* Tool-Chain : CCRL * Tool-Chain : CCRL
* Description : This file implements device driver for CGC module. * Description : This file implements device driver for CGC module.
* Creation Date: 2023-05-03 * Creation Date: 2023-07-10
***********************************************************************************************************************/ ***********************************************************************************************************************/
#ifndef CGC_H #ifndef CGC_H
@ -41,17 +41,6 @@ Macro definitions (Register bit)
#define _40_CGC_HISYS_OSC (0x40U) /* X1, X2 as crystal/ceramic resonator connection */ #define _40_CGC_HISYS_OSC (0x40U) /* X1, X2 as crystal/ceramic resonator connection */
#define _80_CGC_HISYS_PORT1 (0x80U) /* X1, X2 as I/O port */ #define _80_CGC_HISYS_PORT1 (0x80U) /* X1, X2 as I/O port */
#define _C0_CGC_HISYS_EXT (0xC0U) /* X1 as I/O port, X2 as external clock input */ #define _C0_CGC_HISYS_EXT (0xC0U) /* X1 as I/O port, X2 as external clock input */
/* Subsystem clock pin operation mode (EXCLKS, OSCSELS) */
#define _30_CGC_SUB_PIN (0x30U)
#define _00_CGC_SUB_PORT (0x00U) /* XT1, XT2 as I/O port */
#define _10_CGC_SUB_OSC (0x10U) /* XT1, XT2 as crystal connection */
#define _20_CGC_SUB_PORT1 (0x20U) /* XT1, XT2 as I/O port */
#define _30_CGC_SUB_EXT (0x30U) /* XT1 as I/O port, XT2 as external clock input */
/* XT1 oscillator oscillation mode selection (AMPHS1, AMPHS0) */
#define _00_CGC_SUBMODE_DEFAULT (0x00U)
#define _00_CGC_SUBMODE_LOW (0x00U) /* low power consumption oscillation */
#define _02_CGC_SUBMODE_NORMAL (0x02U) /* normal oscillation */
#define _04_CGC_SUBMODE_ULOW (0x04U) /* ultra-low power consumption oscillation */
/* Control of X1 high-speed system clock oscillation frequency (AMPH) */ /* Control of X1 high-speed system clock oscillation frequency (AMPH) */
#define _00_CGC_SYSOSC_DEFAULT (0x00U) #define _00_CGC_SYSOSC_DEFAULT (0x00U)
#define _00_CGC_SYSOSC_UNDER10M (0x00U) /* fX <= 10MHz */ #define _00_CGC_SYSOSC_UNDER10M (0x00U) /* fX <= 10MHz */
@ -63,9 +52,6 @@ Macro definitions (Register bit)
/* Control of high-speed system clock operation (MSTOP) */ /* Control of high-speed system clock operation (MSTOP) */
#define _00_CGC_HISYS_OPER (0x00U) /* X1 oscillator/external clock operating */ #define _00_CGC_HISYS_OPER (0x00U) /* X1 oscillator/external clock operating */
#define _80_CGC_HISYS_STOP (0x80U) /* X1 oscillator/external clock stopped */ #define _80_CGC_HISYS_STOP (0x80U) /* X1 oscillator/external clock stopped */
/* Subsystem clock operation (XTSTOP) */
#define _00_CGC_SUB_OPER (0x00U) /* XT1 oscillator operating */
#define _40_CGC_SUB_STOP (0x40U) /* XT1 oscillator stopped */
/* High-speed OCO operation (HIOSTOP) */ /* High-speed OCO operation (HIOSTOP) */
#define _00_CGC_HIO_OPER (0x00U) /* high-speed OCO operating */ #define _00_CGC_HIO_OPER (0x00U) /* high-speed OCO operating */
#define _01_CGC_HIO_STOP (0x01U) /* high-speed OCO stopped */ #define _01_CGC_HIO_STOP (0x01U) /* high-speed OCO stopped */
@ -142,12 +128,6 @@ Macro definitions (Register bit)
/* /*
System clock control register (CKC) System clock control register (CKC)
*/ */
/* Status of CPU/peripheral hardware clock fCLK (CLS) */
#define _00_CGC_CPUCLK_MAIN (0x00U) /* main system clock (fMAIN) */
#define _80_CGC_CPUCLK_SUB (0x80U) /* subsystem clock (fSUB) */
/* Selection of CPU/peripheral hardware clock fCLK (CSS) */
#define _00_CGC_CPUCLK_SELMAIN (0x00U) /* main system clock (fMAIN) */
#define _40_CGC_CPUCLK_SELSUB (0x40U) /* subsystem clock (fSUB) */
/* Status of Main system clock fMAIN (MCS) */ /* Status of Main system clock fMAIN (MCS) */
#define _00_CGC_MAINCLK_HIO (0x00U) /* high-speed OCO clock (fIH) */ #define _00_CGC_MAINCLK_HIO (0x00U) /* high-speed OCO clock (fIH) */
#define _20_CGC_MAINCLK_HISYS (0x20U) /* high-speed system clock (fMX) */ #define _20_CGC_MAINCLK_HISYS (0x20U) /* high-speed system clock (fMX) */
@ -212,9 +192,7 @@ typedef enum
{ {
HIOCLK, HIOCLK,
SYSX1CLK, SYSX1CLK,
SYSEXTCLK, SYSEXTCLK
SUBXT1CLK,
SUBEXTCLK
} clock_mode_t; } clock_mode_t;
/*********************************************************************************************************************** /***********************************************************************************************************************

View File

@ -20,10 +20,10 @@
/*********************************************************************************************************************** /***********************************************************************************************************************
* File Name : r_cg_cgc_user.c * File Name : r_cg_cgc_user.c
* Version : CodeGenerator for RL78/F13 V2.03.07.02 [08 Nov 2021] * Version : CodeGenerator for RL78/F13 V2.03.07.02 [08 Nov 2021]
* Device(s) : R5F10BGG * Device(s) : R5F10BBG
* Tool-Chain : CCRL * Tool-Chain : CCRL
* Description : This file implements device driver for CGC module. * Description : This file implements device driver for CGC module.
* Creation Date: 2023-05-03 * Creation Date: 2023-07-10
***********************************************************************************************************************/ ***********************************************************************************************************************/
/*********************************************************************************************************************** /***********************************************************************************************************************

View File

@ -20,10 +20,10 @@
/*********************************************************************************************************************** /***********************************************************************************************************************
* File Name : r_cg_macrodriver.h * File Name : r_cg_macrodriver.h
* Version : CodeGenerator for RL78/F13 V2.03.07.02 [08 Nov 2021] * Version : CodeGenerator for RL78/F13 V2.03.07.02 [08 Nov 2021]
* Device(s) : R5F10BGG * Device(s) : R5F10BBG
* Tool-Chain : CCRL * Tool-Chain : CCRL
* Description : This file implements general head file. * Description : This file implements general head file.
* Creation Date: 2023-05-03 * Creation Date: 2023-07-10
***********************************************************************************************************************/ ***********************************************************************************************************************/
#ifndef STATUS_H #ifndef STATUS_H

View File

@ -20,10 +20,10 @@
/*********************************************************************************************************************** /***********************************************************************************************************************
* File Name : r_cg_port.c * File Name : r_cg_port.c
* Version : CodeGenerator for RL78/F13 V2.03.07.02 [08 Nov 2021] * Version : CodeGenerator for RL78/F13 V2.03.07.02 [08 Nov 2021]
* Device(s) : R5F10BGG * Device(s) : R5F10BBG
* Tool-Chain : CCRL * Tool-Chain : CCRL
* Description : This file implements device driver for PORT module. * Description : This file implements device driver for PORT module.
* Creation Date: 2023-05-03 * Creation Date: 2023-07-10
***********************************************************************************************************************/ ***********************************************************************************************************************/
/*********************************************************************************************************************** /***********************************************************************************************************************
@ -58,12 +58,10 @@ void R_PORT_Create(void)
P1 = _00_Pn2_OUTPUT_0; P1 = _00_Pn2_OUTPUT_0;
PMC12 = _00_PMCn0_DI_ON | _00_PMCn5_DI_ON | _DE_PMC12_DEFAULT; PMC12 = _00_PMCn0_DI_ON | _00_PMCn5_DI_ON | _DE_PMC12_DEFAULT;
PSRSEL = _00_PSR120_NORMAL | _00_PSR30_NORMAL | _00_PSR12_NORMAL; PSRSEL = _00_PSR120_NORMAL | _00_PSR30_NORMAL | _00_PSR12_NORMAL;
PM0 = _01_PMn0_MODE_INPUT | _FE_PM0_DEFAULT;
PM1 = _01_PMn0_NOT_USE | _02_PMn1_NOT_USE | _00_PMn2_MODE_OUTPUT | _08_PMn3_NOT_USE | _10_PMn4_NOT_USE | PM1 = _01_PMn0_NOT_USE | _02_PMn1_NOT_USE | _00_PMn2_MODE_OUTPUT | _08_PMn3_NOT_USE | _10_PMn4_NOT_USE |
_20_PMn5_NOT_USE | _40_PMn6_NOT_USE | _80_PMn7_NOT_USE; _20_PMn5_NOT_USE | _40_PMn6_MODE_INPUT | _80_PMn7_MODE_INPUT;
PM3 = _01_PMn0_MODE_INPUT | _02_PMn1_NOT_USE | _04_PMn2_MODE_INPUT | _08_PMn3_NOT_USE | _10_PMn4_NOT_USE | PM3 = _01_PMn0_MODE_INPUT | _08_PMn3_NOT_USE | _10_PMn4_NOT_USE | _E6_PM3_DEFAULT;
_E0_PM3_DEFAULT; PM6 = _01_PMn0_NOT_USE | _02_PMn1_NOT_USE | _04_PMn2_MODE_INPUT | _08_PMn3_MODE_INPUT | _F0_PM6_DEFAULT;
PM7 = _01_PMn0_MODE_INPUT | _02_PMn1_MODE_INPUT | _04_PMn2_NOT_USE | _08_PMn3_NOT_USE | _F0_PM7_DEFAULT;
PM12 = _01_PMn0_MODE_INPUT | _20_PMn5_MODE_INPUT | _DE_PM12_DEFAULT; PM12 = _01_PMn0_MODE_INPUT | _20_PMn5_MODE_INPUT | _DE_PM12_DEFAULT;
} }

View File

@ -20,10 +20,10 @@
/*********************************************************************************************************************** /***********************************************************************************************************************
* File Name : r_cg_port.h * File Name : r_cg_port.h
* Version : CodeGenerator for RL78/F13 V2.03.07.02 [08 Nov 2021] * Version : CodeGenerator for RL78/F13 V2.03.07.02 [08 Nov 2021]
* Device(s) : R5F10BGG * Device(s) : R5F10BBG
* Tool-Chain : CCRL * Tool-Chain : CCRL
* Description : This file implements device driver for PORT module. * Description : This file implements device driver for PORT module.
* Creation Date: 2023-05-03 * Creation Date: 2023-07-10
***********************************************************************************************************************/ ***********************************************************************************************************************/
#ifndef PORT_H #ifndef PORT_H
@ -214,32 +214,24 @@ Macro definitions (Register bit)
AD port configuration register (ADPC) AD port configuration register (ADPC)
*/ */
/* Analog input/digital input switching (ADPC4 - ADPC0) */ /* Analog input/digital input switching (ADPC4 - ADPC0) */
#define _00_ADPC_DI_OFF (0x00U) /* use P33, P34, P80 - P87, P90 - P92 as analog input */ #define _00_ADPC_DI_OFF (0x00U) /* use P33, P34, P80 - P85 as analog input */
#define _0D_ADPC_DI_ON (0x0DU) /* use P92 as digital input */ #define _08_ADPC_DI_ON (0x08U) /* use P85 as digital input */
#define _0C_ADPC_DI_ON (0x0CU) /* use P91 - P92 as digital input */ #define _07_ADPC_DI_ON (0x07U) /* use P84 - P85 as digital input */
#define _0B_ADPC_DI_ON (0x0BU) /* use P90 - P92 as digital input */ #define _06_ADPC_DI_ON (0x06U) /* use P83 - P85 as digital input */
#define _0A_ADPC_DI_ON (0x0AU) /* use P87, P90 - P92 as digital input */ #define _05_ADPC_DI_ON (0x05U) /* use P82 - P85 as digital input */
#define _09_ADPC_DI_ON (0x09U) /* use P86 - P87, P90 - P92 as digital input */ #define _04_ADPC_DI_ON (0x04U) /* use P81 - P85 as digital input */
#define _08_ADPC_DI_ON (0x08U) /* use P85 - P87, P90 - P92 as digital input */ #define _03_ADPC_DI_ON (0x03U) /* use P80 - P85 as digital input */
#define _07_ADPC_DI_ON (0x07U) /* use P84 - P87, P90 - P92 as digital input */ #define _02_ADPC_DI_ON (0x02U) /* use P34, P80 - P85 as digital input */
#define _06_ADPC_DI_ON (0x06U) /* use P83 - P87, P90 - P92 as digital input */ #define _01_ADPC_DI_ON (0x01U) /* use P33, P34, P85 as digital input */
#define _05_ADPC_DI_ON (0x05U) /* use P82 - P87, P90 - P92 as digital input */
#define _04_ADPC_DI_ON (0x04U) /* use P81 - P87, P90 - P92 as digital input */
#define _03_ADPC_DI_ON (0x03U) /* use P80 - P87, P90 - P92 as digital input */
#define _02_ADPC_DI_ON (0x02U) /* use P34, P80 - P87, P90 - P92 as digital input */
#define _01_ADPC_DI_ON (0x01U) /* use P33, P34, P80 - P87, P90 - P92 as digital input */
/*********************************************************************************************************************** /***********************************************************************************************************************
Macro definitions Macro definitions
***********************************************************************************************************************/ ***********************************************************************************************************************/
#define _FE_PM0_DEFAULT (0xFEU) /* PM0 default value */ #define _E6_PM3_DEFAULT (0xE6U) /* PM3 default value */
#define _E0_PM3_DEFAULT (0xE0U) /* PM3 default value */
#define _FC_PM4_DEFAULT (0xFCU) /* PM4 default value */ #define _FC_PM4_DEFAULT (0xFCU) /* PM4 default value */
#define _F0_PM6_DEFAULT (0xF0U) /* PM6 default value */ #define _F0_PM6_DEFAULT (0xF0U) /* PM6 default value */
#define _F0_PM7_DEFAULT (0xF0U) /* PM7 default value */ #define _C0_PM8_DEFAULT (0xC0U) /* PM8 default value */
#define _F8_PM9_DEFAULT (0xF8U) /* PM9 default value */
#define _DE_PM12_DEFAULT (0xDEU) /* PM12 default value */ #define _DE_PM12_DEFAULT (0xDEU) /* PM12 default value */
#define _FE_PM14_DEFAULT (0xFEU) /* PM14 default value */
#define _DE_PMC12_DEFAULT (0xDEU) /* PMC12 default value */ #define _DE_PMC12_DEFAULT (0xDEU) /* PMC12 default value */

View File

@ -20,10 +20,10 @@
/*********************************************************************************************************************** /***********************************************************************************************************************
* File Name : r_cg_port_user.c * File Name : r_cg_port_user.c
* Version : CodeGenerator for RL78/F13 V2.03.07.02 [08 Nov 2021] * Version : CodeGenerator for RL78/F13 V2.03.07.02 [08 Nov 2021]
* Device(s) : R5F10BGG * Device(s) : R5F10BBG
* Tool-Chain : CCRL * Tool-Chain : CCRL
* Description : This file implements device driver for PORT module. * Description : This file implements device driver for PORT module.
* Creation Date: 2023-05-03 * Creation Date: 2023-07-10
***********************************************************************************************************************/ ***********************************************************************************************************************/
/*********************************************************************************************************************** /***********************************************************************************************************************

View File

@ -20,10 +20,10 @@
/*********************************************************************************************************************** /***********************************************************************************************************************
* File Name : r_cg_timer.c * File Name : r_cg_timer.c
* Version : CodeGenerator for RL78/F13 V2.03.07.02 [08 Nov 2021] * Version : CodeGenerator for RL78/F13 V2.03.07.02 [08 Nov 2021]
* Device(s) : R5F10BGG * Device(s) : R5F10BBG
* Tool-Chain : CCRL * Tool-Chain : CCRL
* Description : This file implements device driver for TAU module. * Description : This file implements device driver for TAU module.
* Creation Date: 2023-05-03 * Creation Date: 2023-07-10
***********************************************************************************************************************/ ***********************************************************************************************************************/
/*********************************************************************************************************************** /***********************************************************************************************************************
@ -108,7 +108,7 @@ void R_TAU0_Create(void)
/* Channel 1 used as interval timer */ /* Channel 1 used as interval timer */
TMR01 = _0000_TAU_CLOCK_SELECT_CKM0 | _0000_TAU_CLOCK_MODE_CKS | _0000_TAU_16BITS_MODE | TMR01 = _0000_TAU_CLOCK_SELECT_CKM0 | _0000_TAU_CLOCK_MODE_CKS | _0000_TAU_16BITS_MODE |
_0000_TAU_TRIGGER_SOFTWARE | _0000_TAU_MODE_INTERVAL_TIMER | _0000_TAU_START_INT_UNUSED; _0000_TAU_TRIGGER_SOFTWARE | _0000_TAU_MODE_INTERVAL_TIMER | _0000_TAU_START_INT_UNUSED;
TDR01 = _0C7F_TAU_TDR01_VALUE; TDR01 = _7CFF_TAU_TDR01_VALUE;
TOM0 &= ~_0002_TAU_CH1_OUTPUT_COMBIN; TOM0 &= ~_0002_TAU_CH1_OUTPUT_COMBIN;
TOL0 &= ~_0002_TAU_CH1_OUTPUT_LEVEL_L; TOL0 &= ~_0002_TAU_CH1_OUTPUT_LEVEL_L;
TO0 &= ~_0002_TAU_CH1_OUTPUT_VALUE_1; TO0 &= ~_0002_TAU_CH1_OUTPUT_VALUE_1;

View File

@ -20,10 +20,10 @@
/*********************************************************************************************************************** /***********************************************************************************************************************
* File Name : r_cg_timer.h * File Name : r_cg_timer.h
* Version : CodeGenerator for RL78/F13 V2.03.07.02 [08 Nov 2021] * Version : CodeGenerator for RL78/F13 V2.03.07.02 [08 Nov 2021]
* Device(s) : R5F10BGG * Device(s) : R5F10BBG
* Tool-Chain : CCRL * Tool-Chain : CCRL
* Description : This file implements device driver for TAU module. * Description : This file implements device driver for TAU module.
* Creation Date: 2023-05-03 * Creation Date: 2023-07-10
***********************************************************************************************************************/ ***********************************************************************************************************************/
#ifndef TAU_H #ifndef TAU_H
@ -1011,7 +1011,7 @@ Macro definitions
/* Clock divisor for TAU0 channel 0 */ /* Clock divisor for TAU0 channel 0 */
#define _0001_TAU0_CHANNEL0_DIVISOR (0x0001U) #define _0001_TAU0_CHANNEL0_DIVISOR (0x0001U)
/* 16-bit timer data register 01 (TDR01) */ /* 16-bit timer data register 01 (TDR01) */
#define _0C7F_TAU_TDR01_VALUE (0x0C7FU) #define _7CFF_TAU_TDR01_VALUE (0x7CFFU)
/* Clock divisor for TAU0 channel 1 */ /* Clock divisor for TAU0 channel 1 */
#define _0001_TAU0_CHANNEL1_DIVISOR (0x0001U) #define _0001_TAU0_CHANNEL1_DIVISOR (0x0001U)

View File

@ -20,10 +20,10 @@
/*********************************************************************************************************************** /***********************************************************************************************************************
* File Name : r_cg_timer_user.c * File Name : r_cg_timer_user.c
* Version : CodeGenerator for RL78/F13 V2.03.07.02 [08 Nov 2021] * Version : CodeGenerator for RL78/F13 V2.03.07.02 [08 Nov 2021]
* Device(s) : R5F10BGG * Device(s) : R5F10BBG
* Tool-Chain : CCRL * Tool-Chain : CCRL
* Description : This file implements device driver for TAU module. * Description : This file implements device driver for TAU module.
* Creation Date: 2023-05-03 * Creation Date: 2023-07-10
***********************************************************************************************************************/ ***********************************************************************************************************************/
/*********************************************************************************************************************** /***********************************************************************************************************************
@ -85,7 +85,7 @@ void __near r_tau0_channel0_interrupt(void)
void __near r_tau0_channel1_interrupt(void) void __near r_tau0_channel1_interrupt(void)
{ {
/* Start user code. Do not edit comment generated here */ /* Start user code. Do not edit comment generated here */
ADCS = 1; //ADCS = 1;
/* End user code. Do not edit comment generated here */ /* End user code. Do not edit comment generated here */
} }

View File

@ -20,10 +20,10 @@
/*********************************************************************************************************************** /***********************************************************************************************************************
* File Name : r_cg_userdefine.h * File Name : r_cg_userdefine.h
* Version : CodeGenerator for RL78/F13 V2.03.07.02 [08 Nov 2021] * Version : CodeGenerator for RL78/F13 V2.03.07.02 [08 Nov 2021]
* Device(s) : R5F10BGG * Device(s) : R5F10BBG
* Tool-Chain : CCRL * Tool-Chain : CCRL
* Description : This file includes user definition. * Description : This file includes user definition.
* Creation Date: 2023-05-03 * Creation Date: 2023-07-10
***********************************************************************************************************************/ ***********************************************************************************************************************/
#ifndef _USER_DEF_H #ifndef _USER_DEF_H
@ -59,12 +59,13 @@ typedef struct{
#define DID_0201_ADDR 0x1A008 #define DID_0201_ADDR 0x1A008
#define DID_F180_ADDR 0x19C20 #define DID_F180_ADDR 0x19C20
#define DID_F195_ADDR 0x19C10
#define DID_F193_ADDR 0x19C00 #define DID_F193_ADDR 0x19C00
#define DIAGNOSE_STD_V_H (0x03) /* 客户诊断标准版本号 */ #define DIAGNOSE_STD_V_H (0x03) /* <EFBFBD>ͻ<EFBFBD><EFBFBD><EFBFBD>ϱ<EFBFBD>׼<EFBFBD><EFBFBD><EFBFBD> */
#define DIAGNOSE_STD_V_L (0x02) #define DIAGNOSE_STD_V_L (0x02)
#define DIAGNOSE_PARAMETER_V_H (0x01) /* 诊断调查表版本号 */ #define DIAGNOSE_PARAMETER_V_H (0x01) /* <EFBFBD><EFBFBD>ϵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
#define DIAGNOSE_PARAMETER_V_L (0x08) #define DIAGNOSE_PARAMETER_V_L (0x08)
extern KamData_t KamData; extern KamData_t KamData;

View File

@ -20,10 +20,10 @@
/*********************************************************************************************************************** /***********************************************************************************************************************
* File Name : r_main.c * File Name : r_main.c
* Version : CodeGenerator for RL78/F13 V2.03.07.02 [08 Nov 2021] * Version : CodeGenerator for RL78/F13 V2.03.07.02 [08 Nov 2021]
* Device(s) : R5F10BGG * Device(s) : R5F10BBG
* Tool-Chain : CCRL * Tool-Chain : CCRL
* Description : This file implements main function. * Description : This file implements main function.
* Creation Date: 2023-05-03 * Creation Date: 2023-07-10
***********************************************************************************************************************/ ***********************************************************************************************************************/
/*********************************************************************************************************************** /***********************************************************************************************************************
@ -32,7 +32,6 @@ Includes
#include "r_cg_macrodriver.h" #include "r_cg_macrodriver.h"
#include "r_cg_cgc.h" #include "r_cg_cgc.h"
#include "r_cg_port.h" #include "r_cg_port.h"
#include "r_cg_intc.h"
#include "r_cg_adc.h" #include "r_cg_adc.h"
#include "r_cg_timer.h" #include "r_cg_timer.h"
/* Start user code for include. Do not edit comment generated here */ /* Start user code for include. Do not edit comment generated here */
@ -89,7 +88,7 @@ void main(void)
RecFreSetOld=0xff; //初始化循环电机的旧<E79A84>? RecFreSetOld=0xff; //初始化循环电机的旧<E79A84>?
ModeSetOld=0xff; ModeSetOld=0xff;
TempSetOld=0xff; TempSetOld=0xff;
Can_Msg_Change_1(); //can信息初始<EFBFBD>? Can_Msg_Change_1(); //canä¿¡æ<EFBFBD>¯åˆ<EFBFBD>å§ï¿?
*/ */
/* /*
R_TAU0_Channel0_Start();//timer R_TAU0_Channel0_Start();//timer

View File

@ -20,10 +20,10 @@
/*********************************************************************************************************************** /***********************************************************************************************************************
* File Name : r_systeminit.c * File Name : r_systeminit.c
* Version : CodeGenerator for RL78/F13 V2.03.07.02 [08 Nov 2021] * Version : CodeGenerator for RL78/F13 V2.03.07.02 [08 Nov 2021]
* Device(s) : R5F10BGG * Device(s) : R5F10BBG
* Tool-Chain : CCRL * Tool-Chain : CCRL
* Description : This file implements system initializing function. * Description : This file implements system initializing function.
* Creation Date: 2023-05-03 * Creation Date: 2023-07-10
***********************************************************************************************************************/ ***********************************************************************************************************************/
/*********************************************************************************************************************** /***********************************************************************************************************************
@ -32,7 +32,6 @@ Includes
#include "r_cg_macrodriver.h" #include "r_cg_macrodriver.h"
#include "r_cg_cgc.h" #include "r_cg_cgc.h"
#include "r_cg_port.h" #include "r_cg_port.h"
#include "r_cg_intc.h"
#include "r_cg_adc.h" #include "r_cg_adc.h"
#include "r_cg_timer.h" #include "r_cg_timer.h"
/* Start user code for include. Do not edit comment generated here */ /* Start user code for include. Do not edit comment generated here */
@ -60,17 +59,14 @@ Global variables and functions
void R_Systeminit(void) void R_Systeminit(void)
{ {
/* Set periperal I/O redirection */ /* Set periperal I/O redirection */
PIOR0 = 0x00U;
PIOR1 = 0x00U;
PIOR4 = 0x00U; PIOR4 = 0x00U;
PIOR5 = 0x04U; PIOR5 = 0x00U;
PIOR7 = 0x00U; PIOR7 = 0x00U;
R_CGC_Get_ResetSource(); R_CGC_Get_ResetSource();
R_CGC_Create(); R_CGC_Create();
R_PORT_Create(); R_PORT_Create();
R_ADC_Create(); R_ADC_Create();
R_TAU0_Create(); R_TAU0_Create();
R_INTC_Create();
/* Set invalid memory access detection control */ /* Set invalid memory access detection control */
IAWCTL = 0x00U; IAWCTL = 0x00U;

View File

@ -4,11 +4,11 @@
#include "iodefine.h" #include "iodefine.h"
#define CAN_STB P1_bit.no2 #define CAN_STB P1_bit.no2
#define KEY_UP P0_bit.no0 #define KEY_UP P6_bit.no2
#define KEY_DOWN P3_bit.no0 #define KEY_DOWN P1_bit.no6
#define KEY_LEFT P3_bit.no2 #define KEY_LEFT P1_bit.no7
#define KEY_RIGHT P7_bit.no1 #define KEY_RIGHT P6_bit.no3
#define KEY_MIDDLE P7_bit.no0 #define KEY_MIDDLE P3_bit.no0
#define KEY_XNP P12_bit.no0 #define KEY_XNP P12_bit.no0
#define KEY_XNM P12_bit.no5 #define KEY_XNM P12_bit.no5

View File

@ -58,7 +58,7 @@ void Apply_task(void)
// DiagnosticSession_Present=MngDcm_GetDiagnosticSession(); // DiagnosticSession_Present=MngDcm_GetDiagnosticSession();
App28sTxRxStatus = GetNormalMsgSts(); App28sTxRxStatus = GetNormalMsgSts();
Nw28sTxRxStatus = GetNetworkMsgSts(); Nw28sTxRxStatus = GetNetworkMsgSts();
XN_Scan();
// DiagnosticSession_Present=MngDcm_GetDiagnosticSession(); // DiagnosticSession_Present=MngDcm_GetDiagnosticSession();
if(CAN_STB == 0 && BusOff_flag == 0)//Tx enable if(CAN_STB == 0 && BusOff_flag == 0)//Tx enable
{ {
@ -74,7 +74,7 @@ void Apply_task(void)
BusOff_Detect(); BusOff_Detect();
} }
KeyScan(); KeyScan();
XN_Scan();
if (EEL_SAVE_CNT_DOWN_TIMER > 0) if (EEL_SAVE_CNT_DOWN_TIMER > 0)
{ {
EEL_SAVE_CNT_DOWN_TIMER--; EEL_SAVE_CNT_DOWN_TIMER--;