33 #define _AVR_POWER_H_ 1
547 #if defined(__AVR_HAVE_PRR_PRADC)
548 #define power_adc_enable() (PRR &= (uint8_t)~(1 << PRADC))
549 #define power_adc_disable() (PRR |= (uint8_t)(1 << PRADC))
552 #if defined(__AVR_HAVE_PRR_PRCAN)
553 #define power_can_enable() (PRR &= (uint8_t)~(1 << PRCAN))
554 #define power_can_disable() (PRR |= (uint8_t)(1 << PRCAN))
557 #if defined(__AVR_HAVE_PRR_PRLCD)
558 #define power_lcd_enable() (PRR &= (uint8_t)~(1 << PRLCD))
559 #define power_lcd_disable() (PRR |= (uint8_t)(1 << PRLCD))
562 #if defined(__AVR_HAVE_PRR_PRLIN)
563 #define power_lin_enable() (PRR &= (uint8_t)~(1 << PRLIN))
564 #define power_lin_disable() (PRR |= (uint8_t)(1 << PRLIN))
567 #if defined(__AVR_HAVE_PRR_PRPSC)
568 #define power_psc_enable() (PRR &= (uint8_t)~(1 << PRPSC))
569 #define power_psc_disable() (PRR |= (uint8_t)(1 << PRPSC))
572 #if defined(__AVR_HAVE_PRR_PRPSC0)
573 #define power_psc0_enable() (PRR &= (uint8_t)~(1 << PRPSC0))
574 #define power_psc0_disable() (PRR |= (uint8_t)(1 << PRPSC0))
577 #if defined(__AVR_HAVE_PRR_PRPSC1)
578 #define power_psc1_enable() (PRR &= (uint8_t)~(1 << PRPSC1))
579 #define power_psc1_disable() (PRR |= (uint8_t)(1 << PRPSC1))
582 #if defined(__AVR_HAVE_PRR_PRPSC2)
583 #define power_psc2_enable() (PRR &= (uint8_t)~(1 << PRPSC2))
584 #define power_psc2_disable() (PRR |= (uint8_t)(1 << PRPSC2))
587 #if defined(__AVR_HAVE_PRR_PRSCR)
588 #define power_pscr_enable() (PRR &= (uint8_t)~(1 << PRPSCR))
589 #define power_pscr_disable() (PRR |= (uint8_t)(1 << PRPSCR))
592 #if defined(__AVR_HAVE_PRR_PRSPI)
593 #define power_spi_enable() (PRR &= (uint8_t)~(1 << PRSPI))
594 #define power_spi_disable() (PRR |= (uint8_t)(1 << PRSPI))
597 #if defined(__AVR_HAVE_PRR_PRTIM0)
598 #define power_timer0_enable() (PRR &= (uint8_t)~(1 << PRTIM0))
599 #define power_timer0_disable() (PRR |= (uint8_t)(1 << PRTIM0))
602 #if defined(__AVR_HAVE_PRR_PRTIM1)
603 #define power_timer1_enable() (PRR &= (uint8_t)~(1 << PRTIM1))
604 #define power_timer1_disable() (PRR |= (uint8_t)(1 << PRTIM1))
607 #if defined(__AVR_HAVE_PRR_PRTIM2)
608 #define power_timer2_enable() (PRR &= (uint8_t)~(1 << PRTIM2))
609 #define power_timer2_disable() (PRR |= (uint8_t)(1 << PRTIM2))
612 #if defined(__AVR_HAVE_PRR_PRTWI)
613 #define power_twi_enable() (PRR &= (uint8_t)~(1 << PRTWI))
614 #define power_twi_disable() (PRR |= (uint8_t)(1 << PRTWI))
617 #if defined(__AVR_HAVE_PRR_PRUSART)
618 #define power_usart_enable() (PRR &= (uint8_t)~(1 << PRUSART))
619 #define power_usart_disable() (PRR |= (uint8_t)(1 << PRUSART))
622 #if defined(__AVR_HAVE_PRR_PRUSART0)
623 #define power_usart0_enable() (PRR &= (uint8_t)~(1 << PRUSART0))
624 #define power_usart0_disable() (PRR |= (uint8_t)(1 << PRUSART0))
627 #if defined(__AVR_HAVE_PRR_PRUSART1)
628 #define power_usart1_enable() (PRR &= (uint8_t)~(1 << PRUSART1))
629 #define power_usart1_disable() (PRR |= (uint8_t)(1 << PRUSART1))
632 #if defined(__AVR_HAVE_PRR_PRUSI)
633 #define power_usi_enable() (PRR &= (uint8_t)~(1 << PRUSI))
634 #define power_usi_disable() (PRR |= (uint8_t)(1 << PRUSI))
637 #if defined(__AVR_HAVE_PRR0_PRADC)
638 #define power_adc_enable() (PRR0 &= (uint8_t)~(1 << PRADC))
639 #define power_adc_disable() (PRR0 |= (uint8_t)(1 << PRADC))
642 #if defined(__AVR_HAVE_PRR0_PRC0)
643 #define power_clock_output_enable() (PRR0 &= (uint8_t)~(1 << PRCO))
644 #define power_clock_output_disable() (PRR0 |= (uint8_t)(1 << PRCO))
647 #if defined(__AVR_HAVE_PRR0_PRCRC)
648 #define power_crc_enable() (PRR0 &= (uint8_t)~(1 << PRCRC))
649 #define power_crc_disable() (PRR0 |= (uint8_t)(1 << PRCRC))
652 #if defined(__AVR_HAVE_PRR0_PRCU)
653 #define power_crypto_enable() (PRR0 &= (uint8_t)~(1 << PRCU))
654 #define power_crypto_disable() (PRR0 |= (uint8_t)(1 << PRCU))
657 #if defined(__AVR_HAVE_PRR0_PRDS)
658 #define power_irdriver_enable() (PRR0 &= (uint8_t)~(1 << PRDS))
659 #define power_irdriver_disable() (PRR0 |= (uint8_t)(1 << PRDS))
662 #if defined(__AVR_HAVE_PRR0_PRLFR)
663 #define power_lfreceiver_enable() (PRR0 &= (uint8_t)~(1 << PRLFR))
664 #define power_lfreceiver_disable() (PRR0 |= (uint8_t)(1 << PRLFR))
667 #if defined(__AVR_HAVE_PRR0_PRLIN)
668 #define power_lin_enable() (PRR0 &= (uint8_t)~(1 << PRLIN))
669 #define power_lin_disable() (PRR0 |= (uint8_t)(1 << PRLIN))
672 #if defined(__AVR_HAVE_PRR0_PRPGA)
673 #define power_pga_enable() (PRR0 &= (uint8_t)~(1 << PRPGA))
674 #define power_pga_disable() (PRR0 |= (uint8_t)(1 << PRPGA))
677 #if defined(__AVR_HAVE_PRR0_PRRXDC)
678 #define power_receive_dsp_control_enable() (PRR0 &= (uint8_t)~(1 << PRRXDC))
679 #define power_receive_dsp_control_disable() (PRR0 |= (uint8_t)(1 << PRRXDC))
682 #if defined(__AVR_HAVE_PRR0_PRSPI)
683 #define power_spi_enable() (PRR0 &= (uint8_t)~(1 << PRSPI))
684 #define power_spi_disable() (PRR0 |= (uint8_t)(1 << PRSPI))
687 #if defined(__AVR_HAVE_PRR0_PRT0)
688 #define power_timer0_enable() (PRR0 &= (uint8_t)~(1 << PRT0))
689 #define power_timer0_disable() (PRR0 |= (uint8_t)(1 << PRT0))
692 #if defined(__AVR_HAVE_PRR0_PRTIM0)
693 #define power_timer0_enable() (PRR0 &= (uint8_t)~(1 << PRTIM0))
694 #define power_timer0_disable() (PRR0 |= (uint8_t)(1 << PRTIM0))
697 #if defined(__AVR_HAVE_PRR0_PRT1)
698 #define power_timer1_enable() (PRR0 &= (uint8_t)~(1 << PRT1))
699 #define power_timer1_disable() (PRR0 |= (uint8_t)(1 << PRT1))
702 #if defined(__AVR_HAVE_PRR0_PRTIM1)
703 #define power_timer1_enable() (PRR0 &= (uint8_t)~(1 << PRTIM1))
704 #define power_timer1_disable() (PRR0 |= (uint8_t)(1 << PRTIM1))
707 #if defined(__AVR_HAVE_PRR0_PRT2)
708 #define power_timer2_enable() (PRR0 &= (uint8_t)~(1 << PRT2))
709 #define power_timer2_disable() (PRR0 |= (uint8_t)(1 << PRT2))
712 #if defined(__AVR_HAVE_PRR0_PRTIM2)
713 #define power_timer2_enable() (PRR0 &= (uint8_t)~(1 << PRTIM2))
714 #define power_timer2_disable() (PRR0 |= (uint8_t)(1 << PRTIM2))
717 #if defined(__AVR_HAVE_PRR0_PRT3)
718 #define power_timer3_enable() (PRR0 &= (uint8_t)~(1 << PRT3))
719 #define power_timer3_disable() (PRR0 |= (uint8_t)(1 << PRT3))
722 #if defined(__AVR_HAVE_PRR0_PRTM)
723 #define power_timermodulator_enable() (PRR0 &= (uint8_t)~(1 << PRTM))
724 #define power_timermodulator_disable() (PRR0 |= (uint8_t)(1 << PRTM))
727 #if defined(__AVR_HAVE_PRR0_PRTWI)
728 #define power_twi_enable() (PRR0 &= (uint8_t)~(1 << PRTWI))
729 #define power_twi_disable() (PRR0 |= (uint8_t)(1 << PRTWI))
732 #if defined(__AVR_HAVE_PRR0_PRTXDC)
733 #define power_transmit_dsp_control_enable() (PRR0 &= (uint8_t)~(1 << PRTXDC))
734 #define power_transmit_dsp_control_disable() (PRR0 |= (uint8_t)(1 << PRTXDC))
737 #if defined(__AVR_HAVE_PRR0_PRUSART0)
738 #define power_usart0_enable() (PRR0 &= (uint8_t)~(1 << PRUSART0))
739 #define power_usart0_disable() (PRR0 |= (uint8_t)(1 << PRUSART0))
742 #if defined(__AVR_HAVE_PRR0_PRUSART1)
743 #define power_usart1_enable() (PRR0 &= (uint8_t)~(1 << PRUSART1))
744 #define power_usart1_disable() (PRR0 |= (uint8_t)(1 << PRUSART1))
747 #if defined(__AVR_HAVE_PRR0_PRVADC)
748 #define power_vadc_enable() (PRR0 &= (uint8_t)~(1 << PRVADC))
749 #define power_vadc_disable() (PRR0 |= (uint8_t)(1 << PRVADC))
752 #if defined(__AVR_HAVE_PRR0_PRVM)
753 #define power_voltage_monitor_enable() (PRR0 &= (uint8_t)~(1 << PRVM))
754 #define power_voltage_monitor_disable() (PRR0 |= (uint8_t)(1 << PRVM))
757 #if defined(__AVR_HAVE_PRR0_PRVRM)
758 #define power_vrm_enable() (PRR0 &= (uint8_t)~(1 << PRVRM))
759 #define power_vrm_disable() (PRR0 |= (uint8_t)(1 << PRVRM))
762 #if defined(__AVR_HAVE_PRR1_PRAES)
763 #define power_aes_enable() (PRR1 &= (uint8_t)~(1 << PRAES))
764 #define power_aes_disable() (PRR1 |= (uint8_t)(1 << PRAES))
767 #if defined(__AVR_HAVE_PRR1_PRCI)
768 #define power_cinterface_enable() (PRR1 &= (uint8_t)~(1 << PRCI))
769 #define power_cinterface_disable() (PRR1 |= (uint8_t)(1 << PRCI))
772 #if defined(__AVR_HAVE_PRR1_PRHSSPI)
773 #define power_hsspi_enable() (PRR1 &= (uint8_t)~(1 << PRHSSPI))
774 #define power_hsspi_disable() (PRR1 |= (uint8_t)(1 << PRHSSPI))
777 #if defined(__AVR_HAVE_PRR1_PRKB)
778 #define power_kb_enable() (PRR1 &= (uint8_t)~(1 << PRKB))
779 #define power_kb_disable() (PRR1 |= (uint8_t)(1 << PRKB))
782 #if defined(__AVR_HAVE_PRR1_PRLFR)
783 #define power_lfreceiver_enable() (PRR1 &= (uint8_t)~(1 << PRLFR))
784 #define power_lfreceiver_disable() (PRR1 |= (uint8_t)(1 << PRLFR))
787 #if defined(__AVR_HAVE_PRR1_PRSCI)
788 #define power_sci_enable() (PRR1 &= (uint8_t)~(1 << PRSCI))
789 #define power_sci_disable() (PRR1 |= (uint8_t)(1 << PRSCI))
792 #if defined(__AVR_HAVE_PRR1_PRT1)
793 #define power_timer1_enable() (PRR1 &= (uint8_t)~(1 << PRT1))
794 #define power_timer1_disable() (PRR1 |= (uint8_t)(1 << PRT1))
797 #if defined(__AVR_HAVE_PRR1_PRT2)
798 #define power_timer2_enable() (PRR1 &= (uint8_t)~(1 << PRT2))
799 #define power_timer2_disable() (PRR1 |= (uint8_t)(1 << PRT2))
802 #if defined(__AVR_HAVE_PRR1_PRT3)
803 #define power_timer3_enable() (PRR1 &= (uint8_t)~(1 << PRT3))
804 #define power_timer3_disable() (PRR1 |= (uint8_t)(1 << PRT3))
807 #if defined(__AVR_HAVE_PRR1_PRT4)
808 #define power_timer4_enable() (PRR1 &= (uint8_t)~(1 << PRT4))
809 #define power_timer4_disable() (PRR1 |= (uint8_t)(1 << PRT4))
812 #if defined(__AVR_HAVE_PRR1_PRT5)
813 #define power_timer5_enable() (PRR1 &= (uint8_t)~(1 << PRT5))
814 #define power_timer5_disable() (PRR1 |= (uint8_t)(1 << PRT5))
817 #if defined(__AVR_HAVE_PRR1_PRTIM3)
818 #define power_timer3_enable() (PRR1 &= (uint8_t)~(1 << PRTIM3))
819 #define power_timer3_disable() (PRR1 |= (uint8_t)(1 << PRTIM3))
822 #if defined(__AVR_HAVE_PRR1_PRTIM4)
823 #define power_timer4_enable() (PRR1 &= (uint8_t)~(1 << PRTIM4))
824 #define power_timer4_disable() (PRR1 |= (uint8_t)(1 << PRTIM4))
827 #if defined(__AVR_HAVE_PRR1_PRTIM5)
828 #define power_timer5_enable() (PRR1 &= (uint8_t)~(1 << PRTIM5))
829 #define power_timer5_disable() (PRR1 |= (uint8_t)(1 << PRTIM5))
832 #if defined(__AVR_HAVE_PRR1_PRTRX24)
833 #define power_transceiver_enable() (PRR1 &= (uint8_t)~(1 << PRTRX24))
834 #define power_transceiver_disable() (PRR1 |= (uint8_t)(1 << PRTRX24))
837 #if defined(__AVR_HAVE_PRR1_PRUSART1)
838 #define power_usart1_enable() (PRR1 &= (uint8_t)~(1 << PRUSART1))
839 #define power_usart1_disable() (PRR1 |= (uint8_t)(1 << PRUSART1))
842 #if defined(__AVR_HAVE_PRR1_PRUSART2)
843 #define power_usart2_enable() (PRR1 &= (uint8_t)~(1 << PRUSART2))
844 #define power_usart2_disable() (PRR1 |= (uint8_t)(1 << PRUSART2))
847 #if defined(__AVR_HAVE_PRR1_PRUSB)
848 #define power_usb_enable() (PRR1 &= (uint8_t)~(1 << PRUSB))
849 #define power_usb_disable() (PRR1 |= (uint8_t)(1 << PRUSB))
852 #if defined(__AVR_HAVE_PRR1_PRUSBH)
853 #define power_usbh_enable() (PRR1 &= (uint8_t)~(1 << PRUSBH))
854 #define power_usbh_disable() (PRR1 |= (uint8_t)(1 << PRUSBH))
857 #if defined(__AVR_HAVE_PRR2_PRDF)
858 #define power_data_fifo_enable() (PRR2 &= (uint8_t)~(1 << PRDF))
859 #define power_data_fifo_disable() (PRR2 |= (uint8_t)(1 << PRDF))
862 #if defined(__AVR_HAVE_PRR2_PRIDS)
863 #define power_id_scan_enable() (PRR2 &= (uint8_t)~(1 << PRIDS))
864 #define power_id_scan_disable() (PRR2 |= (uint8_t)(1 << PRIDS))
867 #if defined(__AVR_HAVE_PRR2_PRRAM0)
868 #define power_ram0_enable() (PRR2 &= (uint8_t)~(1 << PRRAM0))
869 #define power_ram0_disable() (PRR2 |= (uint8_t)(1 << PRRAM0))
872 #if defined(__AVR_HAVE_PRR2_PRRAM1)
873 #define power_ram1_enable() (PRR2 &= (uint8_t)~(1 << PRRAM1))
874 #define power_ram1_disable() (PRR2 |= (uint8_t)(1 << PRRAM1))
877 #if defined(__AVR_HAVE_PRR2_PRRAM2)
878 #define power_ram2_enable() (PRR2 &= (uint8_t)~(1 << PRRAM2))
879 #define power_ram2_disable() (PRR2 |= (uint8_t)(1 << PRRAM2))
882 #if defined(__AVR_HAVE_PRR2_PRRAM3)
883 #define power_ram3_enable() (PRR2 &= (uint8_t)~(1 << PRRAM3))
884 #define power_ram3_disable() (PRR2 |= (uint8_t)(1 << PRRAM3))
887 #if defined(__AVR_HAVE_PRR2_PRRS)
888 #define power_rssi_buffer_enable() (PRR2 &= (uint8_t)~(1 << PRRS))
889 #define power_rssi_buffer_disable() (PRR2 |= (uint8_t)(1 << PRRS))
892 #if defined(__AVR_HAVE_PRR2_PRSF)
893 #define power_preamble_rssi_fifo_enable() (PRR2 &= (uint8_t)~(1 << PRSF))
894 #define power_preamble_rssi_fifo_disable() (PRR2 |= (uint8_t)(1 << PRSF))
897 #if defined(__AVR_HAVE_PRR2_PRSSM)
898 #define power_sequencer_state_machine_enable() (PRR2 &= (uint8_t)~(1 << PRSSM))
899 #define power_sequencer_state_machine_disable() (PRR2 |= (uint8_t)(1 << PRSSM))
902 #if defined(__AVR_HAVE_PRR2_PRTM)
903 #define power_tx_modulator_enable() (PRR2 &= (uint8_t)~(1 << PRTM))
904 #define power_tx_modulator_disable() (PRR2 |= (uint8_t)(1 << PRTM))
907 #if defined(__AVR_HAVE_PRR2_PRXA)
908 #define power_rx_buffer_A_enable() (PRR2 &= (uint8_t)~(1 << PRXA))
909 #define power_rx_buffer_A_disable() (PRR2 |= (uint8_t)(1 << PRXA))
912 #if defined(__AVR_HAVE_PRR2_PRXB)
913 #define power_rx_buffer_B_enable() (PRR2 &= (uint8_t)~(1 << PRXB))
914 #define power_rx_buffer_B_disable() (PRR2 |= (uint8_t)(1 << PRXB))
917 #if defined(__AVR_HAVE_PRGEN_AES)
918 #define power_aes_enable() (PR_PRGEN &= (uint8_t)~(PR_AES_bm))
919 #define power_aes_disable() (PR_PRGEN |= (uint8_t)PR_AES_bm)
922 #if defined(__AVR_HAVE_PRGEN_DMA)
923 #define power_dma_enable() (PR_PRGEN &= (uint8_t)~(PR_DMA_bm))
924 #define power_dma_disable() (PR_PRGEN |= (uint8_t)PR_DMA_bm)
927 #if defined(__AVR_HAVE_PRGEN_EBI)
928 #define power_ebi_enable() (PR_PRGEN &= (uint8_t)~(PR_EBI_bm))
929 #define power_ebi_disable() (PR_PRGEN |= (uint8_t)PR_EBI_bm)
932 #if defined(__AVR_HAVE_PRGEN_EDMA)
933 #define power_edma_enable() (PR_PRGEN &= (uint8_t)~(PR_EDMA_bm))
934 #define power_edma_disable() (PR_PRGEN |= (uint8_t)PR_EDMA_bm)
937 #if defined(__AVR_HAVE_PRGEN_EVSYS)
938 #define power_evsys_enable() (PR_PRGEN &= (uint8_t)~(PR_EVSYS_bm))
939 #define power_evsys_disable() (PR_PRGEN |= (uint8_t)PR_EVSYS_bm)
942 #if defined(__AVR_HAVE_PRGEN_LCD)
943 #define power_lcd_enable() (PR_PRGEN &= (uint8_t)~(PR_LCD_bm))
944 #define power_lcd_disable() (PR_PRGEN |= (uint8_t)PR_LCD_bm)
947 #if defined(__AVR_HAVE_PRGEN_RTC)
948 #define power_rtc_enable() (PR_PRGEN &= (uint8_t)~(PR_RTC_bm))
949 #define power_rtc_disable() (PR_PRGEN |= (uint8_t)PR_RTC_bm)
952 #if defined(__AVR_HAVE_PRGEN_USB)
953 #define power_usb_enable() (PR_PRGEN &= (uint8_t)~(PR_USB_bm))
954 #define power_usb_disable() (PR_PRGEN &= (uint8_t)(PR_USB_bm))
957 #if defined(__AVR_HAVE_PRGEN_XCL)
958 #define power_xcl_enable() (PR_PRGEN &= (uint8_t)~(PR_XCL_bm))
959 #define power_xcl_disable() (PR_PRGEN |= (uint8_t)PR_XCL_bm)
962 #if defined(__AVR_HAVE_PRPA_AC)
963 #define power_aca_enable() (PR_PRPA &= (uint8_t)~(PR_AC_bm))
964 #define power_aca_disable() (PR_PRPA |= (uint8_t)PR_AC_bm)
967 #if defined(__AVR_HAVE_PRPA_ADC)
968 #define power_adca_enable() (PR_PRPA &= (uint8_t)~(PR_ADC_bm))
969 #define power_adca_disable() (PR_PRPA |= (uint8_t)PR_ADC_bm)
972 #if defined(__AVR_HAVE_PRPA_DAC)
973 #define power_daca_enable() (PR_PRPA &= (uint8_t)~(PR_DAC_bm))
974 #define power_daca_disable() (PR_PRPA |= (uint8_t)PR_DAC_bm)
977 #if defined(__AVR_HAVE_PRPB_AC)
978 #define power_acb_enable() (PR_PRPB &= (uint8_t)~(PR_AC_bm))
979 #define power_acb_disable() (PR_PRPB |= (uint8_t)PR_AC_bm)
982 #if defined(__AVR_HAVE_PRPB_ADC)
983 #define power_adcb_enable() (PR_PRPB &= (uint8_t)~(PR_ADC_bm))
984 #define power_adcb_disable() (PR_PRPB |= (uint8_t)PR_ADC_bm)
987 #if defined(__AVR_HAVE_PRPB_DAC)
988 #define power_dacb_enable() (PR_PRPB &= (uint8_t)~(PR_DAC_bm))
989 #define power_dacb_disable() (PR_PRPB |= (uint8_t)PR_DAC_bm)
992 #if defined(__AVR_HAVE_PRPC_HIRES)
993 #define power_hiresc_enable() (PR_PRPC &= (uint8_t)~(PR_HIRES_bm))
994 #define power_hiresc_disable() (PR_PRPC |= (uint8_t)PR_HIRES_bm)
997 #if defined(__AVR_HAVE_PRPC_SPI)
998 #define power_spic_enable() (PR_PRPC &= (uint8_t)~(PR_SPI_bm))
999 #define power_spic_disable() (PR_PRPC |= (uint8_t)PR_SPI_bm)
1002 #if defined(__AVR_HAVE_PRPC_TC0)
1003 #define power_tc0c_enable() (PR_PRPC &= (uint8_t)~(PR_TC0_bm))
1004 #define power_tc0c_disable() (PR_PRPC |= (uint8_t)PR_TC0_bm)
1007 #if defined(__AVR_HAVE_PRPC_TC1)
1008 #define power_tc1c_enable() (PR_PRPC &= (uint8_t)~(PR_TC1_bm))
1009 #define power_tc1c_disable() (PR_PRPC |= (uint8_t)PR_TC1_bm)
1012 #if defined(__AVR_HAVE_PRPC_TC4)
1013 #define power_tc4c_enable() (PR_PRPC &= (uint8_t)~(PR_TC4_bm))
1014 #define power_tc4c_disable() (PR_PRPC |= (uint8_t)PR_TC4_bm)
1017 #if defined(__AVR_HAVE_PRPC_TC5)
1018 #define power_tc5c_enable() (PR_PRPC &= (uint8_t)~(PR_TC5_bm))
1019 #define power_tc5c_disable() (PR_PRPC |= (uint8_t)PR_TC5_bm)
1022 #if defined(__AVR_HAVE_PRPC_TWI)
1023 #define power_twic_enable() (PR_PRPC &= (uint8_t)~(PR_TWI_bm))
1024 #define power_twic_disable() (PR_PRPC |= (uint8_t)PR_TWI_bm)
1027 #if defined(__AVR_HAVE_PRPC_USART0)
1028 #define power_usartc0_enable() (PR_PRPC &= (uint8_t)~(PR_USART0_bm))
1029 #define power_usartc0_disable() (PR_PRPC |= (uint8_t)PR_USART0_bm)
1032 #if defined(__AVR_HAVE_PRPC_USART1)
1033 #define power_usartc1_enable() (PR_PRPC &= (uint8_t)~(PR_USART1_bm))
1034 #define power_usartc1_disable() (PR_PRPC |= (uint8_t)PR_USART1_bm)
1037 #if defined(__AVR_HAVE_PRPD_HIRES)
1038 #define power_hiresd_enable() (PR_PRPD &= (uint8_t)~(PR_HIRES_bm))
1039 #define power_hiresd_disable() (PR_PRPD |= (uint8_t)PR_HIRES_bm)
1042 #if defined(__AVR_HAVE_PRPD_SPI)
1043 #define power_spid_enable() (PR_PRPD &= (uint8_t)~(PR_SPI_bm))
1044 #define power_spid_disable() (PR_PRPD |= (uint8_t)PR_SPI_bm)
1047 #if defined(__AVR_HAVE_PRPD_TC0)
1048 #define power_tc0d_enable() (PR_PRPD &= (uint8_t)~(PR_TC0_bm))
1049 #define power_tc0d_disable() (PR_PRPD |= (uint8_t)PR_TC0_bm)
1052 #if defined(__AVR_HAVE_PRPD_TC1)
1053 #define power_tc1d_enable() (PR_PRPD &= (uint8_t)~(PR_TC1_bm))
1054 #define power_tc1d_disable() (PR_PRPD |= (uint8_t)PR_TC1_bm)
1057 #if defined(__AVR_HAVE_PRPD_TC5)
1058 #define power_tc5d_enable() (PR_PRPD &= (uint8_t)~(PR_TC5_bm))
1059 #define power_tc5d_disable() (PR_PRPD |= (uint8_t)PR_TC5_bm)
1062 #if defined(__AVR_HAVE_PRPD_TWI)
1063 #define power_twid_enable() (PR_PRPD &= (uint8_t)~(PR_TWI_bm))
1064 #define power_twid_disable() (PR_PRPD |= (uint8_t)PR_TWI_bm)
1067 #if defined(__AVR_HAVE_PRPD_USART0)
1068 #define power_usartd0_enable() (PR_PRPD &= (uint8_t)~(PR_USART0_bm))
1069 #define power_usartd0_disable() (PR_PRPD |= (uint8_t)PR_USART0_bm)
1072 #if defined(__AVR_HAVE_PRPD_USART1)
1073 #define power_usartd1_enable() (PR_PRPD &= (uint8_t)~(PR_USART1_bm))
1074 #define power_usartd1_disable() (PR_PRPD |= (uint8_t)PR_USART1_bm)
1077 #if defined(__AVR_HAVE_PRPE_HIRES)
1078 #define power_hirese_enable() (PR_PRPE &= (uint8_t)~(PR_HIRES_bm))
1079 #define power_hirese_disable() (PR_PRPE |= (uint8_t)PR_HIRES_bm)
1082 #if defined(__AVR_HAVE_PRPE_SPI)
1083 #define power_spie_enable() (PR_PRPE &= (uint8_t)~(PR_SPI_bm))
1084 #define power_spie_disable() (PR_PRPE |= (uint8_t)PR_SPI_bm)
1087 #if defined(__AVR_HAVE_PRPE_TC0)
1088 #define power_tc0e_enable() (PR_PRPE &= (uint8_t)~(PR_TC0_bm))
1089 #define power_tc0e_disable() (PR_PRPE |= (uint8_t)PR_TC0_bm)
1092 #if defined(__AVR_HAVE_PRPE_TC1)
1093 #define power_tc1e_enable() (PR_PRPE &= (uint8_t)~(PR_TC1_bm))
1094 #define power_tc1e_disable() (PR_PRPE |= (uint8_t)PR_TC1_bm)
1097 #if defined(__AVR_HAVE_PRPE_TWI)
1098 #define power_twie_enable() (PR_PRPE &= (uint8_t)~(PR_TWI_bm))
1099 #define power_twie_disable() (PR_PRPE |= (uint8_t)PR_TWI_bm)
1102 #if defined(__AVR_HAVE_PRPE_USART0)
1103 #define power_usarte0_enable() (PR_PRPE &= (uint8_t)~(PR_USART0_bm))
1104 #define power_usarte0_disable() (PR_PRPE |= (uint8_t)PR_USART0_bm)
1107 #if defined(__AVR_HAVE_PRPE_USART1)
1108 #define power_usarte1_enable() (PR_PRPE &= (uint8_t)~(PR_USART1_bm))
1109 #define power_usarte1_disable() (PR_PRPE |= (uint8_t)PR_USART1_bm)
1112 #if defined(__AVR_HAVE_PRPF_HIRES)
1113 #define power_hiresf_enable() (PR_PRPF &= (uint8_t)~(PR_HIRES_bm))
1114 #define power_hiresf_disable() (PR_PRPF |= (uint8_t)PR_HIRES_bm)
1117 #if defined(__AVR_HAVE_PRPF_SPI)
1118 #define power_spif_enable() (PR_PRPF &= (uint8_t)~(PR_SPI_bm))
1119 #define power_spif_disable() (PR_PRPF |= (uint8_t)PR_SPI_bm)
1122 #if defined(__AVR_HAVE_PRPF_TC0)
1123 #define power_tc0f_enable() (PR_PRPF &= (uint8_t)~(PR_TC0_bm))
1124 #define power_tc0f_disable() (PR_PRPF |= (uint8_t)PR_TC0_bm)
1127 #if defined(__AVR_HAVE_PRPF_TC1)
1128 #define power_tc1f_enable() (PR_PRPF &= (uint8_t)~(PR_TC1_bm))
1129 #define power_tc1f_disable() (PR_PRPF |= (uint8_t)PR_TC1_bm)
1132 #if defined(__AVR_HAVE_PRPF_TWI)
1133 #define power_twif_enable() (PR_PRPF &= (uint8_t)~(PR_TWI_bm))
1134 #define power_twif_disable() (PR_PRPF |= (uint8_t)PR_TWI_bm)
1137 #if defined(__AVR_HAVE_PRPF_USART0)
1138 #define power_usartf0_enable() (PR_PRPF &= (uint8_t)~(PR_USART0_bm))
1139 #define power_usartf0_disable() (PR_PRPF |= (uint8_t)PR_USART0_bm)
1142 #if defined(__AVR_HAVE_PRPF_USART1)
1143 #define power_usartf1_enable() (PR_PRPF &= (uint8_t)~(PR_USART1_bm))
1144 #define power_usartf1_disable() (PR_PRPF |= (uint8_t)PR_USART1_bm)
1147 static __inline
void
1149 __power_all_enable()
1151 #ifdef __AVR_HAVE_PRR
1152 PRR &= (
uint8_t)~(__AVR_HAVE_PRR);
1155 #ifdef __AVR_HAVE_PRR0
1156 PRR0 &= (
uint8_t)~(__AVR_HAVE_PRR0);
1159 #ifdef __AVR_HAVE_PRR1
1160 PRR1 &= (
uint8_t)~(__AVR_HAVE_PRR1);
1163 #ifdef __AVR_HAVE_PRR2
1164 PRR2 &= (
uint8_t)~(__AVR_HAVE_PRR2);
1167 #ifdef __AVR_HAVE_PRGEN
1168 PR_PRGEN &= (
uint8_t)~(__AVR_HAVE_PRGEN);
1171 #ifdef __AVR_HAVE_PRPA
1172 PR_PRPA &= (
uint8_t)~(__AVR_HAVE_PRPA);
1175 #ifdef __AVR_HAVE_PRPB
1176 PR_PRPB &= (
uint8_t)~(__AVR_HAVE_PRPB);
1179 #ifdef __AVR_HAVE_PRPC
1180 PR_PRPC &= (
uint8_t)~(__AVR_HAVE_PRPC);
1183 #ifdef __AVR_HAVE_PRPD
1184 PR_PRPD &= (
uint8_t)~(__AVR_HAVE_PRPD);
1187 #ifdef __AVR_HAVE_PRPE
1188 PR_PRPE &= (
uint8_t)~(__AVR_HAVE_PRPE);
1191 #ifdef __AVR_HAVE_PRPF
1192 PR_PRPF &= (
uint8_t)~(__AVR_HAVE_PRPF);
1196 static __inline
void
1198 __power_all_disable()
1200 #ifdef __AVR_HAVE_PRR
1201 PRR |= (
uint8_t)(__AVR_HAVE_PRR);
1204 #ifdef __AVR_HAVE_PRR0
1205 PRR0 |= (
uint8_t)(__AVR_HAVE_PRR0);
1208 #ifdef __AVR_HAVE_PRR1
1209 PRR1 |= (
uint8_t)(__AVR_HAVE_PRR1);
1212 #ifdef __AVR_HAVE_PRR2
1213 PRR2 |= (
uint8_t)(__AVR_HAVE_PRR2);
1216 #ifdef __AVR_HAVE_PRGEN
1217 PR_PRGEN |= (
uint8_t)(__AVR_HAVE_PRGEN);
1220 #ifdef __AVR_HAVE_PRPA
1221 PR_PRPA |= (
uint8_t)(__AVR_HAVE_PRPA);
1224 #ifdef __AVR_HAVE_PRPB
1225 PR_PRPB |= (
uint8_t)(__AVR_HAVE_PRPB);
1228 #ifdef __AVR_HAVE_PRPC
1229 PR_PRPC |= (
uint8_t)(__AVR_HAVE_PRPC);
1232 #ifdef __AVR_HAVE_PRPD
1233 PR_PRPD |= (
uint8_t)(__AVR_HAVE_PRPD);
1236 #ifdef __AVR_HAVE_PRPE
1237 PR_PRPE |= (
uint8_t)(__AVR_HAVE_PRPE);
1240 #ifdef __AVR_HAVE_PRPF
1241 PR_PRPF |= (
uint8_t)(__AVR_HAVE_PRPF);
1246 #ifndef power_all_enable
1247 #define power_all_enable() __power_all_enable()
1250 #ifndef power_all_disable
1251 #define power_all_disable() __power_all_disable()
1256 #if defined(__AVR_AT90CAN32__) \
1257 || defined(__AVR_AT90CAN64__) \
1258 || defined(__AVR_AT90CAN128__) \
1259 || defined(__AVR_AT90PWM1__) \
1260 || defined(__AVR_AT90PWM2__) \
1261 || defined(__AVR_AT90PWM2B__) \
1262 || defined(__AVR_AT90PWM3__) \
1263 || defined(__AVR_AT90PWM3B__) \
1264 || defined(__AVR_AT90PWM81__) \
1265 || defined(__AVR_AT90PWM161__) \
1266 || defined(__AVR_AT90PWM216__) \
1267 || defined(__AVR_AT90PWM316__) \
1268 || defined(__AVR_AT90SCR100__) \
1269 || defined(__AVR_AT90USB646__) \
1270 || defined(__AVR_AT90USB647__) \
1271 || defined(__AVR_AT90USB82__) \
1272 || defined(__AVR_AT90USB1286__) \
1273 || defined(__AVR_AT90USB1287__) \
1274 || defined(__AVR_AT90USB162__) \
1275 || defined(__AVR_ATA5505__) \
1276 || defined(__AVR_ATA5272__) \
1277 || defined(__AVR_ATmega1280__) \
1278 || defined(__AVR_ATmega1281__) \
1279 || defined(__AVR_ATmega1284__) \
1280 || defined(__AVR_ATmega128RFA1__) \
1281 || defined(__AVR_ATmega1284RFR2__) \
1282 || defined(__AVR_ATmega128RFR2__) \
1283 || defined(__AVR_ATmega1284P__) \
1284 || defined(__AVR_ATmega162__) \
1285 || defined(__AVR_ATmega164A__) \
1286 || defined(__AVR_ATmega164P__) \
1287 || defined(__AVR_ATmega164PA__) \
1288 || defined(__AVR_ATmega165__) \
1289 || defined(__AVR_ATmega165A__) \
1290 || defined(__AVR_ATmega165P__) \
1291 || defined(__AVR_ATmega165PA__) \
1292 || defined(__AVR_ATmega168__) \
1293 || defined(__AVR_ATmega168P__) \
1294 || defined(__AVR_ATmega168PA__) \
1295 || defined(__AVR_ATmega169__) \
1296 || defined(__AVR_ATmega169A__) \
1297 || defined(__AVR_ATmega169P__) \
1298 || defined(__AVR_ATmega169PA__) \
1299 || defined(__AVR_ATmega16U4__) \
1300 || defined(__AVR_ATmega2560__) \
1301 || defined(__AVR_ATmega2561__) \
1302 || defined(__AVR_ATmega2564RFR2__) \
1303 || defined(__AVR_ATmega256RFR2__) \
1304 || defined(__AVR_ATmega324A__) \
1305 || defined(__AVR_ATmega324P__) \
1306 || defined(__AVR_ATmega325__) \
1307 || defined(__AVR_ATmega325A__) \
1308 || defined(__AVR_ATmega325PA__) \
1309 || defined(__AVR_ATmega3250__) \
1310 || defined(__AVR_ATmega3250A__) \
1311 || defined(__AVR_ATmega3250PA__) \
1312 || defined(__AVR_ATmega328__) \
1313 || defined(__AVR_ATmega328P__) \
1314 || defined(__AVR_ATmega329__) \
1315 || defined(__AVR_ATmega329A__) \
1316 || defined(__AVR_ATmega329P__) \
1317 || defined(__AVR_ATmega329PA__) \
1318 || defined(__AVR_ATmega3290__) \
1319 || defined(__AVR_ATmega3290A__) \
1320 || defined(__AVR_ATmega3290PA__) \
1321 || defined(__AVR_ATmega32C1__) \
1322 || defined(__AVR_ATmega32M1__) \
1323 || defined(__AVR_ATmega32U2__) \
1324 || defined(__AVR_ATmega32U4__) \
1325 || defined(__AVR_ATmega32U6__) \
1326 || defined(__AVR_ATmega48__) \
1327 || defined(__AVR_ATmega48A__) \
1328 || defined(__AVR_ATmega48PA__) \
1329 || defined(__AVR_ATmega48P__) \
1330 || defined(__AVR_ATmega640__) \
1331 || defined(__AVR_ATmega649P__) \
1332 || defined(__AVR_ATmega644__) \
1333 || defined(__AVR_ATmega644A__) \
1334 || defined(__AVR_ATmega644P__) \
1335 || defined(__AVR_ATmega644PA__) \
1336 || defined(__AVR_ATmega645__) \
1337 || defined(__AVR_ATmega645A__) \
1338 || defined(__AVR_ATmega645P__) \
1339 || defined(__AVR_ATmega6450__) \
1340 || defined(__AVR_ATmega6450A__) \
1341 || defined(__AVR_ATmega6450P__) \
1342 || defined(__AVR_ATmega649__) \
1343 || defined(__AVR_ATmega649A__) \
1344 || defined(__AVR_ATmega6490__) \
1345 || defined(__AVR_ATmega6490A__) \
1346 || defined(__AVR_ATmega6490P__) \
1347 || defined(__AVR_ATmega644RFR2__) \
1348 || defined(__AVR_ATmega64RFR2__) \
1349 || defined(__AVR_ATmega88__) \
1350 || defined(__AVR_ATmega88P__) \
1351 || defined(__AVR_ATmega8U2__) \
1352 || defined(__AVR_ATmega16U2__) \
1353 || defined(__AVR_ATmega32U2__) \
1354 || defined(__AVR_ATtiny48__) \
1355 || defined(__AVR_ATtiny167__) \
1356 || defined(__DOXYGEN__)
1424 #if defined(__AVR_ATmega128RFA1__) \
1425 || defined(__AVR_ATmega2564RFR2__) \
1426 || defined(__AVR_ATmega1284RFR2__) \
1427 || defined(__AVR_ATmega644RFR2__) \
1428 || defined(__AVR_ATmega256RFR2__) \
1429 || defined(__AVR_ATmega128RFR2__) \
1430 || defined(__AVR_ATmega64RFR2__)
1431 , clock_div_1_rc = 15
1454 __asm__ __volatile__ (
1455 "in __tmp_reg__,__SREG__" "\n\t"
1459 "out __SREG__, __tmp_reg__"
1462 "M" (_SFR_MEM_ADDR(CLKPR)),
1476 #define clock_prescale_get() (clock_div_t)(CLKPR & (uint8_t)((1<<CLKPS0)|(1<<CLKPS1)|(1<<CLKPS2)|(1<<CLKPS3)))
1478 #elif defined(__AVR_ATmega16HVB__) \
1479 || defined(__AVR_ATmega16HVBREVB__) \
1480 || defined(__AVR_ATmega32HVB__) \
1481 || defined(__AVR_ATmega32HVBREVB__)
1496 __asm__ __volatile__ (
1497 "in __tmp_reg__,__SREG__" "\n\t"
1501 "out __SREG__, __tmp_reg__"
1504 "M" (_SFR_MEM_ADDR(CLKPR)),
1509 #define clock_prescale_get() (clock_div_t)(CLKPR & (uint8_t)((1<<CLKPS0)|(1<<CLKPS1)))
1511 #elif defined(__AVR_ATA5790__) \
1512 || defined (__AVR_ATA5795__)
1526 static __inline__
void system_clock_prescale_set(clock_div_t)
__attribute__((__always_inline__));
1528 void system_clock_prescale_set(clock_div_t __x)
1531 __asm__ __volatile__ (
1532 "in __tmp_reg__,__SREG__" "\n\t"
1536 "out __SREG__, __tmp_reg__"
1539 "I" (_SFR_IO_ADDR(CLKPR)),
1544 #define system_clock_prescale_get() (clock_div_t)(CLKPR & (uint8_t)((1<<CLKPS0)|(1<<CLKPS1)|(1<<CLKPS2)))
1548 timer_clock_div_reset = 0,
1549 timer_clock_div_1 = 1,
1550 timer_clock_div_2 = 2,
1551 timer_clock_div_4 = 3,
1552 timer_clock_div_8 = 4,
1553 timer_clock_div_16 = 5,
1554 timer_clock_div_32 = 6,
1555 timer_clock_div_64 = 7
1556 } timer_clock_div_t;
1558 static __inline__
void timer_clock_prescale_set(timer_clock_div_t)
__attribute__((__always_inline__));
1560 void timer_clock_prescale_set(timer_clock_div_t __x)
1563 __asm__ __volatile__ (
1564 "in __tmp_reg__,__SREG__" "\n\t"
1566 "in %[temp],%[clkpr]" "\n\t"
1567 "out %[clkpr],%[enable]" "\n\t"
1568 "andi %[temp],%[not_CLTPS]" "\n\t"
1569 "or %[temp], %[set_value]" "\n\t"
1570 "out %[clkpr],%[temp]" "\n\t"
1572 "out __SREG__,__tmp_reg__" "\n\t"
1575 [clkpr]
"I" (_SFR_IO_ADDR(CLKPR)),
1576 [enable]
"r" (
_BV(CLKPCE)),
1577 [not_CLTPS]
"M" (0xFF & (~ ((1 << CLTPS2) | (1 << CLTPS1) | (1 << CLTPS0)))),
1578 [set_value]
"r" ((__x & 7) << 3)
1582 #define timer_clock_prescale_get() (timer_clock_div_t)(CLKPR & (uint8_t)((1<<CLTPS0)|(1<<CLTPS1)|(1<<CLTPS2)))
1584 #elif defined(__AVR_ATA6285__) \
1585 || defined(__AVR_ATA6286__)
1599 static __inline__
void system_clock_prescale_set(clock_div_t)
__attribute__((__always_inline__));
1601 void system_clock_prescale_set(clock_div_t __x)
1604 __asm__ __volatile__ (
1605 "in __tmp_reg__,__SREG__" "\n\t"
1607 "in %[temp],%[clpr]" "\n\t"
1608 "out %[clpr],%[enable]" "\n\t"
1609 "andi %[temp],%[not_CLKPS]" "\n\t"
1610 "or %[temp], %[set_value]" "\n\t"
1611 "out %[clpr],%[temp]" "\n\t"
1613 "out __SREG__,__tmp_reg__" "\n\t"
1616 [clpr]
"I" (_SFR_IO_ADDR(CLKPR)),
1617 [enable]
"r" _BV(CLPCE),
1618 [not_CLKPS]
"M" (0xFF & (~ ((1 << CLKPS2) | (1 << CLKPS1) | (1 << CLKPS0)))),
1619 [set_value]
"r" (__x & 7)
1623 #define system_clock_prescale_get() (clock_div_t)(CLKPR & (uint8_t)((1<<CLKPS0)|(1<<CLKPS1)|(1<<CLKPS2)))
1627 timer_clock_div_reset = 0,
1628 timer_clock_div_1 = 1,
1629 timer_clock_div_2 = 2,
1630 timer_clock_div_4 = 3,
1631 timer_clock_div_8 = 4,
1632 timer_clock_div_16 = 5,
1633 timer_clock_div_32 = 6,
1634 timer_clock_div_64 = 7
1635 } timer_clock_div_t;
1637 static __inline__
void timer_clock_prescale_set(timer_clock_div_t)
__attribute__((__always_inline__));
1639 void timer_clock_prescale_set(timer_clock_div_t __x)
1642 __asm__ __volatile__ (
1643 "in __tmp_reg__,__SREG__" "\n\t"
1645 "in %[temp],%[clpr]" "\n\t"
1646 "out %[clpr],%[enable]" "\n\t"
1647 "andi %[temp],%[not_CLTPS]" "\n\t"
1648 "or %[temp], %[set_value]" "\n\t"
1649 "out %[clpr],%[temp]" "\n\t"
1651 "out __SREG__,__tmp_reg__" "\n\t"
1654 [clpr]
"I" (_SFR_IO_ADDR(CLKPR)),
1655 [enable]
"r" (
_BV(CLPCE)),
1656 [not_CLTPS]
"M" (0xFF & (~ ((1 << CLTPS2) | (1 << CLTPS1) | (1 << CLTPS0)))),
1657 [set_value]
"r" ((__x & 7) << 3)
1661 #define timer_clock_prescale_get() (timer_clock_div_t)(CLKPR & (uint8_t)((1<<CLTPS0)|(1<<CLTPS1)|(1<<CLTPS2)))
1663 #elif defined(__AVR_ATtiny24__) \
1664 || defined(__AVR_ATtiny24A__) \
1665 || defined(__AVR_ATtiny44__) \
1666 || defined(__AVR_ATtiny44A__) \
1667 || defined(__AVR_ATtiny84__) \
1668 || defined(__AVR_ATtiny84A__) \
1669 || defined(__AVR_ATtiny25__) \
1670 || defined(__AVR_ATtiny45__) \
1671 || defined(__AVR_ATtiny85__) \
1672 || defined(__AVR_ATtiny261A__) \
1673 || defined(__AVR_ATtiny261__) \
1674 || defined(__AVR_ATtiny461__) \
1675 || defined(__AVR_ATtiny461A__) \
1676 || defined(__AVR_ATtiny861__) \
1677 || defined(__AVR_ATtiny861A__) \
1678 || defined(__AVR_ATtiny2313__) \
1679 || defined(__AVR_ATtiny2313A__) \
1680 || defined(__AVR_ATtiny4313__) \
1681 || defined(__AVR_ATtiny13__) \
1682 || defined(__AVR_ATtiny13A__) \
1683 || defined(__AVR_ATtiny43U__) \
1703 __asm__ __volatile__ (
1704 "in __tmp_reg__,__SREG__" "\n\t"
1708 "out __SREG__, __tmp_reg__"
1711 "I" (_SFR_IO_ADDR(CLKPR)),
1717 #define clock_prescale_get() (clock_div_t)(CLKPR & (uint8_t)((1<<CLKPS0)|(1<<CLKPS1)|(1<<CLKPS2)|(1<<CLKPS3)))
1719 #elif defined(__AVR_ATmega64__) \
1720 || defined(__AVR_ATmega103__) \
1721 || defined(__AVR_ATmega128__)
1740 if((__x <= 0) || (__x > 129))
1757 __asm__ __volatile__ (
1758 "in __tmp_reg__,__SREG__" "\n\t"
1760 "out %1, __zero_reg__" "\n\t"
1769 "cpi %0, 0x01" "\n\t"
1771 "ldi %2, 0x81" "\n\t"
1773 "ori %2, 0x80" "\n\t"
1783 "L_%=: " "out __SREG__, __tmp_reg__"
1786 "I" (_SFR_IO_ADDR(XDIV)),
1802 return (clock_div_t)(129 - (XDIV & 0x7F));
1806 #elif defined(__AVR_ATtiny4__) \
1807 || defined(__AVR_ATtiny5__) \
1808 || defined(__AVR_ATtiny9__) \
1809 || defined(__AVR_ATtiny10__) \
1810 || defined(__AVR_ATtiny20__) \
1811 || defined(__AVR_ATtiny40__) \
1831 __asm__ __volatile__ (
1832 "in __tmp_reg__,__SREG__" "\n\t"
1836 "out __SREG__, __tmp_reg__"
1839 "I" (_SFR_IO_ADDR(CCP)),
1840 "I" (_SFR_IO_ADDR(CLKPSR)),
1845 #define clock_prescale_get() (clock_div_t)(CLKPSR & (uint8_t)((1<<CLKPS0)|(1<<CLKPS1)|(1<<CLKPS2)|(1<<CLKPS3)))
#define clock_prescale_get()
Definition: power.h:1476
static __inline void __attribute__((__always_inline__)) __power_all_enable()
Definition: power.h:1148
#define bit_is_clear(sfr, bit)
Definition: sfr_defs.h:245
unsigned char uint8_t
Definition: stdint.h:83
void clock_prescale_set(clock_div_t __x)
Definition: power.h:1451
#define _BV(bit)
Definition: sfr_defs.h:208