Rev 361 | Rev 1576 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 361 | Rev 690 | ||
|---|---|---|---|
| Line 41... | Line 41... | ||
| 41 | /* |
41 | /* |
| 42 | ** constants and macros |
42 | ** constants and macros |
| 43 | */ |
43 | */ |
| 44 | 44 | ||
| 45 | /** @brief UART Baudrate Expression |
45 | /** @brief UART Baudrate Expression |
| 46 | * @param |
46 | * @param xtalCpu system clock in Mhz, e.g. 4000000L for 4Mhz |
| 47 | * @param |
47 | * @param baudRate baudrate in bps, e.g. 1200, 2400, 9600 |
| 48 | */ |
48 | */ |
| 49 | #define UART_BAUD_SELECT(baudRate,xtalCpu) ((xtalCpu)/((baudRate)*16l)-1) |
49 | #define UART_BAUD_SELECT(baudRate,xtalCpu) ((xtalCpu)/((baudRate)*16l)-1) |
| 50 | 50 | ||
| 51 | /** @brief UART Baudrate Expression for ATmega double speed mode |
51 | /** @brief UART Baudrate Expression for ATmega double speed mode |
| 52 | * @param |
52 | * @param xtalCpu system clock in Mhz, e.g. 4000000L for 4Mhz |
| 53 | * @param |
53 | * @param baudRate baudrate in bps, e.g. 1200, 2400, 9600 |
| 54 | */ |
54 | */ |
| 55 | #define UART_BAUD_SELECT_DOUBLE_SPEED(baudRate,xtalCpu) (((xtalCpu)/((baudRate)*8l)-1)|0x8000) |
55 | #define UART_BAUD_SELECT_DOUBLE_SPEED(baudRate,xtalCpu) (((xtalCpu)/((baudRate)*8l)-1)|0x8000) |
| 56 | 56 | ||
| 57 | 57 | ||
| 58 | /** Size of the circular receive buffer, must be power of 2 */ |
58 | /** Size of the circular receive buffer, must be power of 2 */ |
| Line 95... | Line 95... | ||
| 95 | * |
95 | * |
| 96 | * Returns in the lower byte the received character and in the |
96 | * Returns in the lower byte the received character and in the |
| 97 | * higher byte the last receive error. |
97 | * higher byte the last receive error. |
| 98 | * UART_NO_DATA is returned when no data is available. |
98 | * UART_NO_DATA is returned when no data is available. |
| 99 | * |
99 | * |
| 100 | * @param void |
- | |
| 101 | * @return lower byte: received byte from ringbuffer |
100 | * @return lower byte: received byte from ringbuffer |
| 102 | * @return higher byte: last receive status |
101 | * @return higher byte: last receive status |
| 103 | * - \b 0 successfully received data from UART |
102 | * - \b 0 successfully received data from UART |
| 104 | * - \b UART_NO_DATA |
103 | * - \b UART_NO_DATA |
| 105 | * <br>no receive data available |
104 | * <br>no receive data available |