-
大小: 5.71MB文件類型: .rar金幣: 2下載: 1 次發布日期: 2023-11-15
- 語言: 其他
- 標簽: sx1278??STM32F103??sx12xxDriver??
資源簡介
STM32F103SX1278是配置好的無線通訊程序,親測,可以使用。另外附官網下載的SX12xxDriver.zip,這個里面有STM32其他版本的驅動程序,供其他版本的二次開發使用。

代碼片段和文件信息
/*
?*?THE?FOLLOWING?FIRMWARE?IS?PROVIDED:?(1)?“AS?IS“?WITH?NO?WARRANTY;?AND?
?*?(2)TO?ENABLE?ACCESS?TO?CODING?INFORMATION?TO?GUIDE?AND?FACILITATE?CUSTOMER.
?*?CONSEQUENTLY?SEMTECH?SHALL?NOT?BE?HELD?LIABLE?FOR?ANY?DIRECT?INDIRECT?OR
?*?CONSEQUENTIAL?DAMAGES?WITH?RESPECT?TO?ANY?CLAIMS?ARISING?FROM?THE?CONTENT
?*?OF?SUCH?FIRMWARE?AND/OR?THE?USE?MADE?BY?CUSTOMERS?OF?THE?CODING?INFORMATION
?*?CONTAINED?HEREIN?IN?CONNECTION?WITH?THEIR?PRODUCTS.
?*?
?*?Copyright?(C)?SEMTECH?S.A.
?*/
/*!?
?*?\file???????main.c
?*?\brief??????Ping-Pong?example?application?on?how?to?use?Semtech‘s?Radio
?*?????????????drivers.
?*
?*?\version????2.0
?*?\date???????Nov?21?2012
?*?\author?????Miguel?Luis
?*/
#include?
#include?
#include?
#include?“platform.h“
#include?“led.h“
#if?USE_UART
#include?“uart.h“
#endif
#include?“radio.h“
#define?BUFFER_SIZE?????????????????????????????????9?//?Define?the?payload?size?here
static?uint16_t?BufferSize?=?BUFFER_SIZE; //?RF?buffer?size
static?uint8_t?Buffer[BUFFER_SIZE]; //?RF?buffer
static?uint8_t?EnableMaster?=?true;? //?Master/Slave?selection
tRadioDriver?*Radio?=?NULL;
const?uint8_t?PingMsg[]?=?“PING“;
const?uint8_t?PongMsg[]?=?“PONG“;
/*
?*?Manages?the?master?operation
?*/
void?OnMaster(?void?)
{
????uint8_t?i;
????
????switch(?Radio->Process(?)?)
????{
????case?RF_RX_TIMEOUT:
????????//?Send?the?next?PING?frame
????????Buffer[0]?=?‘P‘;
????????Buffer[1]?=?‘I‘;
????????Buffer[2]?=?‘N‘;
????????Buffer[3]?=?‘G‘;
????????for(?i?=?4;?i?????????{
????????????Buffer[i]?=?i?-?4;
????????}
????????Radio->SetTxPacket(?Buffer?BufferSize?);
????????break;
????case?RF_RX_DONE:
????????Radio->GetRxPacket(?Buffer?(?uint16_t*?)&BufferSize?);
????
????????if(?BufferSize?>?0?)
????????{
????????????if(?strncmp(?(?const?char*?)Buffer?(?const?char*?)PongMsg?4?)?==?0?)
????????????{
????????????????//?Indicates?on?a?LED?that?the?received?frame?is?a?PONG
????????????????LedToggle(?LED_GREEN?);
????????????????//?Send?the?next?PING?frame????????????
????????????????Buffer[0]?=?‘P‘;
????????????????Buffer[1]?=?‘I‘;
????????????????Buffer[2]?=?‘N‘;
????????????????Buffer[3]?=?‘G‘;
????????????????//?We?fill?the?buffer?with?numbers?for?the?payload?
????????????????for(?i?=?4;?i?????????????????{
????????????????????Buffer[i]?=?i?-?4;
????????????????}
????????????????Radio->SetTxPacket(?Buffer?BufferSize?);
????????????}
????????????else?if(?strncmp(?(?const?char*?)Buffer?(?const?char*?)PingMsg?4?)?==?0?)
????????????{?//?A?master?already?exists?then?become?a?slave
????????????????EnableMaster?=?false;
????????????????LedOff(?LED_RED?);
????????????}
????????}????????????
????????break;
????case?RF_TX_DONE:
????????//?Indicates?on?a?LED?that?we?have?sent?a?PING
????????LedToggle(?LED_RED?);
????????Radio->StartRx(?);
????????break;
????default:
????????break;
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????4700616??2018-10-11?19:56??STM32F103?SX1278完整通訊程序\STM32F103_SX127x.rar
?????文件??????13427??2014-07-24?22:24??SX12xxDrivers-V2.1.0\doc\README.txt
?????文件???????8703??2014-07-23?15:44??SX12xxDrivers-V2.1.0\lst\fifo.lst
?????文件??????77552??2014-07-23?15:44??SX12xxDrivers-V2.1.0\lst\i2c.lst
?????文件??????21895??2014-07-23?15:44??SX12xxDrivers-V2.1.0\lst\ioe.lst
?????文件???????6765??2014-07-23?15:44??SX12xxDrivers-V2.1.0\lst\led.lst
?????文件??????19513??2014-07-23?15:44??SX12xxDrivers-V2.1.0\lst\main.lst
?????文件??????14119??2014-07-23?15:45??SX12xxDrivers-V2.1.0\lst\misc.lst
?????文件???????2751??2014-07-23?15:44??SX12xxDrivers-V2.1.0\lst\radio.lst
?????文件???????9528??2014-07-23?15:44??SX12xxDrivers-V2.1.0\lst\spi.lst
?????文件?????110586??2014-07-23?15:45??SX12xxDrivers-V2.1.0\lst\stm32f4xx_adc.lst
?????文件??????75844??2014-07-23?15:45??SX12xxDrivers-V2.1.0\lst\stm32f4xx_dma.lst
?????文件??????19468??2014-07-23?15:45??SX12xxDrivers-V2.1.0\lst\stm32f4xx_exti.lst
?????文件?????107034??2014-07-23?15:45??SX12xxDrivers-V2.1.0\lst\stm32f4xx_flash.lst
?????文件?????177404??2014-07-23?15:45??SX12xxDrivers-V2.1.0\lst\stm32f4xx_fmc.lst
?????文件??????42337??2014-07-23?15:45??SX12xxDrivers-V2.1.0\lst\stm32f4xx_gpio.lst
?????文件??????92780??2014-07-23?15:45??SX12xxDrivers-V2.1.0\lst\stm32f4xx_i2c.lst
?????文件??????32826??2014-07-23?15:45??SX12xxDrivers-V2.1.0\lst\stm32f4xx_pwr.lst
?????文件?????120018??2014-07-23?15:45??SX12xxDrivers-V2.1.0\lst\stm32f4xx_rcc.lst
?????文件?????220276??2014-07-23?15:45??SX12xxDrivers-V2.1.0\lst\stm32f4xx_rtc.lst
?????文件??????52653??2014-07-23?15:45??SX12xxDrivers-V2.1.0\lst\stm32f4xx_sdio.lst
?????文件??????84121??2014-07-23?15:45??SX12xxDrivers-V2.1.0\lst\stm32f4xx_spi.lst
?????文件??????12019??2014-07-23?15:45??SX12xxDrivers-V2.1.0\lst\stm32f4xx_syscfg.lst
?????文件?????267070??2014-07-23?15:45??SX12xxDrivers-V2.1.0\lst\stm32f4xx_tim.lst
?????文件??????10277??2014-07-23?15:44??SX12xxDrivers-V2.1.0\lst\stm32fxxx_it.lst
?????文件????????153??2014-07-23?15:45??SX12xxDrivers-V2.1.0\lst\sx1232-Hal.lst
?????文件????????155??2014-07-23?15:44??SX12xxDrivers-V2.1.0\lst\sx1232-Misc.lst
?????文件????????145??2014-07-23?15:44??SX12xxDrivers-V2.1.0\lst\sx1232.lst
?????文件????????153??2014-07-23?15:44??SX12xxDrivers-V2.1.0\lst\sx1272-Fsk.lst
?????文件????????161??2014-07-23?15:44??SX12xxDrivers-V2.1.0\lst\sx1272-FskMisc.lst
............此處省略492個文件信息
評論
共有 條評論