SZS ez430-RF2480 1.0

ZigBee Sensor Network with synchronized time and time-stamped measurements.
uart.h
Go to the documentation of this file.
1 /*
2  * uart.h
3  *
4  * Date: 19/06/2014
5  * Author: Fernando Biazi Nascimento
6  * Copyright © 2014 Fernando Biazi Nascimento. All rights reserved.
7  *
8  * License of use and copy on file license.txt
9  *
10  */
11 
20 #ifndef UART_H_
21 #define UART_H_
22 
23 /*
24  * ======== Includes ========
25  */
26 
27 #include <xdc/std.h>
28 
29 /*
30  * ======== Doxygen ========
31  */
38 /*
39  * ======== Constants ========
40  */
41 
45 #define UART_RX_BUF_SIZE 32 // <= 255
46 
49 #define UART_TX_BUF_SIZE 128 // <= 255
50 /*
51  * ======== Macros ========
52  */
53 
54 /*
55  * ======== Types ========
56  */
57 
58 /*
59  * ======== Global Variables ========
60  */
61 
62 /*
63  * ======== Global Functions ========
64  */
65 
66 void uart_init();
67 UInt16 uart_proccess();
68 
69 UInt8 uart_startFrame(UInt8 len, UInt8 cmd0, UInt8 cmd1);
70 void uart_endFrame();
71 UInt8 uart_snd(UInt8 len, void *pBuf);
72 //This function is not being used, but is left here as an example
73 //UInt8 uart_rcv(UInt8 size, void *pBuf);
74 
75 void USCIA0RX_ISR();
76 void USCIA0TX_ISR();
77 
78 void uart_sndnextchar();
79 
80 UInt8 uart_txBufFree();
81 
82 UInt8 uart_sndInt64(int64_t *p);
83 UInt8 uart_sndUInt64(uint64_t *p);
84 UInt8 uart_sndUInt48(uint64_t *p);
85 UInt8 uart_sndUInt32(UInt32 *p);
86 UInt8 uart_sndUInt16(UInt16 v);
87 UInt8 uart_sndUInt8(UInt8 v);
88 
89 UInt8 uart_forwardCmd(char *pBuf);
90 
94 #endif /* UART_H_ */
void USCIA0TX_ISR()
USCIA0 TX ISR.
Definition: uart.c:259
UInt8 uart_sndUInt8(UInt8 v)
Send UInt8.
Definition: uart.c:410
UInt8 uart_txBufFree()
TX buffer free.
Definition: uart.c:293
UInt16 uart_proccess()
UART process.
Definition: uart.c:122
UInt8 uart_startFrame(UInt8 len, UInt8 cmd0, UInt8 cmd1)
Start frame.
Definition: uart.c:140
UInt8 uart_sndUInt16(UInt16 v)
Send UInt16.
Definition: uart.c:395
void USCIA0RX_ISR()
USCIA0 RX ISR.
Definition: uart.c:237
UInt8 uart_sndUInt32(UInt32 *p)
Send UInt32.
Definition: uart.c:380
UInt8 uart_forwardCmd(char *pBuf)
Forward command.
Definition: uart.c:740
UInt8 uart_sndInt64(int64_t *p)
Send Int64.
Definition: uart.c:335
UInt8 uart_snd(UInt8 len, void *pBuf)
Send.
Definition: uart.c:181
void uart_init()
UART initialization.
Definition: uart.c:105
void uart_endFrame()
End frame.
Definition: uart.c:164
void uart_sndnextchar()
Send next char.
Definition: uart.c:270
UInt8 uart_sndUInt48(uint64_t *p)
Send UInt48.
Definition: uart.c:365
UInt8 uart_sndUInt64(uint64_t *p)
Send UInt64.
Definition: uart.c:350