资源简介
基于STM32F051的LoRa透传的示例代码,该代码在设备上验证可正常收发,所用的LoRa模块是安信可科技生产的LoRa02版本的模块
代码片段和文件信息
/*
* 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 bleeper.c
* \brief
*
* \version 1.0
* \date Nov 21 2012
* \author Miguel Luis
*/
#include
#include “spi.h“
#include “i2c.h“
#include “led.h“
#include “bleeper.h“
// System tick (1ms)
volatile uint32_t TickCounter = 0;
void InitUnusedGPIO( void ) ;
void SelectorInit( void );
uint8_t GetSelectorValue( void );
void SetSelectorStandBy( void );
void SetSelectorSleep( void );
void BoardInit( void )
{
uint8_t i;
/* Setup SysTick Timer for 1 us interrupts ( not too often to save power ) */
if( SysTick_Config( SystemCoreClock / 1000 ) )
{
/* Capture error */
while (1);
}
// Initialize unused GPIO to optimize power consumption
InitUnusedGPIO( );
// Initialize Selector
SelectorInit( );
// Initialize SPI
SpiInit( );
// Initialize LED
for( i = 0; i < LED_NB; i++ )
{
LedInit( ( tLed )i );
}
LedOn( LED1 );
LedOn( LED2 );
LedOn( LED3 );
LongDelay( 1 );
LedOff( LED1 );
LedOff( LED2 );
LedOff( LED3 );
}
void Delay ( uint32_t delay )
{
// Wait delay ms
uint32_t startTick = TickCounter;
while( ( TickCounter - startTick ) < delay );
}
void LongDelay ( uint8_t delay )
{
uint32_t longDelay;
uint32_t startTick;
longDelay = delay * 1000;
// Wait delay s
startTick = TickCounter;
while( ( TickCounter - startTick ) < longDelay );
}
void InitUnusedGPIO( void )
{
GPIO_InitTypeDef GPIO_InitStructure;
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA ENABLE); // enable clock of the IO bank A
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOB ENABLE); // enable clock of the IO bank B
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOC ENABLE); // enable clock of the IO bank C
GPIO_StructInit(&GPIO_InitStructure);
// activate pullups on C8 to C12 (SDIO)
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8|GPIO_Pin_9|GPIO_Pin_10|GPIO_Pin_11|GPIO_Pin_12;
GPIO_Init(GPIOC &GPIO_InitStructure);
// -> save 10 to 50 礎
// activate pullups on B10 and B11 (I睠)
//GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
//GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10|GPIO_Pin_11;
//GPIO_Init(GPIOB &GPIO_InitStructure);
// -> dubious influence (might increase power a little bit)
// activate pulldowns on B
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2017-12-20 15:08 LoRaSTM32F051V3(透传)\
文件 5435 2017-12-19 14:11 LoRaSTM32F051V3(透传)\.mxproject
目录 0 2017-12-20 15:07 LoRaSTM32F051V3(透传)\12xx\
目录 0 2017-12-20 15:07 LoRaSTM32F051V3(透传)\12xx\platform\
目录 0 2017-12-20 15:07 LoRaSTM32F051V3(透传)\12xx\platform\bleeper\
文件 6266 2014-07-23 15:31 LoRaSTM32F051V3(透传)\12xx\platform\bleeper\bleeper.c
文件 2137 2014-07-23 15:31 LoRaSTM32F051V3(透传)\12xx\platform\bleeper\bleeper.h
文件 820 2014-07-23 15:31 LoRaSTM32F051V3(透传)\12xx\platform\bleeper\fifo.c
文件 684 2014-07-23 15:31 LoRaSTM32F051V3(透传)\12xx\platform\bleeper\fifo.h
文件 21349 2014-07-23 15:31 LoRaSTM32F051V3(透传)\12xx\platform\bleeper\i2c.c
文件 4174 2014-07-23 15:31 LoRaSTM32F051V3(透传)\12xx\platform\bleeper\i2c.h
文件 3470 2014-07-23 15:31 LoRaSTM32F051V3(透传)\12xx\platform\bleeper\led.c
文件 3277 2014-07-23 15:31 LoRaSTM32F051V3(透传)\12xx\platform\bleeper\led.h
文件 8195 2014-07-23 15:31 LoRaSTM32F051V3(透传)\12xx\platform\bleeper\spi.c
文件 765 2014-07-23 15:31 LoRaSTM32F051V3(透传)\12xx\platform\bleeper\spi.h
文件 12001 2014-07-23 15:31 LoRaSTM32F051V3(透传)\12xx\platform\bleeper\startup_stm32l1xx_hd.s
文件 3434 2014-07-23 15:31 LoRaSTM32F051V3(透传)\12xx\platform\bleeper\stm32l1xx_conf.h
文件 4936 2014-07-23 15:31 LoRaSTM32F051V3(透传)\12xx\platform\bleeper\stm32l1xx_it.c
文件 2195 2014-07-23 15:31 LoRaSTM32F051V3(透传)\12xx\platform\bleeper\stm32l1xx_it.h
文件 12795 2014-07-23 15:31 LoRaSTM32F051V3(透传)\12xx\platform\bleeper\sx1272-Hal.c
文件 2804 2017-12-20 13:11 LoRaSTM32F051V3(透传)\12xx\platform\platform.h
目录 0 2017-12-20 15:07 LoRaSTM32F051V3(透传)\12xx\platform\stm32libs\
目录 0 2017-12-20 15:07 LoRaSTM32F051V3(透传)\12xx\platform\stm32libs\CMSIS\
目录 0 2017-12-20 15:07 LoRaSTM32F051V3(透传)\12xx\platform\stm32libs\CMSIS\CM3\
文件 99832 2014-07-23 15:31 LoRaSTM32F051V3(透传)\12xx\platform\stm32libs\CMSIS\CM3\core_cm3.h
文件 17146 2014-07-23 15:31 LoRaSTM32F051V3(透传)\12xx\platform\stm32libs\CMSIS\CM3\core_cmFunc.h
文件 20513 2014-07-23 15:31 LoRaSTM32F051V3(透传)\12xx\platform\stm32libs\CMSIS\CM3\core_cmInstr.h
文件 637871 2014-07-23 15:31 LoRaSTM32F051V3(透传)\12xx\platform\stm32libs\CMSIS\CM3\stm32f10x.h
文件 492021 2014-07-23 15:31 LoRaSTM32F051V3(透传)\12xx\platform\stm32libs\CMSIS\CM3\stm32f2xx.h
文件 476018 2014-07-23 15:31 LoRaSTM32F051V3(透传)\12xx\platform\stm32libs\CMSIS\CM3\stm32l1xx.h
文件 29741 2014-07-23 15:31 LoRaSTM32F051V3(透传)\12xx\platform\stm32libs\CMSIS\CM3\system_stm32f10x.c
............此处省略2792个文件信息
- 上一篇:程序员考试同步辅导 考点串讲、真题详解与强化训练.pdf
- 下一篇:2.rar
评论
共有 条评论