WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
uart_porting.c 文件参考
#include "uart_porting.h"
#include "hal_uart_v151.h"
#include "uart.h"
#include "platform_core.h"
#include "securec.h"
#include "osal_interrupt.h"
#include "soc_osal.h"
#include "dma_porting.h"
#include "log_oam_msg.h"
#include "cmsis_os.h"
#include "at_config.h"
#include "at_product.h"
#include "log_memory_region.h"
#include "log_common.h"
#include "log_uart.h"
#include "log_oam_logger.h"
#include "log_oml_exception.h"
#include "debug_print.h"
uart_porting.c 的引用(Include)关系图:

结构体

struct  uart_interrupt
 

宏定义

#define UART_BUS_0_BASE_ADDR   (UART0_BASE - 4)
 
#define UART_BUS_1_BASE_ADDR   (UART1_BASE - 4)
 
#define UART_BUS_2_BASE_ADDR   (UART2_BASE - 4)
 
#define GPIO12_PAD_CTRL_GROUP_ADDR   0x4400D030
 
#define GPIO13_PAD_CTRL_GROUP_ADDR   0x4400D034
 
#define UART_TRANS_LEN_MAX   128
 
#define GPIO_05_SEL   0x4400d014
 
#define GPIO_06_SEL   0x4400d018
 
#define GPIO_07_SEL   0x4400d01c
 
#define GPIO_08_SEL   0x4400d020
 
#define UART_2_MODE   2
 
#define GPIO_13_SEL   0x4400d034
 
#define GPIO_14_SEL   0x4400d038
 
#define UART1_TXD_SEL   0x4400d03c
 
#define UART1_RXD_SEL   0x4400d040
 
#define UART_1_MODE   1
 
#define UART0_TXD_SEL   0x4400d044
 
#define UART0_RXD_SEL   0x4400d048
 
#define UART_0_MODE   1
 
#define CRLF_STR   "\r\n"
 
#define CR_ASIC_II   0xD
 
#define AT_RX_BUFFER_SIZE   16
 
#define DEBUG_UART_RX_BUFFER_SIZE   1
 
#define LOG_UART_RX_MAX_BUFFER_SIZE   16
 
#define UART_PORT_BUS_NUM   3
 

类型定义

typedef struct uart_interrupt hal_uart_interrupt_t
 

函数

uintptr_t uart_porting_base_addr_get (uart_bus_t bus)
 
void uart_port_register_hal_funcs (uart_bus_t bus)
 Register hal funcs objects into hal_uart module.
 
void uart_port_set_clock_value (uart_bus_t bus, uint32_t clock)
 set the bus clock of specified uart.
 
uint32_t uart_port_get_clock_value (uart_bus_t bus)
 Get the bus clock of specified uart.
 
void uart_port_config_pinmux (uart_bus_t bus)
 Config the pinmux of the uarts above.
 
void uart_port_register_irq (uart_bus_t bus)
 Register the interrupt of uarts.
 
void uart_port_unregister_irq (uart_bus_t bus)
 unRegister the interrupt of uarts.
 
void at_uart_init (void)
 
uint32_t at_uart_get_rcv_cnt (void)
 
void sw_debug_uart_init (uint32_t baud_rate)
 
void sw_debug_uart_reinit (uint32_t baud_rate)
 
void UartPuts (const char *s, uint32_t len, bool is_lock)
 
void print_str (const char *str,...)
 
void log_uart_port_init (void)
 hso uart init
 
void log_uart_port_write (const uint8_t *buffer, uint32_t length)
 
errcode_t uart_port_save_bus_id (int32_t dbg_uart_bus, int32_t at_uart_bus, int32_t hso_uart_bus)
 
uint8_t uart_port_get_dma_trans_dest_handshaking (uart_bus_t bus)
 Get the DMA destination handshaking select of uart transfer.
 
uint8_t uart_port_get_dma_trans_src_handshaking (uart_bus_t bus)
 Get the DMA source handshaking select of uart transfer.
 
uint32_t uart_porting_lock (uart_bus_t bus)
 uart lock.
 
void uart_porting_unlock (uart_bus_t bus, uint32_t irq_sts)
 uart unlock.
 

变量

const uintptr_t g_uart_base_addrs [UART_BUS_MAX_NUMBER]
 Base address list for all of the IPs.
 
const bool g_uart_support_mutex [UART_BUS_MAX_NUMBER]
 
STATIC uint8_t g_uart_rx_buffer [1]
 

宏定义说明

◆ AT_RX_BUFFER_SIZE

#define AT_RX_BUFFER_SIZE   16

◆ CR_ASIC_II

#define CR_ASIC_II   0xD

◆ CRLF_STR

#define CRLF_STR   "\r\n"

◆ DEBUG_UART_RX_BUFFER_SIZE

#define DEBUG_UART_RX_BUFFER_SIZE   1

◆ GPIO12_PAD_CTRL_GROUP_ADDR

#define GPIO12_PAD_CTRL_GROUP_ADDR   0x4400D030

◆ GPIO13_PAD_CTRL_GROUP_ADDR

#define GPIO13_PAD_CTRL_GROUP_ADDR   0x4400D034

◆ GPIO_05_SEL

#define GPIO_05_SEL   0x4400d014

◆ GPIO_06_SEL

#define GPIO_06_SEL   0x4400d018

◆ GPIO_07_SEL

#define GPIO_07_SEL   0x4400d01c

◆ GPIO_08_SEL

#define GPIO_08_SEL   0x4400d020

◆ GPIO_13_SEL

#define GPIO_13_SEL   0x4400d034

◆ GPIO_14_SEL

#define GPIO_14_SEL   0x4400d038

◆ LOG_UART_RX_MAX_BUFFER_SIZE

#define LOG_UART_RX_MAX_BUFFER_SIZE   16

UART Settings. Define these in the C file to avoid pulling in the UART header in the header file.

◆ UART0_RXD_SEL

#define UART0_RXD_SEL   0x4400d048

◆ UART0_TXD_SEL

#define UART0_TXD_SEL   0x4400d044

◆ UART1_RXD_SEL

#define UART1_RXD_SEL   0x4400d040

◆ UART1_TXD_SEL

#define UART1_TXD_SEL   0x4400d03c

◆ UART_0_MODE

#define UART_0_MODE   1

◆ UART_1_MODE

#define UART_1_MODE   1

◆ UART_2_MODE

#define UART_2_MODE   2

◆ UART_BUS_0_BASE_ADDR

#define UART_BUS_0_BASE_ADDR   (UART0_BASE - 4)

Copyright (c) HiSilicon (Shanghai) Technologies Co., Ltd. 2022-2022. All rights reserved.

Description: Provides uart port template
History:
2022-06-06, Create file.

◆ UART_BUS_1_BASE_ADDR

#define UART_BUS_1_BASE_ADDR   (UART1_BASE - 4)

◆ UART_BUS_2_BASE_ADDR

#define UART_BUS_2_BASE_ADDR   (UART2_BASE - 4)

◆ UART_PORT_BUS_NUM

#define UART_PORT_BUS_NUM   3

◆ UART_TRANS_LEN_MAX

#define UART_TRANS_LEN_MAX   128

类型定义说明

◆ hal_uart_interrupt_t

函数说明

◆ print_str()

void print_str ( const char *  str,
  ... 
)

◆ sw_debug_uart_init()

void sw_debug_uart_init ( uint32_t  baud_rate)

◆ UartPuts()

void UartPuts ( const char *  s,
uint32_t  len,
bool  is_lock 
)

变量说明

◆ g_uart_rx_buffer

STATIC uint8_t g_uart_rx_buffer[1]

◆ g_uart_support_mutex

const bool g_uart_support_mutex[UART_BUS_MAX_NUMBER]
初始值:
= {
CONFIG_UART0_SUPPORT_WRITE_MUTEX,
CONFIG_UART1_SUPPORT_WRITE_MUTEX,
CONFIG_UART2_SUPPORT_WRITE_MUTEX,
}