-
大小: 0.11M文件類型: .rar金幣: 1下載: 0 次發布日期: 2021-02-22
- 標簽: 藍牙??控制??MSP430G2553??
資源簡介
硬件平臺基于TI公司的MSP430G2553和低功耗藍牙模塊 利用單片機上面的串口收發數據控制藍牙模塊
代碼片段和文件信息
#include?
#include?“BT05.h“
/***********************************************
函數名稱:Init_BLE
功????能:對BLE進行初始化設置波特率及收發串口,使能接收中斷
參????數:無
返回值??:無
***********************************************/
void?Init_BLE()
{
??? P1SEL?=?BIT1+BIT2;????//P1.1為RXDP1.2為TXD
P1SEL2?=?BIT1+BIT2;??//P1.1為RXDP1.2為TXD
UCA0CTL1?|=?UCSSEL_2;?//選擇時鐘BRCLK
UCA0BR0?=?106;???//1Mhz?9600
UCA0BR1?=?0;?????//1Mhz?9600
UCA0MCTL?=?UCBRS2?+?UCBRS0;??//波特率=BRCLK/(UBR+(M7+...0)/8)
UCA0CTL1?&=~?UCSWRST;???//初始化順序:SWRST=1設置串口?然后設置SWRST=0?最后設置相應中斷
IE2?|=?UCA0RXIE;????//使能接收中斷
}
/***********************************************
函數名稱:UartPutchar
功????能:將一個字符寫入串口發送緩沖區
參????數:等待串口發送的數據
返回值??:無
***********************************************/
void?UartPutchar(unsigned?char?c)
{
while(!(IFG2&UCA0TXIFG));?//(待發送為空)
UCA0TXBUF?=?c;
IFG2?&=?~UCA0TXIFG;
}
/***********************************************
函數名稱:UartPutNum
功????能:通過串口發送一個數字
參????數:等待串口發送的數字
返回值??:無
*************
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????512??2017-12-12?12:19??BLE_430\.ccsproject
?????文件??????23976??2017-12-12?12:19??BLE_430\.cproject
?????文件????????283??2017-12-12?12:21??BLE_430\.git\COMMIT_EDITMSG
?????文件????????300??2017-12-12?11:25??BLE_430\.git\config
?????文件?????????73??2017-12-12?11:25??BLE_430\.git\desc
?????文件?????????23??2017-12-12?11:25??BLE_430\.git\HEAD
?????文件????????478??2017-12-12?11:25??BLE_430\.git\hooks\applypatch-msg.sample
?????文件????????896??2017-12-12?11:25??BLE_430\.git\hooks\commit-msg.sample
?????文件????????189??2017-12-12?11:25??BLE_430\.git\hooks\post-update.sample
?????文件????????424??2017-12-12?11:25??BLE_430\.git\hooks\pre-applypatch.sample
?????文件???????1642??2017-12-12?11:25??BLE_430\.git\hooks\pre-commit.sample
?????文件???????1348??2017-12-12?11:25??BLE_430\.git\hooks\pre-push.sample
?????文件???????4898??2017-12-12?11:25??BLE_430\.git\hooks\pre-reba
?????文件????????544??2017-12-12?11:25??BLE_430\.git\hooks\pre-receive.sample
?????文件???????1492??2017-12-12?11:25??BLE_430\.git\hooks\prepare-commit-msg.sample
?????文件???????3610??2017-12-12?11:25??BLE_430\.git\hooks\update.sample
?????文件???????1146??2017-12-12?12:21??BLE_430\.git\index
?????文件????????240??2017-12-12?11:25??BLE_430\.git\info\exclude
?????文件????????499??2017-12-12?12:21??BLE_430\.git\logs\HEAD
?????文件????????499??2017-12-12?12:21??BLE_430\.git\logs\refs\heads\master
?????文件????????172??2017-12-12?11:25??BLE_430\.git\logs\refs\remotes\origin\HEAD
?????文件????????274??2017-12-12?12:21??BLE_430\.git\logs\refs\remotes\origin\master
?????文件????????226??2017-12-12?11:27??BLE_430\.git\ob
?????文件?????????53??2017-12-12?11:25??BLE_430\.git\ob
?????文件????????115??2017-12-12?11:27??BLE_430\.git\ob
?????文件????????312??2017-12-12?11:27??BLE_430\.git\ob
?????文件???????3425??2017-12-12?12:21??BLE_430\.git\ob
?????文件????????196??2017-12-12?11:27??BLE_430\.git\ob
?????文件??????11514??2017-12-12?11:27??BLE_430\.git\ob
?????文件????????106??2017-12-12?11:27??BLE_430\.git\ob
............此處省略125個文件信息
評論
共有 條評論