ATmega328P HAL Driver
hal_power.h
Go to the documentation of this file.
1 
8 /*
9  * MIT License
10  *
11  * Copyright (c) 2023 Ceyhun Şen
12  *
13  * Permission is hereby granted, free of charge, to any person obtaining a copy
14  * of this software and associated documentation files (the "Software"), to deal
15  * in the Software without restriction, including without limitation the rights
16  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17  * copies of the Software, and to permit persons to whom the Software is
18  * furnished to do so, subject to the following conditions:
19  *
20  * The above copyright notice and this permission notice shall be included in
21  * all copies or substantial portions of the Software.
22  *
23  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29  * SOFTWARE.
30  * */
31 
32 #ifndef __HAL_POWER_H
33 #define __HAL_POWER_H
34 
35 #include <stdint.h>
36 
42  power_idle_mode = 0,
43  power_adc_noise_reduction_mode = 1,
44  power_power_down_mode = 2,
45  power_power_save_mode = 3,
46  power_standby_mode = 6,
47  power_external_standby_mode = 7
48 };
49 
55  power_adc = 0,
56  power_usart0 = 1,
57  power_spi = 2,
58  power_timer_1 = 3,
59  power_timer0 = 5,
60  power_timer_2 = 6,
61  power_twi = 7
62 };
63 
65 void power_set_module_power(enum power_modules module, uint8_t state);
66 
67 #endif // __HAL_POWER_H
void power_set_sleep_mode(enum power_sleep_modes mode)
Set sleep mode for ATmega328P.
Definition: hal_power.c:41
power_modules
Definition: hal_power.h:54
void power_set_module_power(enum power_modules module, uint8_t state)
Set specified module's power on or off. If a module is turned off, it might need reinitialization (re...
Definition: hal_power.c:60
power_sleep_modes
Definition: hal_power.h:41