forked from rocketscream/Low-Power
-
Notifications
You must be signed in to change notification settings - Fork 28
/
power2.h
29 lines (23 loc) · 949 Bytes
/
power2.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#ifndef power2_h
#define power2_h
#if defined(__AVR_HAVE_PRR0_PRSPI0)
#define power_spi0_enable() (PRR0 &= (uint8_t)~(1 << PRSPI0))
#define power_spi0_disable() (PRR0 |= (uint8_t)(1 << PRSPI0))
#endif
#if defined(__AVR_HAVE_PRR1_PRSPI1)
#define power_spi1_enable() (PRR1 &= (uint8_t)~(1 << PRSPI1))
#define power_spi1_disable() (PRR1 |= (uint8_t)(1 << PRSPI1))
#endif
#if defined(__AVR_HAVE_PRR0_PRTWI0)
#define power_twi0_enable() (PRR0 &= (uint8_t)~(1 << PRTWI0))
#define power_twi0_disable() (PRR0 |= (uint8_t)(1 << PRTWI0))
#endif
#if defined(__AVR_HAVE_PRR1_PRTWI1)
#define power_twi1_enable() (PRR1 &= (uint8_t)~(1 << PRTWI1))
#define power_twi1_disable() (PRR1 |= (uint8_t)(1 << PRTWI1))
#endif
#if defined(__AVR_HAVE_PRR1_PRPTC)
#define power_ptc_enable() (PRR1 &= (uint8_t)~(1 << PRPTC))
#define power_ptc_disable() (PRR1 |= (uint8_t)(1 << PRPTC))
#endif
#endif