• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /******************************************************************************
2  * Copyright (c) 2023 Telink Semiconductor (Shanghai) Co., Ltd. ("TELINK")
3  * All rights reserved.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *     http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *****************************************************************************/
18 
19 #ifndef UART_TLSR9518_H
20 #define UART_TLSR9518_H
21 
22 
23 #include <B91/uart.h>
24 #include "uart_if.h"
25 
26 
27 struct _uart_port;
28 typedef struct _uart_driver_data {
29     uint32_t baudrate;
30     struct UartAttribute uattr;
31     uart_tx_pin_e tx;
32     uart_rx_pin_e rx;
33     struct _uart_port *port;
34 } uart_driver_data_t;
35 
36 
37 typedef struct _uart_port {
38     uint32_t num;
39     uint32_t enable;
40     uint32_t interrupt;
41     uint32_t addr;
42     uart_driver_data_t *driver_data;
43 } uart_port_t;
44 
45 
46 uart_parity_e parity_from_uattr(struct UartAttribute uattr);
47 uart_stop_bit_e stopbit_from_uattr(struct UartAttribute uattr);
48 void uart_dma_init(uart_driver_data_t *driver_data);
49 
50 
51 #endif // UART_TLSR9518_H
52