forked from renesas-rz/rzg2_flash_writer
-
Notifications
You must be signed in to change notification settings - Fork 1
/
dgmodul1.c
101 lines (84 loc) · 2.18 KB
/
dgmodul1.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
/*
* Copyright (c) 2015-2022, Renesas Electronics Corporation. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include "common.h"
#include "dgtable.h"
#include "dgmodul1.h"
#include "devdrv.h"
#include "devdrv.h"
#include "bit.h"
#include "rzg2l_def.h"
#include "cpudrv.h"
#include "scifdrv.h"
#define WDTCNT0 (RZG2L_WDT_BASE + 0x00)
#define WDTSET0 (RZG2L_WDT_BASE + 0x04)
extern const char *const AllHelpMess[ALL_HELP_MESS_LINE];
extern const com_menu MonCom[COMMAND_UNIT];
extern int32_t gComNo;
extern char gKeyBuf[64];
uint32_t gFLASH_CS1_ID;
/****************************************************************
MODULE : dgHelp *
FUNCTION : HELP MESSAGE *
COMMAND : H *
INPUT PARAMETER : H *
*****************************************************************/
void dgHelp(void)
{
char tmp[64],chPtr,helpNo;
chPtr=0;
if(!GetStrBlk(gKeyBuf,tmp,&chPtr,0)){
PutMess(AllHelpMess);
}
}
int32_t GetStr_ByteCount(char *str,uint32_t getByteCount)
{
uint32_t byteCount;
int32_t i;
for(byteCount=1;byteCount<=getByteCount;byteCount=byteCount+1){
i=1;
while(i==1){
i=GetChar(str);
}
str++;
i=1;
while(i==1){
i=GetChar(str);
}
str++;
}
*str = 0;
}
/****************************************************************
MODULE : dgScifSpeedUp *
FUNCTION : Scif speed UP Change 921.6kbps *
COMMAND : SUP *
INPUT PARAMETER : SUP *
*****************************************************************/
void dgScifSpeedUp(void)
{
PutStr("Scif speed UP",1);
PutStr("Please change to 921.6Kbps baud rate setting of the terminal.",1);
WaitPutCharSendEnd();
InitScif0_SCIFCLK(921600);
}
/****************************************************************
MODULE : dgScifSpeedDown *
FUNCTION : Scif speed Down Change 115.2kbps*
COMMAND : SDP *
INPUT PARAMETER : SDP *
*****************************************************************/
void dgScifSpeedDown(void)
{
PutStr("Scif speed DOWN",1);
PutStr("Please change to 115.2Kbps baud rate setting of the terminal.",1);
WaitPutCharSendEnd();
InitScif0_SCIFCLK(115200);
}
void dgReset(void)
{
*((volatile uint32_t*)WDTSET0) = 0x001FFFFF;
*((volatile uint32_t*)WDTCNT0) = 0x01;
}