91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 278KB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發(fā)布日期: 2021-06-12
  • 語言: 其他
  • 標簽: 串口透傳??

資源簡介

串口將收到的數(shù)據(jù)通過無線發(fā)送出去,將收到的無線數(shù)據(jù)通過串口發(fā)送出去.

資源截圖

代碼片段和文件信息

#include?“my_uart.h“


extern?uint8??uartIsReceiving;

/*************************************************************************************************************
?*?文件名: uart.c
?*?功能: CC2530?串口相關函數(shù)
*?創(chuàng)建時間: 2013-06-07?21:33
?*?最后修改時間:2013-06-07
?*?詳細: 串口相關函數(shù)串口最大時鐘為系統(tǒng)時鐘的1/16
*************************************************************************************************************/
#include?“my_uart.h“


#define?BIT0??0X01
#define?BIT1??0X02
#define?BIT2??0X04
#define?BIT3??0X08
#define?BIT4??0X10
#define?BIT5??0X20
#define?BIT6??0X40
#define?BIT7??0X80

typedef?struct
{
??//?The?head?or?tail?is?updated?by?the?Tx?or?Rx?ISR?respectively?when?not?polled.
??uint16?bufferHead;
??uint16?bufferTail;
??uint8?rxBufIsFull;
??uint16?maxBufSize;
??uint8?*pRxBuffer;
}?halUARTBufControl_t;

halUARTBufControl_t?halUARTRxControl[2];

//static?UartRx_TypeDef UART_RX[2];
uint8??CommRxBuff0[128];
uint8??CommRxBuff1[128];

static?const?uint8?BAUD_M[11]?=?{59?59?59?216?59?216?59?216?59?216?216};?????//32MHZ系統(tǒng)時鐘對應的分頻器小數(shù)部分
static?const?uint8?BAUD_E[11]?=?{6?7?8?8?9?9?10?10?11?11?12};????????????????//32MHZ系統(tǒng)時鐘對應的分頻器指數(shù)部分

/***********************************************************************************
*?@函數(shù)名??HalUARTInit(HAL_UART_PORT?port?USART_BAUD?Baud?FunctionalState?RxIntEn)
*
*?@描述????串口初始化
*
*?@參數(shù)????port:通道選擇HAL_UART_PORT_0HAL_UART_PORT_1
*??????????Baud:波特率控制見USART_BAUD
*??????????RxIntEn:ENABLE:使能串口接收中斷
*
*?@返回值??無
************************************************************************************/
void?HalUARTInit(HAL_UART_PORT?port?USART_BAUD?Baud?FunctionalState?RxIntEn)
{
??switch(port)
??{
????case?HAL_UART_PORT_0:
????{
??????U0CSR??=?BIT7?+?BIT6; //UART模式使能接收
??????U0UCR??=?BIT1; //無流控無奇偶校驗8bit1個停止位停止位高電平起始低電平
??????U0GCR??=?BAUD_E[Baud]; //波特率分頻器指數(shù)部分
??????U0BAUD?=?BAUD_M[Baud]; //波特率分頻器小數(shù)部分
??????P0SEL?|=?BIT2?+?BIT3;? //P0.3?TXDP0.2?RXD
??????IEN2?&=?~(1?<??????URX0IF?=?0; //清除串口接收中斷標志
??????UTX0IF?=?0; //清除串口發(fā)送中斷標志
??????URX0IE?=?(RxIntEn?==?ENABLE)???1?:?0;?? //使能串口接收中斷
??????UART_SetRxBuff(port?CommRxBuff0?128); //初始化串口緩沖區(qū)
????}break;
????case?HAL_UART_PORT_1:
????{
??????PERCFG?|=?0X01;
??????U1CSR?=?BIT7?+?BIT6; //UART模式使能接收
??????U1UCR?=?BIT1; ????????//無流控無奇偶校驗8bit1個停止位停止位高電平起始低電平
??????U1GCR?=?BAUD_E[Baud]; //波特率分頻器指數(shù)部分
??????U1BAUD?=?BAUD_M[Baud]; //波特率分頻器小數(shù)部分
??????P0SEL?|=?BIT4?+?BIT5;? //P0.5?TXDP0.4?RXD
??????URX1IF?=?0; //清除串口接收中斷標志
??????UTX1IF?=?0; //清除串口發(fā)送中斷標志
??????URX1IE?=?(RxIntEn?==?ENABLE)???1?:?0;?? //使能串口接收中斷
??????UART_SetRxBuff(port?CommRxBuff1?128); //初始化串口緩沖區(qū)
????}break;
????default?:?break;
??}
??
}


/************************************************************************************
*?@函數(shù)名??void?UART_SendData(HAL_UART_PORT?port?uint8?*pbuff?uint16?len)
*
*?@描述????串口發(fā)送函數(shù).
*
*?@參數(shù)????port:通道選擇HAL_UART_PORT_0HAL_UART_PORT_1
*??????????pbuff:數(shù)據(jù)緩沖區(qū)

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件??????20687??2015-04-17?11:50??串口透傳程序\components\basicrf\basic_rf.c

?????文件???????5218??2015-04-17?11:50??串口透傳程序\components\basicrf\basic_rf.h

?????文件???????4044??2015-04-17?11:50??串口透傳程序\components\basicrf\basic_rf_security.c

?????文件???????2887??2015-04-17?11:50??串口透傳程序\components\basicrf\basic_rf_security.h

?????文件???????1602??2015-04-17?11:50??串口透傳程序\components\basicrf\hal_pkt.h

?????文件??????16709??2015-04-17?11:50??串口透傳程序\components\basicrf\hal_rf.c

?????文件???????4940??2015-04-17?11:50??串口透傳程序\components\basicrf\hal_rf.h

?????文件???????6227??2015-04-17?11:50??串口透傳程序\components\common\cc8051\hal_cc8051.h

?????文件???????3949??2015-04-17?11:50??串口透傳程序\components\common\clock.h

?????文件???????9144??2015-04-17?11:50??串口透傳程序\components\common\hal_adc.c

?????文件???????6178??2015-04-17?11:50??串口透傳程序\components\common\hal_adc.h

?????文件???????5654??2015-04-17?11:50??串口透傳程序\components\common\hal_defs.h

?????文件???????5541??2015-04-17?11:50??串口透傳程序\components\common\hal_dma.c

?????文件??????12790??2015-04-17?11:50??串口透傳程序\components\common\hal_dma.h

?????文件???????8577??2015-04-17?11:50??串口透傳程序\components\common\hal_drivers.c

?????文件???????4701??2015-04-17?11:50??串口透傳程序\components\common\hal_drivers.h

?????文件???????6703??2015-04-17?11:50??串口透傳程序\components\common\hal_flash.c

?????文件???????4967??2015-04-17?11:50??串口透傳程序\components\common\hal_flash.h

?????文件???????3960??2015-04-17?11:50??串口透傳程序\components\common\hal_int.c

?????文件???????4434??2015-04-17?11:50??串口透傳程序\components\common\hal_int.h

?????文件???????6007??2015-04-17?11:50??串口透傳程序\components\common\hal_mcu.c

?????文件???????9043??2015-04-17?11:50??串口透傳程序\components\common\hal_mcu.h

?????文件??????11172??2015-04-17?11:50??串口透傳程序\components\common\hal_timer.c

?????文件???????8473??2015-04-17?11:50??串口透傳程序\components\common\hal_timer.h

?????文件???????4109??2015-04-17?11:50??串口透傳程序\components\common\hal_types.h

?????文件???????8766??2015-04-17?11:50??串口透傳程序\components\common\hal_uart.c

?????文件???????1303??2015-04-17?11:50??串口透傳程序\components\common\hal_uart.h

?????文件???????5745??2015-04-17?11:50??串口透傳程序\components\common\util.c

?????文件???????3386??2015-04-17?11:50??串口透傳程序\components\common\util.h

?????文件??????16271??2015-04-17?11:50??串口透傳程序\components\common\_hal_uart_isr.c

............此處省略88個文件信息

評論

共有 條評論