ATY_LIB
V2_102_230218
ATY_LIB for general devices or ALGO
Loading...
Searching...
No Matches
uart1_timer2_tx.c
Go to the documentation of this file.
1
// Copyright 2021 IOsetting <iosetting(at)outlook.com>
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
// http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14
15
#include "
fw_hal.h
"
16
17
void
main
(
void
)
18
{
19
SYS_SetClock
();
20
// UART1, baud 115200, baud source Timer2, 1T mode, no interrupt
21
UART1_Config8bitUart
(
UART1_BaudSource_Timer2
,
HAL_State_ON
, 115200);
22
while
(1)
23
{
24
UART1_TxChar
(
'T'
);
25
UART1_TxHex
(0x41);
26
UART1_TxString
(
"U"
);
27
UART1_TxString
(
" string\r\n"
);
28
SYS_Delay
(1000);
29
}
30
}
fw_hal.h
SYS_SetClock
void SYS_SetClock(void)
Definition:
fw_sys.c:40
SYS_Delay
void SYS_Delay(uint16_t t)
Definition:
fw_sys.c:65
HAL_State_ON
@ HAL_State_ON
Definition:
fw_types.h:71
UART1_TxChar
void UART1_TxChar(char dat)
Definition:
fw_uart.c:72
UART1_TxString
void UART1_TxString(uint8_t *str)
Definition:
fw_uart.c:85
UART1_BaudSource_Timer2
@ UART1_BaudSource_Timer2
Definition:
fw_uart.h:34
UART1_TxHex
void UART1_TxHex(uint8_t hex)
Definition:
fw_uart.c:79
UART1_Config8bitUart
void UART1_Config8bitUart(UART1_BaudSource_t baudSource, HAL_State_t _1TMode, uint32_t baudrate)
Definition:
fw_uart.c:56
main
void main(void)
Definition:
uart1_timer2_tx.c:17
ATY_LIB
FwLib_STC8
demo
uart
uart1_timer2_tx.c
Generated by
1.9.6