ble学习笔记十二---------------协议栈之UART实验
2014-10-30 20:47
501 查看
协议栈UART实验
打开串口功能
HAL_UART=TRUE
HAL_UART_USB=FALSE
串口操作定义在hal_uart.h 头文件中
/*
* Initialize UART at the startup
* 初始化UART
*/
extern void HalUARTInit ( void );
/*
* Open a port based on the configuration
* 打开串口
*/
extern uint8 HalUARTOpen ( uint8 port, halUARTCfg_t *config );
/*
* Close a port
* 关闭串口
*/
extern void HalUARTClose ( uint8 port );
/*
* Read a buffer from the UART
* 从串口读取数据
*/
extern uint16 HalUARTRead ( uint8 port, uint8 *pBuffer, uint16 length );
/*
* Write a buff to the uart
* 向串口写入数据
*/
extern uint16 HalUARTWrite ( uint8 port, uint8 *pBuffer, uint16 length );
/*
* Write a buffer to the UART
*/
extern uint8 HalUARTIoctl ( uint8 port, uint8 cmd, halUARTIoctl_t *pIoctl );
/*
* This to support polling
*/
extern void HalUARTPoll( void );
/*
* Return the number of bytes in the Rx buffer
*/
extern uint16 Hal_UART_RxBufLen ( uint8 port );
/*
* Return the number of bytes in the Tx buffer
*/
extern uint16 Hal_UART_TxBufLen ( uint8 port );
/*
* This enable/disable flow control
*/
extern void Hal_UART_FlowControlSet ( uint8 port, bool status );
/*
* Initialize hardware for UART
*/
extern uint8 HalUART_HW_Init(uint8 port);
/*
* Abort UART when entering sleep mode
*/
extern void HalUARTSuspend(void);
/*
* Resume UART after wakeup from sleep
* 从睡眠状态恢复uart
*/
extern void HalUARTResume(void);
打开串口功能
HAL_UART=TRUE
HAL_UART_USB=FALSE
串口操作定义在hal_uart.h 头文件中
/*
* Initialize UART at the startup
* 初始化UART
*/
extern void HalUARTInit ( void );
/*
* Open a port based on the configuration
* 打开串口
*/
extern uint8 HalUARTOpen ( uint8 port, halUARTCfg_t *config );
/*
* Close a port
* 关闭串口
*/
extern void HalUARTClose ( uint8 port );
/*
* Read a buffer from the UART
* 从串口读取数据
*/
extern uint16 HalUARTRead ( uint8 port, uint8 *pBuffer, uint16 length );
/*
* Write a buff to the uart
* 向串口写入数据
*/
extern uint16 HalUARTWrite ( uint8 port, uint8 *pBuffer, uint16 length );
/*
* Write a buffer to the UART
*/
extern uint8 HalUARTIoctl ( uint8 port, uint8 cmd, halUARTIoctl_t *pIoctl );
/*
* This to support polling
*/
extern void HalUARTPoll( void );
/*
* Return the number of bytes in the Rx buffer
*/
extern uint16 Hal_UART_RxBufLen ( uint8 port );
/*
* Return the number of bytes in the Tx buffer
*/
extern uint16 Hal_UART_TxBufLen ( uint8 port );
/*
* This enable/disable flow control
*/
extern void Hal_UART_FlowControlSet ( uint8 port, bool status );
/*
* Initialize hardware for UART
*/
extern uint8 HalUART_HW_Init(uint8 port);
/*
* Abort UART when entering sleep mode
*/
extern void HalUARTSuspend(void);
/*
* Resume UART after wakeup from sleep
* 从睡眠状态恢复uart
*/
extern void HalUARTResume(void);
相关文章推荐
- ble学习笔记十二---------------协议栈之UART实验
- 低功耗蓝牙cc2541学习笔记之UART-4-协议栈uart接受数据实验
- 低功耗蓝牙cc2541学习笔记之UART-3-协议栈uart发送 实验
- 低功耗蓝牙cc2541学习笔记之UART-1-协议栈函数功能说明
- ble学习笔记十三-------------ble协议栈之串口收发实验
- ble学习笔记十三-------------ble协议栈之串口收发实验
- ZigBee组网学习笔记(四)--协议栈按键实验
- Asp.net控件开发学习笔记(十二)----数据绑定
- 《嵌入式linux应用程序开发完全手册》通用异步收发器UART学习笔记
- MySQL学习笔记(十二)―― MySQL的命令集(2)
- GTK+图形化应用程序开发学习笔记(十二)—对话框构件、标尺构件(2)
- WPF and Silverlight 学习笔记(十二):WPF Panel内容模型、Decorator内容模型及其他
- CCNP学习笔记之实验练习
- QT学习笔记之十二 ListViewer
- [转]Oracle DataGuard学习、实验笔记
- 设计模式学习笔记(十二)——Flyweight享元模式
- GTK+图形化应用程序开发学习笔记(十二)—对话框构件、标尺构件(1)
- 设计模式学习笔记十二——Proxy模式
- 设计模式学习笔记十二:桥接模式(Bridge Pattern)
- 学习《Oracle 9i10g编程艺术》的笔记 (十二) redo 和undo 如何协作