00001
00039 #ifndef CHIP_UART_H_INCLUDED
00040 #define CHIP_UART_H_INCLUDED
00041
00042 #include <chip/memory-map.h>
00043 #include <clk/sys.h>
00044 #include <uart/uart_xmega.h>
00045
00060 #define uart_get_regs(id) ((void *) USART##id##_BASE)
00061
00062 #define uart_enable_clock(id) \
00063 do { \
00064 unsigned int _id = (id); \
00065 \
00066 sysclk_enable_module(SYSCLK_PORT_C + (_id >> 1), \
00067 SYSCLK_USART0 + (_id & 1)); \
00068 } while (0)
00069 #define uart_disable_clock(id) \
00070 do { \
00071 unsigned int _id = (id); \
00072 \
00073 sysclk_disable_module(SYSCLK_PORT_C + (_id >> 1), \
00074 SYSCLK_USART0 + (_id & 1)); \
00075 } while (0)
00076
00077 #endif