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

# Power management drivers module

## 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() (CLKPR = (1<<CLKPCE),CLKPR = 0)
| Clear_prescaler.
#define | Set_prescaler(x) (CLKPR = (1<<CKLPCE),CLKPR = x)
| Set_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())
| Enter_idle_mode.
#define | Enter_power_down_mode() (set_power_down_mode())
| Enter_power_down_mode.
#define | Enter_adc_noise_reduction_mode() (set_adc_noise_reduction_mode())
| Enter_adc_noise_reduction_mode.
#define | Enter_power_save_mode() (set_power_save_mode())
| Enter_power_save_mode.
#define | Enter_standby_mode() (set_standby_mode())
| Enter_standby_mode.
#define | Enter_ext_standby_mode() (set_ext_standby_mode())
| Enter_ext_standby_mode.
## Functions
void | set_idle_mode (void)
| set_idle_mode.
void | set_power_down_mode (void)
| set_power_down_mode.
void | set_adc_noise_reduction_mode (void)
| set_adc_noise_reduction_mode.
void | set_power_save_mode (void)
| set_power_save_mode.
void | set_standby_mode (void)
| set_standby_mode.
void | set_ext_standby_mode (void)
| set_ext_standby_mode.

## Define Documentation

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

Definition at line 27 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 28 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 29 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 30 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 31 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 32 of file power_drv.h.

Referenced by set_ext_standby_mode().

#define Clear_prescaler | ( |  | ) | (CLKPR = (1<<CLKPCE),CLKPR = 0)

Clear_prescaler.

This function reset the internal CPU core clock prescaler

Parameters:

  | none |

Returns:
  none.

Definition at line 43 of file power_drv.h.

Referenced by main().

#define Set_prescaler | ( | x |  | ) | (CLKPR = (1<<CKLPCE),CLKPR = x)

Set_prescaler.

This function configure the internal CPU core clock prescaler value

Parameters:

  | x,: | prescaler new value

Returns:
  none.

Definition at line 54 of file power_drv.h.

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

Definition at line 58 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 61 of file power_drv.h.

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

Definition at line 62 of file power_drv.h.

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

Enter_idle_mode.

This function makes the AVR core enter idle mode.

Parameters:

  | none |

Returns:
  none.

Definition at line 81 of file power_drv.h.

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

Enter_power_down_mode.

This function makes the AVR core enter power down mode.

Parameters:

  | none |

Returns:
  none.

Definition at line 91 of file power_drv.h.

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

Enter_adc_noise_reduction_mode.

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

Parameters:

  | none |

Returns:
  none.

Definition at line 101 of file power_drv.h.

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

Enter_power_save_mode.

This function makes the AVR core enter power save mode.

Parameters:

  | none |

Returns:
  none.

Definition at line 111 of file power_drv.h.

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

Enter_standby_mode.

This function makes the AVR core enter standby mode.

Parameters:

  | none |

Returns:
  none.

Definition at line 121 of file power_drv.h.

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

Enter_ext_standby_mode.

This function makes the AVR core enter extended standby mode.

Parameters:

  | none |

Returns:
  none.

Definition at line 131 of file power_drv.h.

## Function Documentation

void set_idle_mode | ( | void |  | ) |

set_idle_mode.

This function makes the AVR core enter idle mode.

Parameters:

  | none |

Returns:
  none.

Definition at line 50 of file power_drv.c.

References Setup_idle_mode, and Sleep_instruction.

    00051 {
    00052    Setup_idle_mode();
    00053    Sleep_instruction();
    00054 }

void set_power_down_mode | ( | void |  | ) |

set_power_down_mode.

This function makes the AVR core enter power down mode.

Parameters:

  | none |

Returns:
  none.

Definition at line 34 of file power_drv.c.

References Setup_power_down_mode, and Sleep_instruction.

    00035 {
    00036    Setup_power_down_mode();
    00037    Sleep_instruction();
    00038 }

void set_adc_noise_reduction_mode | ( | void |  | ) |

set_adc_noise_reduction_mode.

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

Parameters:

  | none |

Returns:
  none.

Definition at line 64 of file power_drv.c.

References Setup_adc_noise_reduction_mode, and Sleep_instruction.

    00065 {
    00066    Setup_adc_noise_reduction_mode();
    00067    Sleep_instruction();
    00068 }

void set_power_save_mode | ( | void |  | ) |

set_power_save_mode.

This function makes the AVR core enter power save mode.

Parameters:

  | none |

Returns:
  none.

Definition at line 78 of file power_drv.c.

References Setup_power_save_mode, and Sleep_instruction.

    00079 {
    00080    Setup_power_save_mode();
    00081    Sleep_instruction();
    00082 }

void set_standby_mode | ( | void |  | ) |

set_standby_mode.

This function makes the AVR core enter standby mode.

Parameters:

  | none |

Returns:
  none.

Definition at line 92 of file power_drv.c.

References Setup_standby_mode, and Sleep_instruction.

    00093 {
    00094    Setup_standby_mode();
    00095    Sleep_instruction();
    00096 }

void set_ext_standby_mode | ( | void |  | ) |

set_ext_standby_mode.

This function makes the AVR core enter extended standby mode.

Parameters:

  | none |

Returns:
  none.

Definition at line 106 of file power_drv.c.

References Setup_ext_standby_mode, and Sleep_instruction.

    00107 {
    00108    Setup_ext_standby_mode();
    00109    Sleep_instruction();
    00110 }