Power Modes Fine Adjustments
Let's adjust the star rating
We can adjust specific settings in the power consumption of the AVR chip without depending upon the standard modes provided by the AVR corporation inbuilt as various sleep modes.The library also has various implementations to control those specific features and allow or dis-allow the functioning of different Peripherals (like USART) which could be attached to the micro-controller.
#
Enum DescriptionThe Peripherals
correspond to real world as shown -
TWI
: Power Reduction TWIADC
: Power Reduction ADCSPI
: Power Reduction Serial Peripheral InterfaceTIMER2
: Power Reduction Timer/Counter2TIMER0
: Power Reduction Timer/Counter0TIMER1
: Power Reduction Timer/Counter1TIMER3
: Power Reduction Timer/Counter3TIMER4
: Power Reduction Timer/Counter4TIMER5
: Power Reduction Timer/Counter5USART0
: Power Reduction USART0USART3
: Power Reduction USART3USART2
: Power Reduction USART2USART1
: Power Reduction USART1
Note that USART1,USART2,USART3,TIMER3,TIMER4 and TIMER5 are not applicable for ATMEGA328P
#
Struct DefinitionsContains registers to control the functioning of clocks in the chip.
It would be used to control the power modes of the chip as mentioned
in the enum Peripherals
above.
PRR
โ Power Reduction Register contains control bits for power control through clock gating.
#
Trait Implementationsnew
for Power
#
Impl Creates a new reference to the Sleep structure at a specified location.
disable_clocks
for Power
#
Impl This is the function for disabling the clock system of your choice. It would create a new element of the structure power which would be used to control various clock gating features of the chip. All the clock features are implemented in this function using match cases. Please specify the type of power reduction mode to be used as the mode, use the standard keywords.
#
Usage:enable_clocks
for Power
#
Impl This is the function for enabling the clock system of your choice.