chore: rename uart demos

This commit is contained in:
IOsetting 2022-01-01 16:34:37 +08:00
parent af375ba868
commit 1d8482ccb9
7 changed files with 51 additions and 17 deletions

View File

@ -0,0 +1,30 @@
// Copyright 2021 IOsetting <iosetting(at)outlook.com>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "fw_hal.h"
void main(void)
{
SYS_SetClock();
// UART1, baud 115200, baud source Timer1, 1T mode, no interrupt
UART1_ConfigMode1Dyn8bitUart(UART1_BaudSource_Timer1, HAL_State_ON, 115200);
while(1)
{
UART1_TxChar('T');
UART1_TxHex(0x41);
UART1_TxString("U");
UART1_TxString(" string\r\n");
SYS_Delay(1000);
}
}

View File

@ -32,6 +32,9 @@ typedef enum
void MEM_SelectWorkRegGroup(MEM_WorkRegGroup_t WorkRegGroup);
void MEM_SetOnchipExtRAM(HAL_State_t HAL_State);
#if (__CONF_MCU_TYPE == 3 )
void MEM_ReadChipID(uint8_t *buff);
#endif
#endif

View File

@ -25,6 +25,7 @@ void MEM_SetOnchipExtRAM(HAL_State_t HAL_State)
AUXR = AUXR & ~B00000010 | (HAL_State << 1);
}
#if (__CONF_MCU_TYPE == 3 )
void MEM_ReadChipID(uint8_t *buff)
{
uint8_t i;
@ -34,4 +35,5 @@ void MEM_ReadChipID(uint8_t *buff)
*(buff + i) = MEM_ReadXDATA(CHIPIDxx + i);
}
P_SW2 = 0x00;
}
}
#endif

View File

@ -101,28 +101,27 @@ void UTIL_Uart1_36M864_115200_Init(void)
}
/*
void UTIL_ItrimScan(uint8_t ircband, uint8_t *str)
void UTIL_ItrimScan(uint8_t ircband, uint8_t vrtrim, uint8_t irtrim_limit, uint8_t *str)
{
uint8_t i = 0xFF, j;
if (ircband & 0x01 > 0)
{
i = 0xDE;
}
uint8_t i = irtrim_limit, j;
do
{
j = 3;
do
{
SYS_SetFOSC(ircband, 0, i, j);
SYS_SetFOSC(ircband, vrtrim, i, j);
SYS_Delay(1);
UTIL_PrintHex(IRCBAND);
UTIL_PrintChar(' ');
UTIL_PrintHex(IRTRIM);
UTIL_PrintChar(0x20);
UTIL_PrintHex(LIRTRIM);
UTIL_PrintChar(0x20);
UTIL_PrintString(str);
SYS_Delay(5);
UART1_TxHex(IRCBAND);
UART1_TxChar(' ');
UART1_TxHex(VRTRIM);
UART1_TxChar(' ');
UART1_TxHex(IRTRIM);
UART1_TxChar(0x20);
UART1_TxHex(LIRTRIM);
UART1_TxChar(0x20);
UART1_TxString(str);
SYS_Delay(10);
} while (j--);
} while (i--);
}*/
}
*/