//#define F_CPU 1000000UL // Frequenz des Quarzes, ohne Quarz standardmäßig 1MHz #include #include #include #include #include #include #include "nrf24l01.h" #include "nrf24l01_definitions.h" #include "uart_debug.h" //#define LED_DDR DDRB //DDRA, DDRB... //#define LED_PORT PORTB //PORTA, PORTB... //#define LED_PORTPIN PB0 //PA0, PA1..., PB0, PB1..., ... //#define time_off 8 /* SPI: */ #define SPI_DDR DDRB #define SPI_SCK_PIN PB1 #define SPI_MOSI_PIN PB2 #define SPI_MISO_PIN PB3 /* NRF24L01 */ /* * CS: pin 9 * CE: pin 8 * IRQ: pin 7 */ char bool_case = 0; int timer = 0; int timer_max = 0; void Initialize_SPI(void); int main (void) { char debugString[50] = ""; // uint8_t testRegisterContent = 0x0A; // uint8_t registerContent[5]; // char registerContentString[30]; // uint8_t lengthRead; /* Set baud rate */ Initialize_UART(51); sprintf(debugString, "%s\r\n", "Program start"); Print_Debug_String(debugString); /* Initialize the SPI */ Initialize_SPI(); /* Initialize the nrf24l01 */ Initialize_NRF24L01(); // The NRF24L01 is now in the mode Standby-I. /* Configure the transmission parameters (Enhanced ShockBurst)*/ Configure_Transmission(); // sprintf(debugString, "%s\r\n", "program end"); // Print_Debug_String(debugString); while(1) { Send_Test_Message(); _delay_ms(1000); } } void Initialize_SPI(void) { /* Set MOSI and SCK output, all others input */ SPI_DDR = (1<