NewAskSin
 All Classes Files Functions Variables Groups Pages
HAL_atmega32U4.h
1 #define power_serial_enable() power_usb_enable(); pinOutput(DDRB, PINB0); // pin output, otherwise USB will not work
2 #define UCSR UCSR1B
3 #define RXEN RXEN1
4 
5 //- cc1100 hardware definitions ---------------------------------------------------------------------------------------------
6 #define SPI_PORT PORTB // SPI port definition
7 #define SPI_DDR DDRB
8 #define SPI_MISO PORTB3
9 #define SPI_MOSI PORTB2
10 #define SPI_SCLK PORTB1
11 //- -------------------------------------------------------------------------------------------------------------------------
12 
13 
14 //- power management definitions --------------------------------------------------------------------------------------------
15 #define backupPwrRegs() uint8_t xPrr0 = PRR0; uint8_t xPrr1 = PRR1; PRR0 = PRR1= 0xFF;
16 #define recoverPwrRegs() PRR0 = xPrr0; PRR1 = xPrr1;
17 #define offBrownOut() //MCUCR = (1<<BODS)|(1<<BODSE); MCUCR = (1<<BODS);
18 //- -------------------------------------------------------------------------------------------------------------------------
19 
20 
21 //- adc definitions ---------------------------------------------------------------------------------------------------------
22 #define AVR_BANDGAP_VOLTAGE 1100UL // band gap reference for Atmega328p