ATY_LIB V2_102_230218
ATY_LIB for general devices or ALGO
 
Loading...
Searching...
No Matches
uart1_timer1_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
17extern __CODE uint16_t ticks_ms;
18extern __CODE uint8_t ticks_us;
19
20void main(void)
21{
23 // UART1, baud 115200, baud source Timer1, 1T mode, no interrupt
25 while(1)
26 {
27 UART1_TxString("ms ticks:0x");
29 UART1_TxHex(ticks_ms & 0xFF);
30 UART1_TxString(" us ticks:0x");
32 UART1_TxString(" clock div:0x");
34 UART1_TxString(" string\r\n");
35 SYS_Delay(1000);
36 }
37}
#define __CONF_CLKDIV
Definition: fw_conf.h:78
void SYS_SetClock(void)
Definition: fw_sys.c:40
void SYS_Delay(uint16_t t)
Definition: fw_sys.c:65
unsigned short uint16_t
Definition: fw_types.h:19
@ HAL_State_ON
Definition: fw_types.h:71
unsigned char uint8_t
Definition: fw_types.h:18
void UART1_TxString(uint8_t *str)
Definition: fw_uart.c:85
@ UART1_BaudSource_Timer1
Definition: fw_uart.h:33
void UART1_TxHex(uint8_t hex)
Definition: fw_uart.c:79
void UART1_Config8bitUart(UART1_BaudSource_t baudSource, HAL_State_t _1TMode, uint32_t baudrate)
Definition: fw_uart.c:56
__CODE uint8_t ticks_us
Definition: fw_sys.c:31
void main(void)
__CODE uint16_t ticks_ms
Definition: fw_sys.c:30