Quantcast
Channel: 蓝牙论坛 - 最近的话题
Viewing all articles
Browse latest Browse all 7485

cc2640 Uart Rx Interrupt

$
0
0

Hi All

請教各位先進,平時為了省電會關閉Uart Rx,但希望當外部有data進來時,能喚醒Uart Rx,開始接收data。
以下是小弟的define,不知有何錯誤,send Rx data一直進不了uart_int_cb()

[Board.h]
#define Board_UART_RX                       IOID_1

[main.c]
<Globol>
static PIN_Config UartInterrupt_configTab[] =
{
    Board_UART_RX | PIN_INPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL,
    PIN_TERMINATE
};

<main_init()>
hUartIntPin = PIN_open(&uartIntPin, UartInterrupt_configTab);
PIN_registerIntCb(hUartIntPin, uart_int_cb);
PIN_setConfig(hUartIntPin, PIN_BM_IRQ, Board_UART_RX | PIN_IRQ_NEGEDGE);

<uart_int_cb()>
static void uart_int_cb(PIN_Handle hPin, PIN_Id pinId)
{
     events |= UART_INT_EVT;
     Semaphore_post(sem);
}

 


Viewing all articles
Browse latest Browse all 7485

Trending Articles