mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-15 17:02:53 +08:00
95 lines
2.9 KiB
C
95 lines
2.9 KiB
C
/*********************************************************************************************************************
|
||
* COPYRIGHT NOTICE
|
||
* Copyright (c) 2020,<2C><><EFBFBD>ɿƼ<C9BF>
|
||
* All rights reserved.
|
||
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>QQȺ<51><C8BA><EFBFBD><EFBFBD>Ⱥ<EFBFBD><C8BA>824575535
|
||
*
|
||
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݰ<EFBFBD>Ȩ<EFBFBD><C8A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɿƼ<C9BF><C6BC><EFBFBD><EFBFBD>У<EFBFBD>δ<EFBFBD><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5>;<EFBFBD><CDBE>
|
||
* <20><>ӭ<EFBFBD><D3AD>λʹ<CEBB>ò<EFBFBD><C3B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><DEB8><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>뱣<EFBFBD><EBB1A3><EFBFBD><EFBFBD><EFBFBD>ɿƼ<C9BF><C6BC>İ<EFBFBD>Ȩ<EFBFBD><C8A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||
*
|
||
* @file uart
|
||
* @company <09>ɶ<EFBFBD><C9B6><EFBFBD><EFBFBD>ɿƼ<C9BF><C6BC><EFBFBD><EFBFBD><EFBFBD>˾
|
||
* @author <09><><EFBFBD>ɿƼ<C9BF>(QQ3184284598)
|
||
* @version <09>鿴doc<6F><63>version<6F>ļ<EFBFBD> <20>汾˵<E6B1BE><CBB5>
|
||
* @Software ADS v1.2.2
|
||
* @Target core TC264D
|
||
* @Taobao https://seekfree.taobao.com/
|
||
* @date 2020-3-23
|
||
********************************************************************************************************************/
|
||
|
||
#ifndef _zf_uart_h
|
||
#define _zf_uart_h
|
||
|
||
|
||
#include "common.h"
|
||
#include "ifxAsclin_Asc.h"
|
||
|
||
|
||
|
||
#define UART0_TX_BUFFER_SIZE 16 //<2F><><EFBFBD>崮<EFBFBD><E5B4AE>0<EFBFBD><30><EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С
|
||
#define UART0_RX_BUFFER_SIZE 16 //<2F><><EFBFBD>崮<EFBFBD><E5B4AE>0<EFBFBD><30><EFBFBD>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С
|
||
|
||
#define UART1_TX_BUFFER_SIZE 16
|
||
#define UART1_RX_BUFFER_SIZE 16
|
||
|
||
#define UART2_TX_BUFFER_SIZE 16
|
||
#define UART2_RX_BUFFER_SIZE 16
|
||
|
||
#define UART3_TX_BUFFER_SIZE 16
|
||
#define UART3_RX_BUFFER_SIZE 16
|
||
|
||
|
||
|
||
//<2F><>ö<EFBFBD>ٶ<EFBFBD><D9B6>岻<EFBFBD><E5B2BB><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><C3BB><EFBFBD>
|
||
typedef enum //ö<>ٴ<EFBFBD><D9B4>ں<EFBFBD>
|
||
{
|
||
UART_0,
|
||
UART_1,
|
||
UART_2,
|
||
UART_3,
|
||
}UARTN_enum;
|
||
|
||
|
||
//<2F><>ö<EFBFBD>ٶ<EFBFBD><D9B6>岻<EFBFBD><E5B2BB><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><C3BB><EFBFBD>
|
||
typedef enum //ö<>ٴ<EFBFBD><D9B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||
{
|
||
//<2F><><EFBFBD><EFBFBD>0 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ſ<EFBFBD>ѡ<EFBFBD><D1A1>Χ
|
||
UART0_TX_P14_0, UART0_TX_P14_1, UART0_TX_P15_2, UART0_TX_P15_3,
|
||
//<2F><><EFBFBD><EFBFBD>0 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ſ<EFBFBD>ѡ<EFBFBD><D1A1>Χ
|
||
UART0_RX_P14_1, UART0_RX_P15_3,
|
||
|
||
//<2F><>LQFP144<34><34>װ<EFBFBD><D7B0>û<EFBFBD><C3BB>P14_10<31><30>P14_8
|
||
//<2F><><EFBFBD><EFBFBD>1 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ſ<EFBFBD>ѡ<EFBFBD><D1A1>Χ
|
||
UART1_TX_P02_2, UART1_TX_P11_12, UART1_TX_P14_10, UART1_TX_P15_0, UART1_TX_P15_1, UART1_TX_P15_4, UART1_TX_P15_5, UART1_TX_P20_10, UART1_TX_P33_12, UART1_TX_P33_13,
|
||
//<2F><><EFBFBD><EFBFBD>1 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ſ<EFBFBD>ѡ<EFBFBD><D1A1>Χ
|
||
UART1_RX_P02_3, UART1_RX_P11_10, UART1_RX_P14_8, UART1_RX_P15_1, UART1_RX_P15_5, UART1_RX_P20_9, UART1_RX_P33_13,
|
||
|
||
//<2F><><EFBFBD><EFBFBD>2 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ſ<EFBFBD>ѡ<EFBFBD><D1A1>Χ
|
||
UART2_TX_P02_0, UART2_TX_P10_5, UART2_TX_P14_2, UART2_TX_P14_3, UART2_TX_P33_8, UART2_TX_P33_9,
|
||
//<2F><><EFBFBD><EFBFBD>2 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ſ<EFBFBD>ѡ<EFBFBD><D1A1>Χ
|
||
UART2_RX_P02_0, UART2_RX_P02_1, UART2_RX_P10_6, UART2_RX_P14_3, UART2_RX_P33_8,
|
||
|
||
//<2F><>LQFP144<34><34>װ<EFBFBD><D7B0>û<EFBFBD><C3BB>P32_2<5F><32>P32_3
|
||
//<2F><><EFBFBD><EFBFBD>3 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ſ<EFBFBD>ѡ<EFBFBD><D1A1>Χ
|
||
UART3_TX_P00_0, UART3_TX_P00_1, UART3_TX_P15_6, UART3_TX_P15_7, UART3_TX_P20_0, UART3_TX_P20_3, UART3_TX_P21_7, UART3_TX_P32_2, UART3_TX_P32_3,
|
||
//<2F><><EFBFBD><EFBFBD>3 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ſ<EFBFBD>ѡ<EFBFBD><D1A1>Χ
|
||
UART3_RX_P00_1, UART3_RX_P15_7, UART3_RX_P20_3, UART3_RX_P21_6, UART3_RX_P32_2,
|
||
}UART_PIN_enum;
|
||
|
||
|
||
|
||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>handle<6C><65><EFBFBD><EFBFBD>
|
||
extern IfxAsclin_Asc uart0_handle;
|
||
extern IfxAsclin_Asc uart1_handle;
|
||
extern IfxAsclin_Asc uart2_handle;
|
||
extern IfxAsclin_Asc uart3_handle;
|
||
|
||
void uart_init(UARTN_enum uartn, uint32 baud, UART_PIN_enum tx_pin, UART_PIN_enum rx_pin);
|
||
void uart_putchar(UARTN_enum uartn, uint8 dat);
|
||
void uart_putbuff(UARTN_enum uartn, uint8 *buff, uint32 len);
|
||
void uart_putstr(UARTN_enum uartn, const int8 *str);
|
||
void uart_getchar(UARTN_enum uartn, uint8 *dat);
|
||
uint8 uart_query(UARTN_enum uartn, uint8 *dat);
|
||
|
||
#endif
|