Serial port.  Zigee BeeKit

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Serial port.  Zigee BeeKit

1,259 Views
Aliester
Contributor I
Hello.
I am using the beeKit and trying to understand the code generated to learn how would be adequate to create my own code. Any one known where the data is send to the UART? In the Uart1_Transmit function I can't find where the serial port is really been used.
Any help will do.
Thank you.
 
 
 
 
Added product to subject.


Message Edited by NLFSJ on 2008-07-23 12:36 PM
Labels (1)
0 Kudos
Reply
1 Reply

471 Views
Ware
Contributor III
 
Aliester,
 
"...\PLM\Source\UART\Uart.c" Contains the actual low level code for the UART interface.
 
To use those functions in your application layer, a good example to look at would be the "Wireless UART" example in BeeKit.
 
Declare a constant string in FLASH:
static uint8_t const DATA_HDR[]  =  "Hello my name is WARE, how are you? \r\n";

During initialization you would start UART interface:
    Uart_ModuleInit();  // initialize the UART
    UartX_SetRxCallBack(UartRxCallBack);

In a function somehwhere you would start the UART transmit:
        while(!UartX_Transmit(DATA_HDR,sizeof(DATA_HDR),UartTxCallBack));
 
Put callbacks in your app layer:
/* The UART has finished transmitting a buffer out through the serial port. */
static void UartTxCallBack(unsigned char const *pBuf) {
    (void) pBuf;
    return;
}                                       /* UartTxCallBack() */
/* The UART has Rcvd data. */
static void UartRxCallBack(void) {
    TS_SendEvent(gAppTaskID, eventRxFromUart_c);
    return;
}                                       /* UartRxCallBack() */


Regards,
 - Ware
 
0 Kudos
Reply