ATMEL: Power management drivers

- Main Page
- Modules
- Data Structures
- Files
- Related Pages

# Power management drivers

## Defines

#define | Setup_idle_mode() (SMCR=0,SMCR |= (1<<SE))
#define | Setup_power_down_mode() (SMCR=0,SMCR |= (1<<SE)+(1<<SM1))
#define | Setup_adc_noise_reduction_mode() (SMCR=0,SMCR |= (1<<SE)+(1<<SM0))
#define | Setup_power_save_mode() (SMCR=0,SMCR |= (1<<SE)+(1<<SM1)+(1<<SM0))
#define | Setup_standby_mode() (SMCR=0,SMCR |= (1<<SE)+(1<<SM2)+(1<<SM1))
#define | Setup_ext_standby_mode() (SMCR=0,SMCR |= (1<<SE)+(1<<SM2)+(1<<SM1)+(1<<SM0))
#define | Clear_prescaler() (Set_cpu_prescaler(0))
| This function reset the internal CPU core clock prescaler.
#define | Sleep_instruction() {asm("SLEEP");}
#define | Set_power_down_mode() set_power_down_mode()
#define | Set_idle_mode() set_idle_mode()
#define | Enter_idle_mode() (set_idle_mode())
| This function makes the AVR core enter idle mode.
#define | Enter_power_down_mode() (set_power_down_mode())
| This function makes the AVR core enter power down mode.
#define | Enter_adc_noise_reduction_mode() (set_adc_noise_reduction_mode())
| This function makes the AVR core enter adc noise reduction mode.
#define | Enter_power_save_mode() (set_power_save_mode())
| This function makes the AVR core enter power save mode.
#define | Enter_standby_mode() (set_standby_mode())
| This function makes the AVR core enter standby mode.
#define | Enter_ext_standby_mode() (set_ext_standby_mode())
| This function makes the AVR core enter extended standby mode.

## Functions

void | Set_cpu_prescaler (U8 x)
| This function configure the internal CPU core clock prescaler value.
void | set_idle_mode (void)
| This function makes the AVR core enter idle mode.
void | set_power_down_mode (void)
| This function makes the AVR core enter power down mode.
void | set_adc_noise_reduction_mode (void)
| This function makes the AVR core enter adc noise reduction mode.
void | set_power_save_mode (void)
| This function makes the AVR core enter power save mode.
void | set_standby_mode (void)
| This function makes the AVR core enter standby mode.
void | set_ext_standby_mode (void)
| This function makes the AVR core enter extended standby mode.

## Define Documentation

#define Setup_idle_mode | ( |  | ) | (SMCR=0,SMCR |= (1<<SE))

Definition at line 60 of file power_drv.h.

Referenced by set_idle_mode().

#define Setup_power_down_mode | ( |  | ) | (SMCR=0,SMCR |= (1<<SE)+(1<<SM1))

Definition at line 61 of file power_drv.h.

Referenced by set_power_down_mode().

#define Setup_adc_noise_reduction_mode | ( |  | ) | (SMCR=0,SMCR |= (1<<SE)+(1<<SM0))

Definition at line 62 of file power_drv.h.

Referenced by set_adc_noise_reduction_mode().

#define Setup_power_save_mode | ( |  | ) | (SMCR=0,SMCR |= (1<<SE)+(1<<SM1)+(1<<SM0))

Definition at line 63 of file power_drv.h.

Referenced by set_power_save_mode().

#define Setup_standby_mode | ( |  | ) | (SMCR=0,SMCR |= (1<<SE)+(1<<SM2)+(1<<SM1))

Definition at line 64 of file power_drv.h.

Referenced by set_standby_mode().

#define Setup_ext_standby_mode | ( |  | ) | (SMCR=0,SMCR |= (1<<SE)+(1<<SM2)+(1<<SM1)+(1<<SM0))

Definition at line 65 of file power_drv.h.

Referenced by set_ext_standby_mode().

#define Clear_prescaler | ( |  | ) | (Set_cpu_prescaler(0))

This function reset the internal CPU core clock prescaler.

Definition at line 72 of file power_drv.h.

Referenced by __low_level_init(), and main().

#define Sleep_instruction | ( |  | ) | {asm("SLEEP");}

Definition at line 86 of file power_drv.h.

Referenced by set_adc_noise_reduction_mode(), set_ext_standby_mode(), set_idle_mode(), set_power_down_mode(), set_power_save_mode(), and set_standby_mode().

#define Set_power_down_mode | ( |  | ) | set_power_down_mode()

Definition at line 89 of file power_drv.h.

#define Set_idle_mode | ( |  | ) | set_idle_mode()

Definition at line 90 of file power_drv.h.

#define Enter_idle_mode | ( |  | ) | (set_idle_mode())

This function makes the AVR core enter idle mode.

Definition at line 103 of file power_drv.h.

#define Enter_power_down_mode | ( |  | ) | (set_power_down_mode())

This function makes the AVR core enter power down mode.

Definition at line 107 of file power_drv.h.

#define Enter_adc_noise_reduction_mode | ( |  | ) | (set_adc_noise_reduction_mode())

This function makes the AVR core enter adc noise reduction mode.

Definition at line 111 of file power_drv.h.

#define Enter_power_save_mode | ( |  | ) | (set_power_save_mode())

This function makes the AVR core enter power save mode.

Definition at line 115 of file power_drv.h.

#define Enter_standby_mode | ( |  | ) | (set_standby_mode())

This function makes the AVR core enter standby mode.

Definition at line 120 of file power_drv.h.

#define Enter_ext_standby_mode | ( |  | ) | (set_ext_standby_mode())

This function makes the AVR core enter extended standby mode.

Definition at line 124 of file power_drv.h.

## Function Documentation

void Set_cpu_prescaler | ( | U8 | x | ) |

This function configure the internal CPU core clock prescaler value.

Parameters:

  | x,: | prescaler new value

This function configure the internal CPU core clock prescaler value.

Parameters:

  | U8 | the precaler value to be written

Definition at line 60 of file power_drv.c.

    00061 {
    00062    U8 save_int=Get_interrupt_state();
    00063    Disable_interrupt();
    00064    CLKPR=(1<<CLKPCE);
    00065    CLKPR=x;
    00066    if(save_int) { Enable_interrupt(); }
    00067 }

void set_idle_mode | ( | void |  | ) |

This function makes the AVR core enter idle mode.

Definition at line 82 of file power_drv.c.

References Setup_idle_mode, and Sleep_instruction.

    00083 {
    00084    Setup_idle_mode();
    00085    Sleep_instruction();
    00086 }

void set_power_down_mode | ( | void |  | ) |

This function makes the AVR core enter power down mode.

Definition at line 73 of file power_drv.c.

References Setup_power_down_mode, and Sleep_instruction.

    00074 {
    00075    Setup_power_down_mode();
    00076    Sleep_instruction();
    00077 }

void set_adc_noise_reduction_mode | ( | void |  | ) |

This function makes the AVR core enter adc noise reduction mode.

Definition at line 91 of file power_drv.c.

References Setup_adc_noise_reduction_mode, and Sleep_instruction.

    00092 {
    00093    Setup_adc_noise_reduction_mode();
    00094    Sleep_instruction();
    00095 }

void set_power_save_mode | ( | void |  | ) |

This function makes the AVR core enter power save mode.

Definition at line 100 of file power_drv.c.

References Setup_power_save_mode, and Sleep_instruction.

    00101 {
    00102    Setup_power_save_mode();
    00103    Sleep_instruction();
    00104 }

void set_standby_mode | ( | void |  | ) |

This function makes the AVR core enter standby mode.

Definition at line 109 of file power_drv.c.

References Setup_standby_mode, and Sleep_instruction.

    00110 {
    00111    Setup_standby_mode();
    00112    Sleep_instruction();
    00113 }

void set_ext_standby_mode | ( | void |  | ) |

This function makes the AVR core enter extended standby mode.

Definition at line 118 of file power_drv.c.

References Setup_ext_standby_mode, and Sleep_instruction.

    00119 {
    00120    Setup_ext_standby_mode();
    00121    Sleep_instruction();
    00122 }