mirror of
https://github.com/xushoucai/RTL8710_SDK_GCC_VERSION.git
synced 2025-07-31 20:21:04 +00:00
GCC SDK RTL8710 basic version (including the window platform cygwin installation and Ubuntu platform Linux Installation routines),
including cross compilation of the installation, compile, link, run, debug, and so on. SDK implementation of the function: 1, WiFi connection settings (including AP mode and STA mode). 2, peripheral resource control (including GPIO, SPI, UART, IIC, etc.). 3, the user uses the sample method.
This commit is contained in:
parent
36b1b0dcd9
commit
1d3357d3b0
2094 changed files with 779991 additions and 0 deletions
50
component/common/utilities/uart_socket.h
Normal file
50
component/common/utilities/uart_socket.h
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
#ifndef __UART_SOCKET_H_
|
||||
#define __UART_SOCKET_H_
|
||||
|
||||
#include "osdep_api.h"
|
||||
#include "serial_api.h"
|
||||
#include "serial_ex_api.h"
|
||||
|
||||
#define UART_SEND_BUFFER_LEN 512
|
||||
#define UART_RECV_BUFFER_LEN 1024
|
||||
#define UART_MAX_DELAY_TIME 20
|
||||
|
||||
typedef struct _uart_set_str
|
||||
{
|
||||
char UartName[8]; // the name of uart
|
||||
int BaudRate; //The baud rate
|
||||
char number; //The number of data bits
|
||||
char parity; //The parity(default NONE)
|
||||
char StopBits; //The number of stop bits
|
||||
char FlowControl; //support flow control is 1
|
||||
}uart_set_str;
|
||||
|
||||
typedef struct _uart_socket_t
|
||||
{
|
||||
serial_t sobj;
|
||||
int fd;
|
||||
|
||||
/* Used for UART RX */
|
||||
u32 rx_start;
|
||||
//u32 rx_bytes;
|
||||
u32 prxread;
|
||||
u32 prxwrite;
|
||||
u32 rxoverlap;
|
||||
u32 last_update; //tick count when rx byte
|
||||
u8 recv_buf[UART_RECV_BUFFER_LEN];
|
||||
|
||||
u32 tx_start;
|
||||
u32 tx_bytes;
|
||||
u8 send_buf[UART_SEND_BUFFER_LEN];
|
||||
_Sema tx_sema;
|
||||
_Sema dma_tx_sema;
|
||||
|
||||
_Sema action_sema;
|
||||
}uart_socket_t;
|
||||
|
||||
uart_socket_t* uart_open(uart_set_str *puartpara);
|
||||
int uart_close(uart_socket_t *u);
|
||||
int uart_read(uart_socket_t *u, void *read_buf, size_t size);
|
||||
int uart_write(uart_socket_t *u, void *pbuf, size_t size);
|
||||
|
||||
#endif //__UART_SOCKET_H_
|
||||
Loading…
Add table
Add a link
Reference in a new issue