current limit on shovel
[aversive.git] / projects / kbd_uart_test / uart_config.h
1 // Droids-corp 2004 - Zer0\r
2 // config for uart module\r
3 \r
4 /*\r
5  * This is the configuration file for the uart module.\r
6  * This module provides :\r
7  *   - Tx and Rx with fifo\r
8  *   - two modes : the first one tries to be faster ; when you try to\r
9  *     send data and the fifo is full, the byte is dropped. The second\r
10  *     one (with UART1_DONT_LOOSE_DATA defined) can be slower ; when the \r
11  *     fifo is full, the writing of a data blocks in the interrupt.\r
12  *   - Speed selection (for the moment the module don't use the UBRRxH\r
13  *     register so the speed cannot be too low. (min is 4800 at 16 Mhz)\r
14  *   - Parity selection (if the uC support it)\r
15  *   - 5 to 9 data bits (if the uC support it). Warning : when you use \r
16  *     9 bits, the prototypes of the functions change (uint8_t become uint16_t).\r
17  *   - 1 or 2 stop bits (if the uC support it).\r
18  *   - 2 UARTs (if the uC support it).\r
19  * \r
20  *\r
21  *\r
22  * Number of bits in frame for tx and rx are the same\r
23  *\r
24  * It doesn't support some USART capabilities :\r
25  *   - Synchronous mode\r
26  *   - Multiprocessor communication\r
27  */\r
28 \r
29 \r
30 #ifndef UART_CONFIG_H\r
31 #define UART_CONFIG_H\r
32 \r
33 /* \r
34  * Global configuration (config that is used for each uart)\r
35  */\r
36 #define UART_MCU_QUARTZ 16000\r
37 \r
38 \r
39 \r
40 /*\r
41  * UART0 definitions \r
42  */\r
43 #define UART0_TX_ENABLED /* enable uart0 emission */\r
44 #define UART0_RX_ENABLED /* enable uart0 reception */\r
45 \r
46 /* this means that the function uart_sendchar will block if the fifo is full */\r
47 #define UART0_DONT_LOOSE_DATA \r
48 \r
49 #define UART0_BAUDRATE 9600\r
50 \r
51 /* \r
52  * if you enable this, the maximum baudrate you can reach is \r
53  * higher, but the precision is lower. \r
54  */\r
55 #define UART0_USE_DOUBLE_SPEED 0\r
56 //#define UART0_USE_DOUBLE_SPEED 1\r
57 \r
58 #define UART0_RX_FIFO_SIZE 16\r
59 #define UART0_TX_FIFO_SIZE 16\r
60 \r
61 //#define UART0_NBITS 5\r
62 //#define UART0_NBITS 6\r
63 //#define UART0_NBITS 7\r
64 #define UART0_NBITS 8\r
65 //#define UART0_NBITS 9\r
66 \r
67 #define UART0_PARITY UART_PARTITY_NONE\r
68 //#define UART0_PARITY UART_PARTITY_ODD\r
69 //#define UART0_PARITY UART_PARTITY_EVEN\r
70 \r
71 #define UART0_STOP_BIT 1\r
72 //#define UART0_STOP_BIT 2\r
73 \r
74 #endif\r
75 \r