Initial commit: TXW82x FPV v2.7.0.7-42229 SDK + project sources
This commit is contained in:
45
sdk/include/dev/uart/hguart_v2.h
Normal file
45
sdk/include/dev/uart/hguart_v2.h
Normal file
@@ -0,0 +1,45 @@
|
||||
#ifndef _HGUART_V2_H
|
||||
#define _HGUART_V2_H
|
||||
#include "hal/uart.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#define __PSRAM_ADDR_START (0x28000000)
|
||||
#define __PSRAM_ADDR_END (0x28800000 + (0x1800000))
|
||||
|
||||
struct hguart_v2 {
|
||||
struct uart_device dev;
|
||||
uint32 hw;
|
||||
uart_irq_hdl irq_hdl;
|
||||
uint32 irq_data;
|
||||
uint16 irq_num;
|
||||
uint16 opened:1, dsleep:1, use_dma:1;
|
||||
uint32 flag;
|
||||
#ifdef CONFIG_SLEEP
|
||||
struct {
|
||||
uint32 con;
|
||||
uint32 baud;
|
||||
uint32 tstadr;
|
||||
uint32 rstadr;
|
||||
uint32 tdmalen;
|
||||
uint32 rdmalen;
|
||||
uint32 dmacon;
|
||||
uint32 rs485_con;
|
||||
uint32 rs485_det;
|
||||
uint32 rs485_tat;
|
||||
uint32 tocon;
|
||||
}bp_regs;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
int32 hguart_v2_attach(uint32 dev_id, struct hguart_v2 *uart);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
29
sdk/include/dev/uart/hguart_v3.h
Normal file
29
sdk/include/dev/uart/hguart_v3.h
Normal file
@@ -0,0 +1,29 @@
|
||||
#ifndef _HGUART_V3_H
|
||||
#define _HGUART_V3_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/** @brief Simple uart operating handle structure
|
||||
* @{
|
||||
*/
|
||||
struct hguart_v3 {
|
||||
struct uart_device dev ;
|
||||
uint32 hw ;
|
||||
uart_irq_hdl irq_hdl ;
|
||||
uint32 irq_data;
|
||||
uint16 irq_num ;
|
||||
uint16 opened ;
|
||||
};
|
||||
|
||||
|
||||
int32 hguart_v3_attach(uint32 dev_id, struct hguart_v3 *uart);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
57
sdk/include/dev/uart/hguart_v4.h
Normal file
57
sdk/include/dev/uart/hguart_v4.h
Normal file
@@ -0,0 +1,57 @@
|
||||
#ifndef _HGUART_V4_H
|
||||
#define _HGUART_V4_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/** @brief Simple uart operating handle structure
|
||||
* @{
|
||||
*/
|
||||
struct hguart_v4 {
|
||||
struct uart_device dev;
|
||||
uint32 hw;
|
||||
uart_irq_hdl irq_hdl;
|
||||
uint32 irq_data;
|
||||
uint32 tx_total_byte;
|
||||
uint32 tx_cur_byte;
|
||||
uint8 *p_tx_buf;
|
||||
struct os_semaphore sema_tx;
|
||||
struct os_mutex mutex_tx;
|
||||
struct os_mutex mutex_rx;
|
||||
uint16 irq_num;
|
||||
uint16 comm_irq_num;
|
||||
uint16 opened :1,
|
||||
use_dma :1,
|
||||
irq_dma_tx:1,
|
||||
irq_dma_rx:1,
|
||||
debug_uart:1,
|
||||
rs485_set :1,
|
||||
dsleep :1;
|
||||
#ifdef CONFIG_SLEEP
|
||||
struct {
|
||||
uint32_t con;
|
||||
uint32_t baud;
|
||||
uint32_t tocon;
|
||||
uint32_t dmaadr;
|
||||
uint32_t dmalen;
|
||||
uint32_t dmacon;
|
||||
}bp_regs;
|
||||
uint32 bp_irq_flags;
|
||||
uart_irq_hdl bp_irq_hdl;
|
||||
uint32 bp_irq_data;
|
||||
struct os_mutex bp_suspend_lock;
|
||||
struct os_mutex bp_resume_lock;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
int32 hguart_v4_attach(uint32 dev_id, struct hguart_v4 *uart);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user