/* This project is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Multiprotocol is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Multiprotocol. If not, see . */ #if defined(ASSAN_NRF24L01_INO) #include "iface_nrf24l01.h" #define ASSAN_PACKET_SIZE 20 #define ASSAN_RF_BIND_CHANNEL 0x03 #define ASSAN_ADDRESS_LENGTH 4 enum { ASSAN_BIND0=0, ASSAN_BIND1, ASSAN_BIND2, ASSAN_DATA0, ASSAN_DATA1, ASSAN_DATA2, ASSAN_DATA3, ASSAN_DATA4, ASSAN_DATA5 }; void ASSAN_RF_init() { NRF24L01_Initialize(); //Specifics to ASSAN NRF24L01_WriteReg(NRF24L01_03_SETUP_AW, 0x02); // 4 bytes rx/tx address NRF24L01_WriteRegisterMulti(NRF24L01_10_TX_ADDR, (uint8_t *)"\x80\x80\x80\xB8", ASSAN_ADDRESS_LENGTH); // Bind address NRF24L01_WriteRegisterMulti(NRF24L01_0A_RX_ADDR_P0, (uint8_t *)"\x80\x80\x80\xB8", ASSAN_ADDRESS_LENGTH); // Bind address NRF24L01_WriteReg(NRF24L01_11_RX_PW_P0, ASSAN_PACKET_SIZE); } void ASSAN_send_packet() { for(uint8_t i=0;i<8;i++) { uint16_t val=Channel_data[i]; val=((val<<2)+val)+(860<<3); // PPM value <<3 packet[2*i]=val>>8; packet[2*i+1]=val; } for(uint8_t i=0;i118) || (freq2