00001
00038 #ifndef REGS_XMEGA_PR_H_INCLUDED
00039 #define REGS_XMEGA_PR_H_INCLUDED
00040
00041 #include <chip/memory-map.h>
00042 #include <io.h>
00043
00054
00055
00056 #define XMEGA_PR_PRGEN 0x00 //!< General Power Reduction Register
00057 #define XMEGA_PR_PRPA 0x01 //!< Power Reduction Port A
00058 #define XMEGA_PR_PRPB 0x02 //!< Power Reduction Port B
00059 #define XMEGA_PR_PRPC 0x03 //!< Power Reduction Port C
00060 #define XMEGA_PR_PRPD 0x04 //!< Power Reduction Port D
00061 #define XMEGA_PR_PRPE 0x05 //!< Power Reduction Port E
00062 #define XMEGA_PR_PRPF 0x06 //!< Power Reduction Port F
00063
00064
00066
00067 #define PR_DMA_BIT 0 //!< DMA Controller
00068 #define PR_EVSYS_BIT 1 //!< Event System
00069 #define PR_RTC_BIT 2 //!< Real-Time Counter
00070 #define PR_EBI_BIT 3 //!< External Bus Interface
00071 #define PR_AES_BIT 4 //!< AES Module
00072 #define PR_USB_BIT 6 //!< USB Module
00073
00074
00076
00077 #define PR_AC_BIT 0 //!< Analog Comparator
00078 #define PR_ADC_BIT 1 //!< Analog/Digital Converter
00079 #define PR_DAC_BIT 2 //!< Digital/Analog Converter
00080
00081
00083
00084 #define PR_TC0_BIT 0 //!< Timer/Counter 0
00085 #define PR_TC1_BIT 1 //!< Timer/Counter 1
00086 #define PR_HIRES_BIT 2 //!< Hi-Resolution Extension
00087 #define PR_SPI_BIT 3 //!< Serial Peripheral Interface
00088 #define PR_USART0_BIT 4 //!< USART 0
00089 #define PR_USART1_BIT 5 //!< USART 1
00090 #define PR_TWI_BIT 6 //!< Two-Wire Interface
00091
00092
00094
00095
00096 #define PR_BIT(name) (1U << PR_##name##_BIT)
00097
00098
00100
00101
00102 #define pr_read_reg(reg) \
00103 _pr_read_reg(reg)
00104 #define _pr_read_reg(reg) \
00105 mmio_read8((void *)(PR_BASE + XMEGA_PR_##reg))
00106
00107 #define pr_write_reg(reg, value) \
00108 _pr_write_reg(reg, value)
00109 #define _pr_write_reg(reg, value) \
00110 mmio_write8((void *)(PR_BASE + XMEGA_PR_##reg), (value))
00111
00112
00114
00115 #endif