-
大小: 0.11M文件類型: .rar金幣: 1下載: 0 次發(fā)布日期: 2021-02-22
- 標(biāo)簽: 藍(lán)牙??控制??MSP430G2553??
資源簡(jiǎn)介
硬件平臺(tái)基于TI公司的MSP430G2553和低功耗藍(lán)牙模塊 利用單片機(jī)上面的串口收發(fā)數(shù)據(jù)控制藍(lán)牙模塊
代碼片段和文件信息
#include?
#include?“BT05.h“
/***********************************************
函數(shù)名稱:Init_BLE
功????能:對(duì)BLE進(jìn)行初始化設(shè)置波特率及收發(fā)串口,使能接收中斷
參????數(shù):無
返回值??:無
***********************************************/
void?Init_BLE()
{
??? P1SEL?=?BIT1+BIT2;????//P1.1為RXDP1.2為TXD
P1SEL2?=?BIT1+BIT2;??//P1.1為RXDP1.2為TXD
UCA0CTL1?|=?UCSSEL_2;?//選擇時(shí)鐘BRCLK
UCA0BR0?=?106;???//1Mhz?9600
UCA0BR1?=?0;?????//1Mhz?9600
UCA0MCTL?=?UCBRS2?+?UCBRS0;??//波特率=BRCLK/(UBR+(M7+...0)/8)
UCA0CTL1?&=~?UCSWRST;???//初始化順序:SWRST=1設(shè)置串口?然后設(shè)置SWRST=0?最后設(shè)置相應(yīng)中斷
IE2?|=?UCA0RXIE;????//使能接收中斷
}
/***********************************************
函數(shù)名稱:UartPutchar
功????能:將一個(gè)字符寫入串口發(fā)送緩沖區(qū)
參????數(shù):等待串口發(fā)送的數(shù)據(jù)
返回值??:無
***********************************************/
void?UartPutchar(unsigned?char?c)
{
while(!(IFG2&UCA0TXIFG));?//(待發(fā)送為空)
UCA0TXBUF?=?c;
IFG2?&=?~UCA0TXIFG;
}
/***********************************************
函數(shù)名稱:UartPutNum
功????能:通過串口發(fā)送一個(gè)數(shù)字
參????數(shù):等待串口發(fā)送的數(shù)字
返回值??:無
*************
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件????????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個(gè)文件信息
評(píng)論
共有 條評(píng)論