找回密码
 注册

QQ登录

只需一步,快速开始

搜索

STM8S003P控制2.4G芯片LT8900无线发射通讯程序

[复制链接]
路漫漫 发表于 2020-6-18 00:50:08 | 显示全部楼层 |阅读模式
完整源码 stm8_lt8900_IAR.rar (487.72 KB, 售价: 1 E币)

部分源码:
  1. void main()
  2. {
  3.     SysClkInit();
  4.     asm("sim");
  5.     SpiInit();
  6.     RfInit();
  7.     UartInit(0x03, 0x00);
  8.     Timer4Init();
  9.     PktExterInit();
  10.     asm("rim");

  11.     gtChnlData.u16RxEnChnl = 0x0080 | 0x10;
  12.     gtChnlData.u16TxEnChnl = 0x0100 | 0x10;
  13.     RfEnterIdle();
  14.     RfClrFifo();
  15.     RfEnterRx();
  16.     gtSysFlag.b2TRFlag = 0;
  17.     gtSysFlag.b1NormalMode = 1;
  18.     UartSendChs("AUG393 2.4G Wireless Serial Module!\r\n");
  19.     while(1)//TX
  20.     {
  21.         if(gtSysFlag.b2TRFlag != 1)
  22.         {
  23.             RfSendTest();
  24.         }

  25.                 Delay(1000);
  26.     }
  27.     while(1)//RX
  28.     {
  29.         if(gtRfFifo.u16ReadPoint != gtRfFifo.u16WritePoint)
  30.         {
  31.             UART1_CR2_TIEN = 1;
  32.         }
  33.     }
  34. }
复制代码

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|手机版|小黑屋|ELEOK |网站地图

GMT+8, 2024-3-29 12:57

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表