Contiki 3.x
Main Page
Related Pages
Modules
Data Structures
Files
Examples
File List
Globals
cpu
cc253x
dev
uart.h
1
#ifndef UART_H
2
#define UART_H
3
4
#include "contiki-conf.h"
5
6
#include "
cc253x.h
"
7
#include "8051def.h"
8
9
/*---------------------------------------------------------------------------*/
10
/* UART BAUD Rates */
11
/*
12
* Macro to set speed of UART N by setting the UnBAUD SFR to M and the
13
* UnGCR SRF to E. See the cc2530 datasheet for possible values of M and E
14
*/
15
#define UART_SET_SPEED(N, M, E) do{ U##N##BAUD = M; U##N##GCR = E; } while(0)
16
17
/*
18
* Sample Values for M and E in the macro above to achieve some common BAUD
19
* rates. For more values, see the cc2430 datasheet
20
*/
21
/* 2000000 - cc2430 theoretical MAX when using the 32MHz clock */
22
#define UART_2K_M 0
23
#define UART_2K_E 16
24
/* 1000000 - cc2430 theoretical MAX when using the 16MHz clock */
25
#define UART_1K_M 0
26
#define UART_1K_E 15
27
/* 921600 */
28
#define UART_921_M 216
29
#define UART_921_E 14
30
/* 460800 Higher values lead to problems when the node needs to RX */
31
#define UART_460_M 216
32
#define UART_460_E 13
33
/* 115200 */
34
#define UART_115_M 216
35
#define UART_115_E 11
36
/* 38400 */
37
#define UART_38_M 59
38
#define UART_38_E 10
39
/* 9600 */
40
#define UART_9_M 59
41
#define UART_9_E 8
42
43
#endif
/* UART_H */
cc253x.h
Definitions for TI/Chipcon cc2530, cc2531 and cc2533 SFR registers.
Generated on Sun Nov 30 2014 09:58:55 for Contiki 3.x by
1.8.5