SZS ez430-RF2480 1.0

ZigBee Sensor Network with synchronized time and time-stamped measurements.
uart.c File Reference

UART implementation. More...

#include "uart.h"
#include "msp430f2274.h"
#include "spi.h"
#include "nwk.h"
#include "clock.h"
#include "cc2480ai.h"
#include "im.h"
+ Include dependency graph for uart.c:

Go to the source code of this file.

Functions

void uart_proccessCmd ()
 Process command. More...
 
UInt8 uart_txBufFreeReal ()
 TX buffer real free. More...
 
void uart_init ()
 UART initialization. More...
 
UInt16 uart_proccess ()
 UART process. More...
 
UInt8 uart_startFrame (UInt8 len, UInt8 cmd0, UInt8 cmd1)
 Start frame. More...
 
void uart_endFrame ()
 End frame. More...
 
UInt8 uart_snd (UInt8 len, void *pBuf)
 Send. More...
 
void USCIA0RX_ISR ()
 USCIA0 RX ISR. More...
 
void USCIA0TX_ISR ()
 USCIA0 TX ISR. More...
 
void uart_sndnextchar ()
 Send next char. More...
 
UInt8 uart_txBufFree ()
 TX buffer free. More...
 
UInt8 uart_sndInt64 (int64_t *p)
 Send Int64. More...
 
UInt8 uart_sndUInt64 (uint64_t *p)
 Send UInt64. More...
 
UInt8 uart_sndUInt48 (uint64_t *p)
 Send UInt48. More...
 
UInt8 uart_sndUInt32 (UInt32 *p)
 Send UInt32. More...
 
UInt8 uart_sndUInt16 (UInt16 v)
 Send UInt16. More...
 
UInt8 uart_sndUInt8 (UInt8 v)
 Send UInt8. More...
 
UInt8 uart_forwardCmd (char *pBuf)
 Forward command. More...
 

Variables

char uart_rxBuf [UART_RX_BUF_SIZE]
 UART RX buffer.
 
char uart_txBuf [UART_TX_BUF_SIZE]
 UART TX buffer.
 
UInt8 uart_rxBufRead
 RX buffer read pointer, if = uart_rxBufWrite, no chars to send, must roll to zero at at UART_RX_BUF_SIZE.
 
UInt8 uart_rxBufWrite
 RX buffer write pointer, if + 1 = uart_rxBufRead, full buffer, must roll to zero at at UART_RX_BUF_SIZE.
 
UInt8 uart_txBufRead
 TX buffer read pointer, if = uart_txBufWrite, no chars to send, must roll to zero at at UART_TX_BUF_SIZE.
 
UInt8 uart_txBufWrite
 TX buffer write pointer, if + 1 = uart_txBufRead, full buffer, must roll to zero at at UART_TX_BUF_SIZE.
 
char uart_currentFCS
 Frame-check sequence.
 

Detailed Description

UART implementation.

Definition in file uart.c.

Function Documentation

void uart_proccessCmd ( )

Process command.

This function searches for a valid command on the RX buffer and takes action on it.

Definition at line 421 of file uart.c.

References ccai_resetFull(), clock_adjTime(), clock_setTime(), clock_tickSize, NWK_DEVTYPE_COORDINATOR, NWK_DEVTYPE_ENDDEVICE, NWK_DEVTYPE_ROUTER, nwk_init(), nwk_setDeviceType(), nwk_setSink(), spi_init(), uart_endFrame(), UART_RX_BUF_SIZE, uart_rxBuf, uart_rxBufRead, uart_rxBufWrite, uart_snd(), uart_sndUInt8(), uart_startFrame(), and uart_txBufFree().

Referenced by uart_proccess().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

UInt8 uart_txBufFreeReal ( )

TX buffer real free.

Returns free bytes on TX buffer for internal use, this doesn't count header and footer octets.

Returns
Free bytes on TX buffer

Definition at line 314 of file uart.c.

References UART_TX_BUF_SIZE, uart_txBufRead, and uart_txBufWrite.

Referenced by uart_snd(), and uart_txBufFree().

+ Here is the caller graph for this function: