• 大小: 1.31MB
    文件类型: .zip
    金币: 2
    下载: 0 次
    发布日期: 2024-02-06
  • 语言: 其他
  • 标签:

资源简介

Lora驱动程序,可直接实现两个Lora模组的通讯。系统编写使用STM8单片机。

资源截图

代码片段和文件信息

/**************************************************************************************
*   - Project     :    HSD92                                                         *
*   - Version     :    1.00                                                           *
*   - Target MCU  :    STM8S                                                          *
*   - Used tools  :    IAR                                                            *
*   - Author      :    heaigang                                                       *   
*   - date        :    2017/4/23 17:14:43                                             *
**************************************************************************************/
#include  /*  头文件 */
#include “PLM-1.h“
#include “sx1278.h“

//#include 

unsigned char tx_flg;
unsigned char channel;


unsigned char  rd_flg;
unsigned char  start_flg;
//unsigned char   frequency_adjust;
unsigned char   power_value;
unsigned char   base_freq;

unsigned char   Bck_Rdata;
unsigned char   Seri_Have;

unsigned char   RF_SEND;
unsigned char   RS_SEND;
unsigned char   Ddata;
unsigned char   RSbaud;
unsigned char   RFbaud;
unsigned char   Currentc;      /*Current Channel */

unsigned char   watch_flg;
unsigned char   SIOWriteCounterSIOReadCounter;
unsigned char   RFReadCounterRFWriteCounter;
unsigned char   SIOBuffer[SIOBufMaxNum];  /*RS232 Receive buffer */ 
//unsigned char   RFBuffer[RFBufMaxNum];

unsigned char   SendBitCnt;  /*RF 8 bit Send Counter*/
unsigned char   Precode;     /* Preamble code */

unsigned char   EndCode;

//unsigned char   timer0_over;
unsigned char   pass_time;
unsigned char   cmd_ok;

//unsigned char  base_ADJ_flg; 

unsigned char  time_flg;

unsigned char  auto_flgbak_flg;

unsigned char  key_flg;

const unsigned char UCSRC_VALUE[3]={0x060x360x26};//UCSR0C  N O E
//const unsigned int  BPS_UBRR[8]={960024004800960019200384005760015200};

const unsigned char BRR2_VALUE[8]={BRR2_1200BRR2_2400BRR2_4800BRR2_9600BRR2_19200BRR2_38400BRR2_57600BRR2_115200};
const unsigned char BRR1_VALUE[8]={BRR1_1200BRR1_2400BRR1_4800BRR1_9600BRR1_19200BRR1_38400BRR1_57600BRR1_115200};


unsigned char  str[21] = {‘T‘ ‘h‘ ‘e‘ ‘ ‘ ‘r‘ ‘a‘ ‘w‘‘ ‘ ‘s‘ ‘t‘ ‘r‘ ‘e‘ ‘a‘ ‘m‘‘ ‘ ‘H‘ ‘S‘ ‘D‘ ‘1‘ ‘1‘ ‘L‘};



#define byte unsigned char 

extern unsigned char rx_flg;
int ss;
//extern UINT8 RfReadDataBuf[16];
extern void Init_RfRx (void);
//extern void si446x_ChangeToRxMode(void);
//extern void si446x_start_tx( void );
extern void spiWrite(unsigned char  addrunsigned char  val);
//extern void FSK_RX_Config(void);
extern unsigned char  spiRead(unsigned char  addr);
extern void LowReset(void);

extern void SendMessage(byte *p byte len);

extern  byte GetMessage(byte *pbyte len);
extern void LORA_RxInit(void);
extern void LORA_TxInit(void);

extern void Enter_Lora_mode(void);
/******************

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-09-11 15:07  HSD92例程\
     目录           0  2018-09-11 15:07  HSD92例程\BACKUP\
     文件        2051  2013-12-03 16:20  HSD92例程\BACKUP\cmdhdl._c
     文件       11254  2014-09-20 23:06  HSD92例程\Backup (2) of Test1_GPIO.ewd
     文件       42347  2017-04-24 16:53  HSD92例程\Backup (2) of Test1_GPIO.ewp
     文件       11254  2014-09-20 23:06  HSD92例程\Backup of Test1_GPIO.ewd
     文件       41811  2014-09-20 23:06  HSD92例程\Backup of Test1_GPIO.ewp
     目录           0  2018-09-11 15:07  HSD92例程\Debug\
     目录           0  2018-09-11 15:07  HSD92例程\Debug\Exe\
     文件        7815  2017-11-22 14:21  HSD92例程\Debug\Exe\Test1_GPIO.hex
     文件       66880  2017-11-22 14:21  HSD92例程\Debug\Exe\Test1_GPIO.out
     目录           0  2018-09-11 15:07  HSD92例程\Debug\List\
     文件       15023  2017-05-12 10:16  HSD92例程\Debug\List\HSD11.lst
     文件       15023  2017-05-12 08:44  HSD92例程\Debug\List\RFM96.lst
     文件       10257  2017-11-22 14:21  HSD92例程\Debug\List\SPI_HSD11.lst
     文件       20130  2017-11-22 14:21  HSD92例程\Debug\List\SX1278.lst
     文件       16918  2017-05-09 23:32  HSD92例程\Debug\List\SYNCComm.lst
     文件       21266  2017-11-22 14:21  HSD92例程\Debug\List\Test1_GPIO.map
     文件        4805  2017-06-03 16:35  HSD92例程\Debug\List\eeprom.lst
     文件        3891  2017-04-19 17:14  HSD92例程\Debug\List\main.lst
     文件       26573  2017-11-22 14:21  HSD92例程\Debug\List\plm-1.lst
     目录           0  2018-09-11 15:07  HSD92例程\Debug\Obj\
     文件       23462  2017-05-12 10:16  HSD92例程\Debug\Obj\HSD11.o
     文件       11371  2017-05-12 10:16  HSD92例程\Debug\Obj\HSD11.pbi.cout
     文件       23462  2017-05-12 08:44  HSD92例程\Debug\Obj\RFM96.o
     文件       11371  2017-05-12 08:44  HSD92例程\Debug\Obj\RFM96.pbi.cout
     文件       11343  2017-08-30 16:46  HSD92例程\Debug\Obj\RfRx.pbi.cout
     文件       19871  2017-11-22 14:21  HSD92例程\Debug\Obj\SPI_HSD11.o
     文件      212967  2017-11-22 14:21  HSD92例程\Debug\Obj\SPI_HSD11.pbi
     文件       11344  2017-11-22 14:21  HSD92例程\Debug\Obj\SPI_HSD11.pbi.cout
     文件       11377  2017-05-12 07:59  HSD92例程\Debug\Obj\SPI_RFM96.pbi.cout
............此处省略73个文件信息

评论

共有 条评论