Azure Sphere MT3620 M4 API Reference Manual
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
os_hal_uart.h
1 /*
2  * (C) 2005-2020 MediaTek Inc. All rights reserved.
3  *
4  * Copyright Statement:
5  *
6  * This MT3620 driver software/firmware and related documentation
7  * ("MediaTek Software") are protected under relevant copyright laws.
8  * The information contained herein is confidential and proprietary to
9  * MediaTek Inc. ("MediaTek"). You may only use, reproduce, modify, or
10  * distribute (as applicable) MediaTek Software if you have agreed to and been
11  * bound by this Statement and the applicable license agreement with MediaTek
12  * ("License Agreement") and been granted explicit permission to do so within
13  * the License Agreement ("Permitted User"). If you are not a Permitted User,
14  * please cease any access or use of MediaTek Software immediately.
15  *
16  * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
17  * THAT MEDIATEK SOFTWARE RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE
18  * PROVIDED TO RECEIVER ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS
19  * ANY AND ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
20  * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
21  * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
22  * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
23  * INCORPORATED IN, OR SUPPLIED WITH MEDIATEK SOFTWARE, AND RECEIVER AGREES TO
24  * LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
25  * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
26  * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
27  * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
28  * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
29  * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
30  * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO MEDIATEK SOFTWARE RELEASED
31  * HEREUNDER WILL BE ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY
32  * RECEIVER TO MEDIATEK DURING THE PRECEDING TWELVE (12) MONTHS FOR SUCH
33  * MEDIATEK SOFTWARE AT ISSUE.
34  */
35 
36 #ifndef __OS_HAL_UART_H__
37 #define __OS_HAL_UART_H__
38 
39 #include "mhal_uart.h"
40 
148 typedef enum {
163 } UART_PORT;
164 
174 #ifdef __cplusplus
175 extern "C" {
176 #endif
177 
188 
199 
208 void mtk_os_hal_uart_dumpreg(UART_PORT port_num);
209 
220 void mtk_os_hal_uart_set_baudrate(UART_PORT port_num, u32 baudrate);
221 
234  mhal_uart_data_len data_bit,
235  mhal_uart_parity parity,
236  mhal_uart_stop_bit stop_bit);
246 
256 
265 void mtk_os_hal_uart_put_char(UART_PORT port_num, u8 data);
266 
277 void mtk_os_hal_uart_set_hw_fc(UART_PORT port_num, u8 hw_fc);
278 
288 
303  u8 xon1, u8 xoff1, u8 xon2, u8 xoff2, u8 escape_data);
304 
314 
325 void mtk_os_hal_uart_set_irq(UART_PORT port_num, u8 irq_flag);
326 
341  u8 *data, u32 len, bool vff_mode, u32 timeout);
342 
357  u8 *data, u32 len, bool vff_mode, u32 timeout);
358 
359 #ifdef __cplusplus
360 }
361 #endif
362 
372 #endif
mhal_uart_data_len
This enum defines UART data length.
Definition: mhal_uart.h:112
Use ISU3 as UART port.
Definition: os_hal_uart.h:158
void mtk_os_hal_uart_set_baudrate(UART_PORT port_num, u32 baudrate)
Set UART Baudrate.
void mtk_os_hal_uart_set_format(UART_PORT port_num, mhal_uart_data_len data_bit, mhal_uart_parity parity, mhal_uart_stop_bit stop_bit)
Set UART data format.
UART_PORT
The enum definition of UART PORT.
Definition: os_hal_uart.h:148
u8 mtk_os_hal_uart_get_char_nowait(UART_PORT port_num)
Get UART one byte of data directly in PIO mode.
int mtk_os_hal_uart_dma_send_data(UART_PORT port_num, u8 *data, u32 len, bool vff_mode, u32 timeout)
Send UART data in DMA mode.
Use ISU0 as UART port.
Definition: os_hal_uart.h:152
Use ISU1 as UART port.
Definition: os_hal_uart.h:154
Use ISU2 as UART port.
Definition: os_hal_uart.h:156
mhal_uart_parity
This enum defines UART parity parameter.
Definition: mhal_uart.h:125
void mtk_os_hal_uart_dumpreg(UART_PORT port_num)
Dump UART register.
void mtk_os_hal_uart_set_irq(UART_PORT port_num, u8 irq_flag)
Set UART IRQ.
void mtk_os_hal_uart_set_hw_fc(UART_PORT port_num, u8 hw_fc)
Set UART hardware flow control.
int mtk_os_hal_uart_ctlr_init(UART_PORT port_num)
Init UART controller.
int mtk_os_hal_uart_clear_irq_status(UART_PORT port_num)
Get and clear UART interrupt.
void mtk_os_hal_uart_set_sw_fc(UART_PORT port_num, u8 xon1, u8 xoff1, u8 xon2, u8 xoff2, u8 escape_data)
Set UART software flow control.
Use ISU4 as UART port.
Definition: os_hal_uart.h:160
void mtk_os_hal_uart_put_char(UART_PORT port_num, u8 data)
Send UART one byte of data in PIO mode.
The maximum ISU number (invalid)
Definition: os_hal_uart.h:162
int mtk_os_hal_uart_ctlr_deinit(UART_PORT port_num)
Deinit UART controller.
Use CM4-UART as UART port.
Definition: os_hal_uart.h:150
u8 mtk_os_hal_uart_get_char(UART_PORT port_num)
Get UART one byte of data in PIO mode.
mhal_uart_stop_bit
This enum defines stop bit length.
Definition: mhal_uart.h:140
void mtk_os_hal_uart_disable_sw_fc(UART_PORT port_num)
Disable UART software flow control.
int mtk_os_hal_uart_dma_get_data(UART_PORT port_num, u8 *data, u32 len, bool vff_mode, u32 timeout)
Get UART data in DMA mode.