/***************************************************************************** Prototype : SX1276Init Description : none Input : void Output : None Return Value : Date : 2014/3/15 Author : Barry *****************************************************************************/ void SX1276Init( void ) { /* Initialize FSK and LoRa registers structure */ /* 这是一个很好的初始化结构体的技巧,把数组名强制转化为指向结构体的指针 */ #if defined(SX1276_FSK) SX1276 = ( tSX1276* )SX1276Regs; #endif #if defined(SX1276_LORA) SX1276LR = ( tSX1276LR* )SX1276Regs; #endif SX1276Reset( ); /* in order to compatible FSK,change LORA to bool variable */ if (LORA) { #if defined(SX1276_LORA) LoRaOn = true; LoRaOnState = false; SX1276SetLoRaOn( LoRaOn ); /* Initialize LoRa modem */ SX1276LoRaInit(); #endif } else { #if defined(SX1276_FSK) LoRaOn = false; LoRaOnState = true; SX1276SetLoRaOn( LoRaOn ); /* Initialize FSK modem */ SX1276FskInit( ); #endif } }
void SX1276Init( void ) { // Initialize FSK and LoRa registers structure SX1276 = ( tSX1276* )SX1276Regs; SX1276LR = ( tSX1276LR* )SX1276Regs; SX1276InitIo( ); SX1276Reset( ); // REMARK: After radio reset the default modem is FSK #if ( LORA == 0 ) LoRaOn = false; SX1276SetLoRaOn( LoRaOn ); // Initialize FSK modem SX1276FskInit( ); #else LoRaOn = true; SX1276SetLoRaOn( LoRaOn ); // Initialize LoRa modem SX1276LoRaInit( ); #endif }
void SX1276Init( void ) { SX1276InitIo( ); SX1276Reset( ); SX1276SetLoRaOn(); SX1276LoRaInit( ); }
void SX1276Init( void ) { SX1276InitIo( ); SX1276Reset( ); static uint8_t temp=0; SX1276Read( REG_LR_VERSION, &temp ); //SX1276Write( REG_LR_OPMODE, 0x09 ); SX1276SetLoRaOn(); // Initialize LoRa modem SX1276LoRaInit( ); }
void Continous_wave() { /* / _____) _ | | ( (____ _____ ____ _| |_ _____ ____| |__ \____ \| ___ | (_ _) ___ |/ ___) _ \ _____) ) ____| | | || |_| ____( (___| | | | (______/|_____)_|_|_| \__)_____)\____)_| |_| ( C )2014 Semtech Description: Tx Continuous Wave implementation License: Revised BSD License, see LICENSE.TXT file include in the project Maintainers: Miguel Luis, Gregory Cristian and Nicolas Huguenin */ //#include "sx1276-hal.h" /* Set this flag to '1' to test the HF max output power or '0' to the the LF max output power */ /** * Main application entry point. */ uint8_t TxOuputPower = 0; /**********************************************/ /* WARNING */ /* The below settings can damage the chipset */ /* if wrongly used. DO NOT CHANGE THE VALUES! */ /* */ /**********************************************/ // SX1276MB1MAS // debug("\r\n TEST_HF_OUTPUT on SX1276MB1MAS: 14 dBm at 868 MHz \r\n" ); SX1276LoRaSetRFFrequency( 869525000,&SX1276LR ); // TxOuputPower = 14; SX1276Write( 0x01, 0x88 ); SX1276Write( 0x3D, 0xA1 ); SX1276Write( 0x36, 0x01 ); SX1276Write( 0x1e, 0x08 ); //LORA SX1276SetLoRaOn(); SX1276LoRaInit(); SX1276LoRaSetOpMode(RFLR_OPMODE_TRANSMITTER); // Radio.SetTxConfig( MODEM_LORA, TxOuputPower, 0, LORA_BANDWIDTH, // LORA_SPREADING_FACTOR, LORA_CODINGRATE, // LORA_PREAMBLE_LENGTH, LORA_FIX_LENGTH_PAYLOAD_ON, // LORA_CRC_ENABLED, LORA_FHSS_ENABLED, LORA_NB_SYMB_HOP, // LORA_IQ_INVERSION_ON, 3000000 ); // Sets the radio in Tx mode // Radio.Send( NULL, 0 ); // // debug( "Start main loop: \r\n" ); // // Blink LEDs just to show some activity // while( 1 ) // { // debug( "Continuous Wave activated... \r\n" ); // wait_ms( 200 ); // } }