定长数据包-第一同步字test保存
This commit is contained in:
parent
938bca1918
commit
2c31416b1e
@ -104,37 +104,13 @@ int main(void)
|
||||
/* USER CODE BEGIN 2 */
|
||||
// 初始化SX1281为BLE模式
|
||||
SX1281_Init(&radio, MODE_BLE);
|
||||
|
||||
SX1281_SetTX();
|
||||
// LCD显示
|
||||
LCD_Init(1);
|
||||
LCD_Clear(BLACK);
|
||||
LCD_DrawString(0,0,"SX1281",MEDIUMORCHID,32,LSB);
|
||||
LCD_DrawBitmap(logo_M,180,80,64,64,MEDIUMORCHID,MSB);
|
||||
|
||||
// 构造标准的BLE广告数据(有效载荷部分)
|
||||
// 注意:这是PDU的有效载荷,不包括2字节的PDU报头
|
||||
// BLE广告数据最大长度为37字节
|
||||
uint8_t advData[] = {
|
||||
// 标志位
|
||||
0x02, 0x01, 0x06,
|
||||
|
||||
// 完整设备名称
|
||||
0x08, 0x09, 'S','X','1','2','8','1','_','1',
|
||||
|
||||
// 服务UUID
|
||||
0x03, 0x03, 0x0A, 0x18,
|
||||
|
||||
// 制造商特定数据 - 包含自定义设备ID
|
||||
0x07, 0xFF, 0x4D, 0x52, 0x31, 0x36, 0x01, 0x02,
|
||||
// 解释:
|
||||
// 0x07 - 长度 (7 bytes)
|
||||
// 0xFF - 制造商特定数据类型
|
||||
// 0x4D,0x52,0x31,0x36 - "MR16" (您的设备标识)
|
||||
// 0x01,0x02 - 版本或设备编号
|
||||
};
|
||||
|
||||
printf("Starting BLE Advertising...\n");
|
||||
printf("Advertising data length: %d bytes\n", sizeof(advData));
|
||||
|
||||
// 设置并发送BLE广告包
|
||||
SetBLEAdvertisingPacket(&radio,advData, sizeof(advData));
|
||||
/* USER CODE END 2 */
|
||||
|
||||
/* Infinite loop */
|
||||
@ -145,22 +121,9 @@ int main(void)
|
||||
|
||||
/* USER CODE BEGIN 3 */
|
||||
// 处理射频中断
|
||||
SX1281_Running();
|
||||
SX1281_Running(&radio);
|
||||
|
||||
// 每2秒重新发送一次广告包
|
||||
static uint32_t lastAdvTime = 0;
|
||||
if (HAL_GetTick() - lastAdvTime > 2000) {
|
||||
SetBLEAdvertisingPacket(&radio,advData, sizeof(advData));
|
||||
lastAdvTime = HAL_GetTick();
|
||||
printf("Resending BLE Advertisement...\n");
|
||||
}
|
||||
|
||||
// LCD显示
|
||||
LCD_DrawString(200,0,"BLE",AQUA,12,LSB);
|
||||
LCD_DrawString(150,0,"ADV",VIOLET,16,LSB);
|
||||
LCD_DrawString(80,0,"SX1281",VIOLET_SOFT,24,LSB);
|
||||
LCD_DrawString(0,0,"SX12811",MEDIUMORCHID,32,LSB);
|
||||
LCD_DrawBitmap(logo_M,70,70,64,64,MEDIUMORCHID,MSB);
|
||||
|
||||
HAL_Delay(100);
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
Binary file not shown.
@ -29,6 +29,10 @@ Project File Date: 11/29/2025
|
||||
Build target 'MR16'
|
||||
Note: source file '..\User\bsp\gpio.c' - object file renamed from 'MR16\gpio.o' to 'MR16\gpio_1.o'.
|
||||
Note: source file '..\User\bsp\spi.c' - object file renamed from 'MR16\spi.o' to 'MR16\spi_1.o'.
|
||||
compiling sx1281.c...
|
||||
linking...
|
||||
Program Size: Code=20108 RO-data=13300 RW-data=92 ZI-data=10596
|
||||
FromELF: creating hex file...
|
||||
"MR16\MR16.axf" - 0 Error(s), 0 Warning(s).
|
||||
|
||||
<h2>Software Packages used:</h2>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -3,9 +3,9 @@
|
||||
<title>Static Call Graph - [MR16\MR16.axf]</title></head>
|
||||
<body><HR>
|
||||
<H1>Static Call Graph for image MR16\MR16.axf</H1><HR>
|
||||
<BR><P>#<CALLGRAPH># ARM Linker, 5060960: Last Updated: Sat Nov 29 16:40:01 2025
|
||||
<BR><P>#<CALLGRAPH># ARM Linker, 5060960: Last Updated: Sat Nov 29 22:00:25 2025
|
||||
<BR><P>
|
||||
<H3>Maximum Stack Usage = 368 bytes + Unknown(Cycles, Untraceable Function Pointers)</H3><H3>
|
||||
<H3>Maximum Stack Usage = 344 bytes + Unknown(Cycles, Untraceable Function Pointers)</H3><H3>
|
||||
Call chain for Maximum Stack Depth:</H3>
|
||||
main ⇒ LCD_DrawString ⇒ LCD_DrawChar ⇒ LCD_DrawPoint ⇒ LCD_SetAddressWindow ⇒ LCD_WriteDataBuffer ⇒ LCD_WriteDataBuffer_DMA ⇒ BSP_SPI_Transmit ⇒ HAL_SPI_Transmit ⇒ SPI_EndRxTxTransaction ⇒ SPI_WaitFlagStateUntilTimeout
|
||||
<P>
|
||||
@ -314,8 +314,7 @@ Global Symbols
|
||||
<P><STRONG><a name="[11b]"></a>_ll_ushift_r</STRONG> (Thumb, 0 bytes, Stack size 0 bytes, llushr.o(.text), UNUSED)
|
||||
|
||||
<P><STRONG><a name="[fb]"></a>__aeabi_memcpy</STRONG> (Thumb, 36 bytes, Stack size 0 bytes, memcpya.o(.text))
|
||||
<BR><BR>[Called By]<UL><LI><a href="#[104]">>></a> SetBLEAdvertisingPacket
|
||||
<LI><a href="#[49]">>></a> SX1281HalReadRegisters
|
||||
<BR><BR>[Called By]<UL><LI><a href="#[49]">>></a> SX1281HalReadRegisters
|
||||
<LI><a href="#[47]">>></a> SX1281HalWriteRegisters
|
||||
<LI><a href="#[45]">>></a> SX1281HalWriteCommand
|
||||
<LI><a href="#[4b]">>></a> SX1281HalWriteBuffer
|
||||
@ -323,20 +322,18 @@ Global Symbols
|
||||
<LI><a href="#[4c]">>></a> SX1281HalReadBuffer
|
||||
</UL>
|
||||
|
||||
<P><STRONG><a name="[113]"></a>__aeabi_memcpy4</STRONG> (Thumb, 0 bytes, Stack size 0 bytes, memcpya.o(.text))
|
||||
<BR><BR>[Called By]<UL><LI><a href="#[35]">>></a> main
|
||||
</UL>
|
||||
<P><STRONG><a name="[11c]"></a>__aeabi_memcpy4</STRONG> (Thumb, 0 bytes, Stack size 0 bytes, memcpya.o(.text), UNUSED)
|
||||
|
||||
<P><STRONG><a name="[11c]"></a>__aeabi_memcpy8</STRONG> (Thumb, 0 bytes, Stack size 0 bytes, memcpya.o(.text), UNUSED)
|
||||
<P><STRONG><a name="[11d]"></a>__aeabi_memcpy8</STRONG> (Thumb, 0 bytes, Stack size 0 bytes, memcpya.o(.text), UNUSED)
|
||||
|
||||
<P><STRONG><a name="[84]"></a>__aeabi_memset</STRONG> (Thumb, 14 bytes, Stack size 0 bytes, memseta.o(.text), UNUSED)
|
||||
<BR><BR>[Called By]<UL><LI><a href="#[85]">>></a> _memset$wrapper
|
||||
<LI><a href="#[83]">>></a> __aeabi_memclr
|
||||
</UL>
|
||||
|
||||
<P><STRONG><a name="[11d]"></a>__aeabi_memset4</STRONG> (Thumb, 0 bytes, Stack size 0 bytes, memseta.o(.text), UNUSED)
|
||||
<P><STRONG><a name="[11e]"></a>__aeabi_memset4</STRONG> (Thumb, 0 bytes, Stack size 0 bytes, memseta.o(.text), UNUSED)
|
||||
|
||||
<P><STRONG><a name="[11e]"></a>__aeabi_memset8</STRONG> (Thumb, 0 bytes, Stack size 0 bytes, memseta.o(.text), UNUSED)
|
||||
<P><STRONG><a name="[11f]"></a>__aeabi_memset8</STRONG> (Thumb, 0 bytes, Stack size 0 bytes, memseta.o(.text), UNUSED)
|
||||
|
||||
<P><STRONG><a name="[83]"></a>__aeabi_memclr</STRONG> (Thumb, 4 bytes, Stack size 0 bytes, memseta.o(.text), UNUSED)
|
||||
<BR><BR>[Calls]<UL><LI><a href="#[84]">>></a> __aeabi_memset
|
||||
@ -347,7 +344,7 @@ Global Symbols
|
||||
<LI><a href="#[107]">>></a> SystemClock_Config
|
||||
</UL>
|
||||
|
||||
<P><STRONG><a name="[11f]"></a>__aeabi_memclr8</STRONG> (Thumb, 0 bytes, Stack size 0 bytes, memseta.o(.text), UNUSED)
|
||||
<P><STRONG><a name="[120]"></a>__aeabi_memclr8</STRONG> (Thumb, 0 bytes, Stack size 0 bytes, memseta.o(.text), UNUSED)
|
||||
|
||||
<P><STRONG><a name="[85]"></a>_memset$wrapper</STRONG> (Thumb, 18 bytes, Stack size 8 bytes, memseta.o(.text), UNUSED)
|
||||
<BR><BR>[Calls]<UL><LI><a href="#[84]">>></a> __aeabi_memset
|
||||
@ -396,7 +393,7 @@ Global Symbols
|
||||
<BR>[Called By]<UL><LI><a href="#[54]">>></a> SX1281SetRfFrequency
|
||||
</UL>
|
||||
|
||||
<P><STRONG><a name="[120]"></a>__aeabi_uidiv</STRONG> (Thumb, 0 bytes, Stack size 12 bytes, uidiv.o(.text), UNUSED)
|
||||
<P><STRONG><a name="[121]"></a>__aeabi_uidiv</STRONG> (Thumb, 0 bytes, Stack size 12 bytes, uidiv.o(.text), UNUSED)
|
||||
|
||||
<P><STRONG><a name="[111]"></a>__aeabi_uidivmod</STRONG> (Thumb, 44 bytes, Stack size 12 bytes, uidiv.o(.text), UNUSED)
|
||||
<BR><BR>[Called By]<UL><LI><a href="#[10c]">>></a> _printf_core
|
||||
@ -410,7 +407,7 @@ Global Symbols
|
||||
<LI><a href="#[10d]">>></a> _fp_digits
|
||||
</UL>
|
||||
|
||||
<P><STRONG><a name="[121]"></a>__I$use$fp</STRONG> (Thumb, 0 bytes, Stack size 8 bytes, iusefp.o(.text), UNUSED)
|
||||
<P><STRONG><a name="[122]"></a>__I$use$fp</STRONG> (Thumb, 0 bytes, Stack size 8 bytes, iusefp.o(.text), UNUSED)
|
||||
|
||||
<P><STRONG><a name="[89]"></a>_double_round</STRONG> (Thumb, 30 bytes, Stack size 8 bytes, depilogue.o(.text))
|
||||
<BR><BR>[Stack]<UL><LI>Max Depth = 8<LI>Call Chain = _double_round
|
||||
@ -469,7 +466,7 @@ Global Symbols
|
||||
<BR>[Called By]<UL><LI><a href="#[81]">>></a> _main_scatterload
|
||||
</UL>
|
||||
|
||||
<P><STRONG><a name="[122]"></a>__scatterload_rt2</STRONG> (Thumb, 0 bytes, Stack size 0 bytes, init.o(.text), UNUSED)
|
||||
<P><STRONG><a name="[123]"></a>__scatterload_rt2</STRONG> (Thumb, 0 bytes, Stack size 0 bytes, init.o(.text), UNUSED)
|
||||
|
||||
<P><STRONG><a name="[8f]"></a>__aeabi_llsl</STRONG> (Thumb, 30 bytes, Stack size 0 bytes, llshl.o(.text))
|
||||
<BR><BR>[Called By]<UL><LI><a href="#[8e]">>></a> __aeabi_uldivmod
|
||||
@ -478,13 +475,13 @@ Global Symbols
|
||||
<LI><a href="#[94]">>></a> __aeabi_d2ulz
|
||||
</UL>
|
||||
|
||||
<P><STRONG><a name="[123]"></a>_ll_shift_l</STRONG> (Thumb, 0 bytes, Stack size 0 bytes, llshl.o(.text), UNUSED)
|
||||
<P><STRONG><a name="[124]"></a>_ll_shift_l</STRONG> (Thumb, 0 bytes, Stack size 0 bytes, llshl.o(.text), UNUSED)
|
||||
|
||||
<P><STRONG><a name="[91]"></a>__aeabi_lasr</STRONG> (Thumb, 36 bytes, Stack size 0 bytes, llsshr.o(.text), UNUSED)
|
||||
<BR><BR>[Called By]<UL><LI><a href="#[90]">>></a> __aeabi_dadd
|
||||
</UL>
|
||||
|
||||
<P><STRONG><a name="[124]"></a>_ll_sshift_r</STRONG> (Thumb, 0 bytes, Stack size 0 bytes, llsshr.o(.text), UNUSED)
|
||||
<P><STRONG><a name="[125]"></a>_ll_sshift_r</STRONG> (Thumb, 0 bytes, Stack size 0 bytes, llsshr.o(.text), UNUSED)
|
||||
|
||||
<P><STRONG><a name="[97]"></a>BSP_SPI_GetHandle</STRONG> (Thumb, 18 bytes, Stack size 0 bytes, spi_1.o(i.BSP_SPI_GetHandle))
|
||||
<BR><BR>[Called By]<UL><LI><a href="#[9c]">>></a> BSP_SPI_TransmitReceive
|
||||
@ -707,7 +704,6 @@ Global Symbols
|
||||
<LI><a href="#[ba]">>></a> HAL_RCC_OscConfig
|
||||
<LI><a href="#[b8]">>></a> HAL_RCC_ClockConfig
|
||||
<LI><a href="#[ac]">>></a> HAL_Delay
|
||||
<LI><a href="#[35]">>></a> main
|
||||
<LI><a href="#[9e]">>></a> HAL_SPI_TransmitReceive
|
||||
<LI><a href="#[9b]">>></a> HAL_SPI_Transmit
|
||||
<LI><a href="#[da]">>></a> HAL_UART_Transmit
|
||||
@ -777,9 +773,9 @@ Global Symbols
|
||||
<P><STRONG><a name="[b8]"></a>HAL_RCC_ClockConfig</STRONG> (Thumb, 280 bytes, Stack size 32 bytes, stm32f1xx_hal_rcc.o(i.HAL_RCC_ClockConfig))
|
||||
<BR><BR>[Stack]<UL><LI>Max Depth = 64<LI>Call Chain = HAL_RCC_ClockConfig ⇒ HAL_InitTick ⇒ HAL_NVIC_SetPriority
|
||||
</UL>
|
||||
<BR>[Calls]<UL><LI><a href="#[ad]">>></a> HAL_GetTick
|
||||
<LI><a href="#[b9]">>></a> HAL_RCC_GetSysClockFreq
|
||||
<BR>[Calls]<UL><LI><a href="#[b9]">>></a> HAL_RCC_GetSysClockFreq
|
||||
<LI><a href="#[b4]">>></a> HAL_InitTick
|
||||
<LI><a href="#[ad]">>></a> HAL_GetTick
|
||||
</UL>
|
||||
<BR>[Called By]<UL><LI><a href="#[107]">>></a> SystemClock_Config
|
||||
</UL>
|
||||
@ -1772,7 +1768,7 @@ Global Symbols
|
||||
<BR>[Called By]<UL><LI><a href="#[102]">>></a> SX1281_Init
|
||||
</UL>
|
||||
|
||||
<P><STRONG><a name="[f3]"></a>SX1281_Callback</STRONG> (Thumb, 130 bytes, Stack size 24 bytes, sx1281.o(i.SX1281_Callback))
|
||||
<P><STRONG><a name="[f3]"></a>SX1281_Callback</STRONG> (Thumb, 128 bytes, Stack size 24 bytes, sx1281.o(i.SX1281_Callback))
|
||||
<BR><BR>[Stack]<UL><LI>Max Depth = 48<LI>Call Chain = SX1281_Callback ⇒ __2printf
|
||||
</UL>
|
||||
<BR>[Calls]<UL><LI><a href="#[101]">>></a> __2printf
|
||||
@ -1784,7 +1780,11 @@ Global Symbols
|
||||
<LI><a href="#[7c]">>></a> OnRxDone
|
||||
</UL>
|
||||
|
||||
<P><STRONG><a name="[102]"></a>SX1281_Init</STRONG> (Thumb, 454 bytes, Stack size 48 bytes, sx1281.o(i.SX1281_Init))
|
||||
<P><STRONG><a name="[104]"></a>SX1281_GetState</STRONG> (Thumb, 20 bytes, Stack size 0 bytes, sx1281.o(i.SX1281_GetState))
|
||||
<BR><BR>[Called By]<UL><LI><a href="#[103]">>></a> SX1281_Running
|
||||
</UL>
|
||||
|
||||
<P><STRONG><a name="[102]"></a>SX1281_Init</STRONG> (Thumb, 492 bytes, Stack size 48 bytes, sx1281.o(i.SX1281_Init))
|
||||
<BR><BR>[Stack]<UL><LI>Max Depth = 72<LI>Call Chain = SX1281_Init ⇒ __2printf
|
||||
</UL>
|
||||
<BR>[Calls]<UL><LI><a href="#[ac]">>></a> HAL_Delay
|
||||
@ -1794,22 +1794,18 @@ Global Symbols
|
||||
<BR>[Called By]<UL><LI><a href="#[35]">>></a> main
|
||||
</UL>
|
||||
|
||||
<P><STRONG><a name="[103]"></a>SX1281_Running</STRONG> (Thumb, 16 bytes, Stack size 8 bytes, sx1281.o(i.SX1281_Running))
|
||||
<P><STRONG><a name="[103]"></a>SX1281_Running</STRONG> (Thumb, 24 bytes, Stack size 8 bytes, sx1281.o(i.SX1281_Running))
|
||||
<BR><BR>[Stack]<UL><LI>Max Depth = 200<LI>Call Chain = SX1281_Running ⇒ SX1281ProcessIrqs ⇒ SX1281GetIrqStatus ⇒ SX1281HalReadCommand ⇒ SpiInOut ⇒ BSP_SPI_TransmitReceive ⇒ HAL_SPI_TransmitReceive ⇒ SPI_EndRxTxTransaction ⇒ SPI_WaitFlagStateUntilTimeout
|
||||
</UL>
|
||||
<BR>[Calls]<UL><LI><a href="#[ac]">>></a> HAL_Delay
|
||||
<LI><a href="#[fd]">>></a> SX1281ProcessIrqs
|
||||
<LI><a href="#[104]">>></a> SX1281_GetState
|
||||
</UL>
|
||||
<BR>[Called By]<UL><LI><a href="#[35]">>></a> main
|
||||
</UL>
|
||||
|
||||
<P><STRONG><a name="[104]"></a>SetBLEAdvertisingPacket</STRONG> (Thumb, 278 bytes, Stack size 80 bytes, sx1281.o(i.SetBLEAdvertisingPacket))
|
||||
<BR><BR>[Stack]<UL><LI>Max Depth = 104<LI>Call Chain = SetBLEAdvertisingPacket ⇒ __2printf
|
||||
</UL>
|
||||
<BR>[Calls]<UL><LI><a href="#[fb]">>></a> __aeabi_memcpy
|
||||
<LI><a href="#[de]">>></a> malloc
|
||||
<LI><a href="#[e0]">>></a> free
|
||||
<LI><a href="#[101]">>></a> __2printf
|
||||
<P><STRONG><a name="[113]"></a>SX1281_SetTX</STRONG> (Thumb, 34 bytes, Stack size 16 bytes, sx1281.o(i.SX1281_SetTX))
|
||||
<BR><BR>[Stack]<UL><LI>Max Depth = 16<LI>Call Chain = SX1281_SetTX
|
||||
</UL>
|
||||
<BR>[Called By]<UL><LI><a href="#[35]">>></a> main
|
||||
</UL>
|
||||
@ -1890,26 +1886,24 @@ Global Symbols
|
||||
<BR><BR>[Calls]<UL><LI><a href="#[10c]">>></a> _printf_core
|
||||
</UL>
|
||||
|
||||
<P><STRONG><a name="[125]"></a>__1printf</STRONG> (Thumb, 0 bytes, Stack size 24 bytes, printfa.o(i.__0printf), UNUSED)
|
||||
<P><STRONG><a name="[126]"></a>__1printf</STRONG> (Thumb, 0 bytes, Stack size 24 bytes, printfa.o(i.__0printf), UNUSED)
|
||||
|
||||
<P><STRONG><a name="[101]"></a>__2printf</STRONG> (Thumb, 0 bytes, Stack size 24 bytes, printfa.o(i.__0printf))
|
||||
<BR><BR>[Stack]<UL><LI>Max Depth = 24<LI>Call Chain = __2printf
|
||||
</UL>
|
||||
<BR>[Called By]<UL><LI><a href="#[104]">>></a> SetBLEAdvertisingPacket
|
||||
<LI><a href="#[102]">>></a> SX1281_Init
|
||||
<LI><a href="#[35]">>></a> main
|
||||
<BR>[Called By]<UL><LI><a href="#[102]">>></a> SX1281_Init
|
||||
<LI><a href="#[f3]">>></a> SX1281_Callback
|
||||
</UL>
|
||||
|
||||
<P><STRONG><a name="[126]"></a>__c89printf</STRONG> (Thumb, 0 bytes, Stack size 24 bytes, printfa.o(i.__0printf), UNUSED)
|
||||
<P><STRONG><a name="[127]"></a>__c89printf</STRONG> (Thumb, 0 bytes, Stack size 24 bytes, printfa.o(i.__0printf), UNUSED)
|
||||
|
||||
<P><STRONG><a name="[127]"></a>printf</STRONG> (Thumb, 0 bytes, Stack size 24 bytes, printfa.o(i.__0printf), UNUSED)
|
||||
<P><STRONG><a name="[128]"></a>printf</STRONG> (Thumb, 0 bytes, Stack size 24 bytes, printfa.o(i.__0printf), UNUSED)
|
||||
|
||||
<P><STRONG><a name="[128]"></a>__scatterload_copy</STRONG> (Thumb, 14 bytes, Stack size unknown bytes, handlers.o(i.__scatterload_copy), UNUSED)
|
||||
<P><STRONG><a name="[129]"></a>__scatterload_copy</STRONG> (Thumb, 14 bytes, Stack size unknown bytes, handlers.o(i.__scatterload_copy), UNUSED)
|
||||
|
||||
<P><STRONG><a name="[129]"></a>__scatterload_null</STRONG> (Thumb, 2 bytes, Stack size unknown bytes, handlers.o(i.__scatterload_null), UNUSED)
|
||||
<P><STRONG><a name="[12a]"></a>__scatterload_null</STRONG> (Thumb, 2 bytes, Stack size unknown bytes, handlers.o(i.__scatterload_null), UNUSED)
|
||||
|
||||
<P><STRONG><a name="[12a]"></a>__scatterload_zeroinit</STRONG> (Thumb, 14 bytes, Stack size unknown bytes, handlers.o(i.__scatterload_zeroinit), UNUSED)
|
||||
<P><STRONG><a name="[12b]"></a>__scatterload_zeroinit</STRONG> (Thumb, 14 bytes, Stack size unknown bytes, handlers.o(i.__scatterload_zeroinit), UNUSED)
|
||||
|
||||
<P><STRONG><a name="[41]"></a>fputc</STRONG> (Thumb, 24 bytes, Stack size 16 bytes, sx1281.o(i.fputc))
|
||||
<BR><BR>[Stack]<UL><LI>Max Depth = 80<LI>Call Chain = fputc ⇒ HAL_UART_Transmit ⇒ UART_WaitOnFlagUntilTimeout
|
||||
@ -1922,14 +1916,13 @@ Global Symbols
|
||||
<P><STRONG><a name="[e0]"></a>free</STRONG> (Thumb, 76 bytes, Stack size 8 bytes, malloc.o(i.free))
|
||||
<BR><BR>[Stack]<UL><LI>Max Depth = 8<LI>Call Chain = free
|
||||
</UL>
|
||||
<BR>[Called By]<UL><LI><a href="#[104]">>></a> SetBLEAdvertisingPacket
|
||||
<LI><a href="#[dc]">>></a> LCD_Clear
|
||||
<BR>[Called By]<UL><LI><a href="#[dc]">>></a> LCD_Clear
|
||||
</UL>
|
||||
|
||||
<P><STRONG><a name="[35]"></a>main</STRONG> (Thumb, 256 bytes, Stack size 40 bytes, main.o(i.main))
|
||||
<BR><BR>[Stack]<UL><LI>Max Depth = 368<LI>Call Chain = main ⇒ LCD_DrawString ⇒ LCD_DrawChar ⇒ LCD_DrawPoint ⇒ LCD_SetAddressWindow ⇒ LCD_WriteDataBuffer ⇒ LCD_WriteDataBuffer_DMA ⇒ BSP_SPI_Transmit ⇒ HAL_SPI_Transmit ⇒ SPI_EndRxTxTransaction ⇒ SPI_WaitFlagStateUntilTimeout
|
||||
<P><STRONG><a name="[35]"></a>main</STRONG> (Thumb, 120 bytes, Stack size 16 bytes, main.o(i.main))
|
||||
<BR><BR>[Stack]<UL><LI>Max Depth = 344<LI>Call Chain = main ⇒ LCD_DrawString ⇒ LCD_DrawChar ⇒ LCD_DrawPoint ⇒ LCD_SetAddressWindow ⇒ LCD_WriteDataBuffer ⇒ LCD_WriteDataBuffer_DMA ⇒ BSP_SPI_Transmit ⇒ HAL_SPI_Transmit ⇒ SPI_EndRxTxTransaction ⇒ SPI_WaitFlagStateUntilTimeout
|
||||
</UL>
|
||||
<BR>[Calls]<UL><LI><a href="#[104]">>></a> SetBLEAdvertisingPacket
|
||||
<BR>[Calls]<UL><LI><a href="#[113]">>></a> SX1281_SetTX
|
||||
<LI><a href="#[103]">>></a> SX1281_Running
|
||||
<LI><a href="#[102]">>></a> SX1281_Init
|
||||
<LI><a href="#[f2]">>></a> MX_USART2_UART_Init
|
||||
@ -1944,19 +1937,15 @@ Global Symbols
|
||||
<LI><a href="#[e1]">>></a> LCD_DrawBitmap
|
||||
<LI><a href="#[dc]">>></a> LCD_Clear
|
||||
<LI><a href="#[b2]">>></a> HAL_Init
|
||||
<LI><a href="#[ad]">>></a> HAL_GetTick
|
||||
<LI><a href="#[ac]">>></a> HAL_Delay
|
||||
<LI><a href="#[107]">>></a> SystemClock_Config
|
||||
<LI><a href="#[113]">>></a> __aeabi_memcpy4
|
||||
<LI><a href="#[101]">>></a> __2printf
|
||||
</UL>
|
||||
<BR>[Address Reference Count : 1]<UL><LI> entry9a.o(.ARM.Collect$$$$0000000B)
|
||||
</UL>
|
||||
<P><STRONG><a name="[de]"></a>malloc</STRONG> (Thumb, 92 bytes, Stack size 20 bytes, malloc.o(i.malloc))
|
||||
<BR><BR>[Stack]<UL><LI>Max Depth = 20<LI>Call Chain = malloc
|
||||
</UL>
|
||||
<BR>[Called By]<UL><LI><a href="#[104]">>></a> SetBLEAdvertisingPacket
|
||||
<LI><a href="#[dc]">>></a> LCD_Clear
|
||||
<BR>[Called By]<UL><LI><a href="#[dc]">>></a> LCD_Clear
|
||||
</UL>
|
||||
<P>
|
||||
<H3>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,7 +1,7 @@
|
||||
Dependencies for Project 'MR16', Target 'MR16': (DO NOT MODIFY !)
|
||||
CompilerVersion: 5060960::V5.06 update 7 (build 960)::.\ARMCC
|
||||
F (startup_stm32f103xb.s)(0x692846FC)(--cpu Cortex-M3 -g --apcs=interwork --pd "__MICROLIB SETA 1"
-I.\RTE\_MR16
-ID:\cangming\ARM\CMSIS\5.7.0\CMSIS\Core\Include
-ID:\cangming\keil\STM32F1xx_DFP\2.0.0\Device\Include
--pd "__UVISION_VERSION SETA 534" --pd "_RTE_ SETA 1" --pd "STM32F10X_MD SETA 1" --pd "_RTE_ SETA 1"
--list startup_stm32f103xb.lst --xref -o mr16\startup_stm32f103xb.o --depend mr16\startup_stm32f103xb.d)
|
||||
F (../Core/Src/main.c)(0x692AB15F)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -O3 --apcs=interwork --split_sections -I ../Core/Inc -I ../Drivers/STM32F1xx_HAL_Driver/Inc -I ../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I ../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I ../Drivers/CMSIS/Include -I ../sx1281-driver-c -I ../User
-I.\RTE\_MR16
-ID:\cangming\ARM\CMSIS\5.7.0\CMSIS\Core\Include
-ID:\cangming\keil\STM32F1xx_DFP\2.0.0\Device\Include
-D__UVISION_VERSION="534" -D_RTE_ -DSTM32F10X_MD -D_RTE_ -DUSE_HAL_DRIVER -DSTM32F103xB
-o mr16\main.o --omf_browse mr16\main.crf --depend mr16\main.d)
|
||||
F (../Core/Src/main.c)(0x692AF895)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -O3 --apcs=interwork --split_sections -I ../Core/Inc -I ../Drivers/STM32F1xx_HAL_Driver/Inc -I ../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I ../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I ../Drivers/CMSIS/Include -I ../sx1281-driver-c -I ../User
-I.\RTE\_MR16
-ID:\cangming\ARM\CMSIS\5.7.0\CMSIS\Core\Include
-ID:\cangming\keil\STM32F1xx_DFP\2.0.0\Device\Include
-D__UVISION_VERSION="534" -D_RTE_ -DSTM32F10X_MD -D_RTE_ -DUSE_HAL_DRIVER -DSTM32F103xB
-o mr16\main.o --omf_browse mr16\main.crf --depend mr16\main.d)
|
||||
I (../Core/Inc/main.h)(0x6926BBE5)
|
||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h)(0x67480A20)
|
||||
I (../Core/Inc/stm32f1xx_hal_conf.h)(0x6925BA2A)
|
||||
@ -38,13 +38,13 @@ I (../Core/Inc/usart.h)(0x691B56EA)
|
||||
I (../Core/Inc/gpio.h)(0x691B56EA)
|
||||
I (D:\cangming\ARM\ARMCC\include\string.h)(0x5E8E3CC2)
|
||||
I (D:\cangming\ARM\ARMCC\include\stdio.h)(0x5E8E3CC2)
|
||||
I (../sx1281-driver-c/sx1281.h)(0x692AAC2E)
|
||||
I (../sx1281-driver-c/sx1281.h)(0x692AF46C)
|
||||
I (D:\cangming\ARM\ARMCC\include\stdbool.h)(0x5E8E3CC2)
|
||||
I (../sx1281-driver-c/sx1281_driver.h)(0x692AA9D3)
|
||||
I (D:\cangming\ARM\ARMCC\include\math.h)(0x5E8E3CC2)
|
||||
I (../User/device/device.h)(0x691D6BB5)
|
||||
I (../User/device/lcd_driver/lcd.h)(0x692A51B9)
|
||||
I (../User/bsp/spi.h)(0x69287B05)
|
||||
I (../User/device/lcd_driver/lcd.h)(0x692ABE66)
|
||||
I (../User/bsp/spi.h)(0x692ABE66)
|
||||
I (../User/bsp/bsp.h)(0x691D6BB5)
|
||||
I (../User/bsp/gpio.h)(0x691D6BB5)
|
||||
F (../Core/Src/gpio.c)(0x692846F9)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -O3 --apcs=interwork --split_sections -I ../Core/Inc -I ../Drivers/STM32F1xx_HAL_Driver/Inc -I ../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I ../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I ../Drivers/CMSIS/Include -I ../sx1281-driver-c -I ../User
-I.\RTE\_MR16
-ID:\cangming\ARM\CMSIS\5.7.0\CMSIS\Core\Include
-ID:\cangming\keil\STM32F1xx_DFP\2.0.0\Device\Include
-D__UVISION_VERSION="534" -D_RTE_ -DSTM32F10X_MD -D_RTE_ -DUSE_HAL_DRIVER -DSTM32F103xB
-o mr16\gpio.o --omf_browse mr16\gpio.crf --depend mr16\gpio.d)
|
||||
@ -728,7 +728,7 @@ I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim.h)(0x67480A20)
|
||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim_ex.h)(0x67480A20)
|
||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_uart.h)(0x67480A20)
|
||||
F (..\sx1281-driver-c\radio.h)(0x69249477)()
|
||||
F (..\sx1281-driver-c\sx1281.c)(0x692AAC2E)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -O3 --apcs=interwork --split_sections -I ../Core/Inc -I ../Drivers/STM32F1xx_HAL_Driver/Inc -I ../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I ../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I ../Drivers/CMSIS/Include -I ../sx1281-driver-c -I ../User
-I.\RTE\_MR16
-ID:\cangming\ARM\CMSIS\5.7.0\CMSIS\Core\Include
-ID:\cangming\keil\STM32F1xx_DFP\2.0.0\Device\Include
-D__UVISION_VERSION="534" -D_RTE_ -DSTM32F10X_MD -D_RTE_ -DUSE_HAL_DRIVER -DSTM32F103xB
-o mr16\sx1281.o --omf_browse mr16\sx1281.crf --depend mr16\sx1281.d)
|
||||
F (..\sx1281-driver-c\sx1281.c)(0x692AFC6B)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -O3 --apcs=interwork --split_sections -I ../Core/Inc -I ../Drivers/STM32F1xx_HAL_Driver/Inc -I ../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I ../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I ../Drivers/CMSIS/Include -I ../sx1281-driver-c -I ../User
-I.\RTE\_MR16
-ID:\cangming\ARM\CMSIS\5.7.0\CMSIS\Core\Include
-ID:\cangming\keil\STM32F1xx_DFP\2.0.0\Device\Include
-D__UVISION_VERSION="534" -D_RTE_ -DSTM32F10X_MD -D_RTE_ -DUSE_HAL_DRIVER -DSTM32F103xB
-o mr16\sx1281.o --omf_browse mr16\sx1281.crf --depend mr16\sx1281.d)
|
||||
I (..\sx1281-driver-c\sx1281_driver.h)(0x692AA9D3)
|
||||
I (D:\cangming\ARM\ARMCC\include\stdint.h)(0x5E8E3CC2)
|
||||
I (D:\cangming\ARM\ARMCC\include\stdbool.h)(0x5E8E3CC2)
|
||||
@ -773,9 +773,9 @@ I (..\sx1281-driver-c\sx1281_boards.h)(0x69248C05)
|
||||
I (..\sx1281-driver-c\sx1281_driver_gpio.h)(0x691D7D06)
|
||||
I (..\sx1281-driver-c\sx1281_driver_spi.h)(0x5ACC746C)
|
||||
I (..\sx1281-driver-c\sx1281_driver_uart.h)(0x69248C05)
|
||||
I (..\sx1281-driver-c\sx1281.h)(0x692AAC2E)
|
||||
I (..\sx1281-driver-c\sx1281.h)(0x692AF46C)
|
||||
I (../User/device/device.h)(0x691D6BB5)
|
||||
F (..\sx1281-driver-c\sx1281.h)(0x692AAC2E)()
|
||||
F (..\sx1281-driver-c\sx1281.h)(0x692AF46C)()
|
||||
F (..\sx1281-driver-c\sx1281_boards.h)(0x69248C05)()
|
||||
F (..\sx1281-driver-c\sx1281_driver.c)(0x6925B026)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -O3 --apcs=interwork --split_sections -I ../Core/Inc -I ../Drivers/STM32F1xx_HAL_Driver/Inc -I ../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I ../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I ../Drivers/CMSIS/Include -I ../sx1281-driver-c -I ../User
-I.\RTE\_MR16
-ID:\cangming\ARM\CMSIS\5.7.0\CMSIS\Core\Include
-ID:\cangming\keil\STM32F1xx_DFP\2.0.0\Device\Include
-D__UVISION_VERSION="534" -D_RTE_ -DSTM32F10X_MD -D_RTE_ -DUSE_HAL_DRIVER -DSTM32F103xB
-o mr16\sx1281_driver.o --omf_browse mr16\sx1281_driver.crf --depend mr16\sx1281_driver.d)
|
||||
I (D:\cangming\ARM\ARMCC\include\string.h)(0x5E8E3CC2)
|
||||
@ -904,7 +904,7 @@ I (..\sx1281-driver-c\radio.h)(0x69249477)
|
||||
I (D:\cangming\ARM\ARMCC\include\string.h)(0x5E8E3CC2)
|
||||
F (..\sx1281-driver-c\sx1281_driver_hal.h)(0x6924A201)()
|
||||
F (..\sx1281-driver-c\sx1281_driver_spi.c)(0x6925BEAD)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -O3 --apcs=interwork --split_sections -I ../Core/Inc -I ../Drivers/STM32F1xx_HAL_Driver/Inc -I ../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I ../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I ../Drivers/CMSIS/Include -I ../sx1281-driver-c -I ../User
-I.\RTE\_MR16
-ID:\cangming\ARM\CMSIS\5.7.0\CMSIS\Core\Include
-ID:\cangming\keil\STM32F1xx_DFP\2.0.0\Device\Include
-D__UVISION_VERSION="534" -D_RTE_ -DSTM32F10X_MD -D_RTE_ -DUSE_HAL_DRIVER -DSTM32F103xB
-o mr16\sx1281_driver_spi.o --omf_browse mr16\sx1281_driver_spi.crf --depend mr16\sx1281_driver_spi.d)
|
||||
I (../User/bsp/spi.h)(0x69287B05)
|
||||
I (../User/bsp/spi.h)(0x692ABE66)
|
||||
I (../Core/Inc/spi.h)(0x691B56EA)
|
||||
I (../Core/Inc/main.h)(0x6926BBE5)
|
||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h)(0x67480A20)
|
||||
@ -1048,7 +1048,7 @@ I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim.h)(0x67480A20)
|
||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim_ex.h)(0x67480A20)
|
||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_uart.h)(0x67480A20)
|
||||
F (..\User\bsp\gpio.h)(0x691D6BB5)()
|
||||
F (..\User\bsp\spi.c)(0x69287AF0)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -O3 --apcs=interwork --split_sections -I ../Core/Inc -I ../Drivers/STM32F1xx_HAL_Driver/Inc -I ../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I ../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I ../Drivers/CMSIS/Include -I ../sx1281-driver-c -I ../User
-I.\RTE\_MR16
-ID:\cangming\ARM\CMSIS\5.7.0\CMSIS\Core\Include
-ID:\cangming\keil\STM32F1xx_DFP\2.0.0\Device\Include
-D__UVISION_VERSION="534" -D_RTE_ -DSTM32F10X_MD -D_RTE_ -DUSE_HAL_DRIVER -DSTM32F103xB
-o mr16\spi_1.o --omf_browse mr16\spi_1.crf --depend mr16\spi_1.d)
|
||||
F (..\User\bsp\spi.c)(0x692ABE66)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -O3 --apcs=interwork --split_sections -I ../Core/Inc -I ../Drivers/STM32F1xx_HAL_Driver/Inc -I ../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I ../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I ../Drivers/CMSIS/Include -I ../sx1281-driver-c -I ../User
-I.\RTE\_MR16
-ID:\cangming\ARM\CMSIS\5.7.0\CMSIS\Core\Include
-ID:\cangming\keil\STM32F1xx_DFP\2.0.0\Device\Include
-D__UVISION_VERSION="534" -D_RTE_ -DSTM32F10X_MD -D_RTE_ -DUSE_HAL_DRIVER -DSTM32F103xB
-o mr16\spi_1.o --omf_browse mr16\spi_1.crf --depend mr16\spi_1.d)
|
||||
I (../Core/Inc/spi.h)(0x691B56EA)
|
||||
I (../Core/Inc/main.h)(0x6926BBE5)
|
||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h)(0x67480A20)
|
||||
@ -1079,10 +1079,10 @@ I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_spi.h)(0x67480A20)
|
||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim.h)(0x67480A20)
|
||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim_ex.h)(0x67480A20)
|
||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_uart.h)(0x67480A20)
|
||||
I (../User/bsp/spi.h)(0x69287B05)
|
||||
I (../User/bsp/spi.h)(0x692ABE66)
|
||||
I (D:\cangming\ARM\ARMCC\include\stdbool.h)(0x5E8E3CC2)
|
||||
I (../User/bsp/bsp.h)(0x691D6BB5)
|
||||
F (..\User\bsp\spi.h)(0x69287B05)()
|
||||
F (..\User\bsp\spi.h)(0x692ABE66)()
|
||||
F (..\User\bsp\uart.c)(0x69249732)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -O3 --apcs=interwork --split_sections -I ../Core/Inc -I ../Drivers/STM32F1xx_HAL_Driver/Inc -I ../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I ../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I ../Drivers/CMSIS/Include -I ../sx1281-driver-c -I ../User
-I.\RTE\_MR16
-ID:\cangming\ARM\CMSIS\5.7.0\CMSIS\Core\Include
-ID:\cangming\keil\STM32F1xx_DFP\2.0.0\Device\Include
-D__UVISION_VERSION="534" -D_RTE_ -DSTM32F10X_MD -D_RTE_ -DUSE_HAL_DRIVER -DSTM32F103xB
-o mr16\uart.o --omf_browse mr16\uart.crf --depend mr16\uart.d)
|
||||
I (../Core/Inc/usart.h)(0x691B56EA)
|
||||
I (../Core/Inc/main.h)(0x6926BBE5)
|
||||
@ -1119,12 +1119,12 @@ I (D:\cangming\ARM\ARMCC\include\stdbool.h)(0x5E8E3CC2)
|
||||
I (../User/bsp/bsp.h)(0x691D6BB5)
|
||||
F (..\User\bsp\uart.h)(0x692496BB)()
|
||||
F (..\User\device\device.h)(0x691D6BB5)()
|
||||
F (..\User\device\lcd_driver\lcd.c)(0x692A60A3)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -O3 --apcs=interwork --split_sections -I ../Core/Inc -I ../Drivers/STM32F1xx_HAL_Driver/Inc -I ../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I ../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I ../Drivers/CMSIS/Include -I ../sx1281-driver-c -I ../User
-I.\RTE\_MR16
-ID:\cangming\ARM\CMSIS\5.7.0\CMSIS\Core\Include
-ID:\cangming\keil\STM32F1xx_DFP\2.0.0\Device\Include
-D__UVISION_VERSION="534" -D_RTE_ -DSTM32F10X_MD -D_RTE_ -DUSE_HAL_DRIVER -DSTM32F103xB
-o mr16\lcd.o --omf_browse mr16\lcd.crf --depend mr16\lcd.d)
|
||||
I (../User/device/lcd_driver/lcd.h)(0x692A51B9)
|
||||
F (..\User\device\lcd_driver\lcd.c)(0x692ABE66)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -O3 --apcs=interwork --split_sections -I ../Core/Inc -I ../Drivers/STM32F1xx_HAL_Driver/Inc -I ../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I ../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I ../Drivers/CMSIS/Include -I ../sx1281-driver-c -I ../User
-I.\RTE\_MR16
-ID:\cangming\ARM\CMSIS\5.7.0\CMSIS\Core\Include
-ID:\cangming\keil\STM32F1xx_DFP\2.0.0\Device\Include
-D__UVISION_VERSION="534" -D_RTE_ -DSTM32F10X_MD -D_RTE_ -DUSE_HAL_DRIVER -DSTM32F103xB
-o mr16\lcd.o --omf_browse mr16\lcd.crf --depend mr16\lcd.d)
|
||||
I (../User/device/lcd_driver/lcd.h)(0x692ABE66)
|
||||
I (../User/device/device.h)(0x691D6BB5)
|
||||
I (D:\cangming\ARM\ARMCC\include\stdbool.h)(0x5E8E3CC2)
|
||||
I (D:\cangming\ARM\ARMCC\include\stdint.h)(0x5E8E3CC2)
|
||||
I (../User/bsp/spi.h)(0x69287B05)
|
||||
I (../User/bsp/spi.h)(0x692ABE66)
|
||||
I (../Core/Inc/spi.h)(0x691B56EA)
|
||||
I (../Core/Inc/main.h)(0x6926BBE5)
|
||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h)(0x67480A20)
|
||||
@ -1156,11 +1156,11 @@ I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim_ex.h)(0x67480A20)
|
||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_uart.h)(0x67480A20)
|
||||
I (../User/bsp/bsp.h)(0x691D6BB5)
|
||||
I (../User/bsp/gpio.h)(0x691D6BB5)
|
||||
I (../User/device/lcd_driver/lcd_lib.h)(0x692A5F31)
|
||||
I (../User/device/lcd_driver/lcd_lib.h)(0x692ABE66)
|
||||
I (D:\cangming\ARM\ARMCC\include\stdlib.h)(0x5E8E3CC2)
|
||||
I (D:\cangming\ARM\ARMCC\include\stdio.h)(0x5E8E3CC2)
|
||||
F (..\User\device\lcd_driver\lcd.h)(0x692A51B9)()
|
||||
F (..\User\device\lcd_driver\lcd_lib.h)(0x692A5F31)()
|
||||
F (..\User\device\lcd_driver\lcd.h)(0x692ABE66)()
|
||||
F (..\User\device\lcd_driver\lcd_lib.h)(0x692ABE66)()
|
||||
F (..\User\component\crc8.c)(0x691D6BB5)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -O3 --apcs=interwork --split_sections -I ../Core/Inc -I ../Drivers/STM32F1xx_HAL_Driver/Inc -I ../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I ../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I ../Drivers/CMSIS/Include -I ../sx1281-driver-c -I ../User
-I.\RTE\_MR16
-ID:\cangming\ARM\CMSIS\5.7.0\CMSIS\Core\Include
-ID:\cangming\keil\STM32F1xx_DFP\2.0.0\Device\Include
-D__UVISION_VERSION="534" -D_RTE_ -DSTM32F10X_MD -D_RTE_ -DUSE_HAL_DRIVER -DSTM32F103xB
-o mr16\crc8.o --omf_browse mr16\crc8.crf --depend mr16\crc8.d)
|
||||
I (..\User\component\crc8.h)(0x691D6BB5)
|
||||
I (D:\cangming\ARM\ARMCC\include\stdbool.h)(0x5E8E3CC2)
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -39,13 +39,6 @@ return ch;
|
||||
*/
|
||||
#define FIRMWARE_VERSION ( ( char* )"Firmware Version: 170919A" )
|
||||
|
||||
#define RF_BL_ADV_CHANNEL_38 2426000000 // Hz
|
||||
|
||||
/*!
|
||||
* \brief Defines the nominal frequency
|
||||
*/
|
||||
#define RF_FREQUENCY RF_BL_ADV_CHANNEL_38 // Hz
|
||||
|
||||
/*!
|
||||
* \brief Defines the buffer size, i.e. the payload size
|
||||
*/
|
||||
@ -67,50 +60,120 @@ return ch;
|
||||
#define RX_TIMEOUT_TICK_SIZE RADIO_TICK_SIZE_1000_US
|
||||
|
||||
/**-------------------------radio params----------------------------------**/
|
||||
typedef struct {
|
||||
RadioGfskBleBitrates_t BitrateBandwidth; //!< The bandwidth and bit-rate values for BLE and GFSK modulations
|
||||
RadioGfskBleModIndexes_t ModulationIndex; //!< The coding rate for BLE and GFSK modulations
|
||||
RadioModShapings_t ModulationShaping; //!< The modulation shaping for BLE and GFSK modulations
|
||||
}SX1281_BLEConfig_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
RadioLoRaSpreadingFactors_t SpreadingFactor; //!< Spreading Factor for the LORA modulation
|
||||
RadioLoRaBandwidths_t Bandwidth; //!< Bandwidth for the LORA modulation
|
||||
RadioLoRaCodingRates_t CodingRate; //!< Coding rate for the LORA modulation
|
||||
}SX1281_LORAConfig_t;
|
||||
|
||||
typedef struct {
|
||||
RadioGfskBleBitrates_t BitrateBandwidth; //!< The bandwidth and bit-rate values for BLE and GFSK modulations
|
||||
RadioGfskBleModIndexes_t ModulationIndex; //!< The coding rate for BLE and GFSK modulations
|
||||
RadioModShapings_t ModulationShaping; //!< The modulation shaping for BLE and GFSK modulations
|
||||
}SX1281_GFSKConfig_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
RadioFlrcBitrates_t BitrateBandwidth; //!< The bandwidth and bit-rate values for FLRC modulation
|
||||
RadioFlrcCodingRates_t CodingRate; //!< The coding rate for FLRC modulation
|
||||
RadioModShapings_t ModulationShaping; //!< The modulation shaping for FLRC modulation
|
||||
}SX1281_FLRCConfig_t;
|
||||
|
||||
const SX1281_BLEConfig_t bleConfigList[RF_BAUDRATE_BLE_NUM] =
|
||||
{
|
||||
{
|
||||
.BitrateBandwidth = GFS_BLE_BR_0_250_BW_0_6, // 250 Kbps, 0.6 MHz
|
||||
.ModulationIndex = GFS_BLE_MOD_IND_0_50, // 调制指数 0.5
|
||||
.ModulationShaping = RADIO_MOD_SHAPING_BT_0_5 // 调制整形 BT = 0.5
|
||||
},
|
||||
{
|
||||
.BitrateBandwidth = GFS_BLE_BR_0_500_BW_1_2, // 500 Kbps, 1.2 MHz
|
||||
.ModulationIndex = GFS_BLE_MOD_IND_0_50, // 调制指数 0.5
|
||||
.ModulationShaping = RADIO_MOD_SHAPING_BT_0_5 // 调制整形 BT = 0.5
|
||||
},
|
||||
{
|
||||
.BitrateBandwidth = GFS_BLE_BR_1_000_BW_2_4, // 1 Mbps, 2.4 MHz
|
||||
.ModulationIndex = GFS_BLE_MOD_IND_0_50, // 调制指数 0.5
|
||||
.ModulationShaping = RADIO_MOD_SHAPING_BT_0_5 // 调制整形 BT = 0.5
|
||||
},
|
||||
};
|
||||
|
||||
const SX1281_LORAConfig_t loraConfigList[RF_BAUDRATE_LORA_NUM] =
|
||||
{
|
||||
{//216.264204545455bps,SF=12,BW=203kHz,CR=7
|
||||
.SpreadingFactor = LORA_SF12,
|
||||
.SignalBw = LORA_BW_0200,
|
||||
.ErrorCoding = LORA_CR_LI_4_7,
|
||||
.Bandwidth = LORA_BW_0200,
|
||||
.CodingRate = LORA_CR_LI_4_7,
|
||||
},
|
||||
{//991.2109375bps,SF=10,BW=203kHz,CR=4
|
||||
.SpreadingFactor = LORA_SF10,
|
||||
.SignalBw = LORA_BW_0200,
|
||||
.ErrorCoding = LORA_CR_4_8,
|
||||
.Bandwidth = LORA_BW_0200,
|
||||
.CodingRate = LORA_CR_4_8,
|
||||
},
|
||||
{//4987.44419642857bps,SF=11,BW=1625kHz,CR=3
|
||||
.SpreadingFactor = LORA_SF11,
|
||||
.SignalBw = LORA_BW_1600,
|
||||
.ErrorCoding = LORA_CR_4_7,
|
||||
.Bandwidth = LORA_BW_1600,
|
||||
.CodingRate = LORA_CR_4_7,
|
||||
},
|
||||
{//10150bps,SF=8,BW=812kHz,CR=6
|
||||
.SpreadingFactor = LORA_SF8,
|
||||
.SignalBw = LORA_BW_0800,
|
||||
.ErrorCoding = LORA_CR_LI_4_6,
|
||||
.Bandwidth = LORA_BW_0800,
|
||||
.CodingRate = LORA_CR_LI_4_6,
|
||||
},
|
||||
{//20300bps,SF=8,BW=812kHz,CR=1
|
||||
.SpreadingFactor = LORA_SF8,
|
||||
.SignalBw = LORA_BW_0800,
|
||||
.ErrorCoding = LORA_CR_4_5,
|
||||
.Bandwidth = LORA_BW_0800,
|
||||
.CodingRate = LORA_CR_4_5,
|
||||
},
|
||||
{//60900bps,SF=6,BW=812kHz,CR=1
|
||||
.SpreadingFactor = LORA_SF6,
|
||||
.SignalBw = LORA_BW_0800,
|
||||
.ErrorCoding = LORA_CR_4_5,
|
||||
.Bandwidth = LORA_BW_0800,
|
||||
.CodingRate = LORA_CR_4_5,
|
||||
},
|
||||
{//126953.125bps,SF=5,BW=1625kHz,CR=4
|
||||
.SpreadingFactor = LORA_SF5,
|
||||
.SignalBw = LORA_BW_1600,
|
||||
.ErrorCoding = LORA_CR_4_8,
|
||||
.Bandwidth = LORA_BW_1600,
|
||||
.CodingRate = LORA_CR_4_8,
|
||||
},
|
||||
{//203125bps,SF=5,BW=1625kHz,CR=1
|
||||
.SpreadingFactor = LORA_SF5,
|
||||
.SignalBw = LORA_BW_1600,
|
||||
.ErrorCoding = LORA_CR_4_5,
|
||||
.Bandwidth = LORA_BW_1600,
|
||||
.CodingRate = LORA_CR_4_5,
|
||||
},
|
||||
};
|
||||
const SX1281_FLRCConfig_t flrcConfigList[RF_BAUDRATE_FLRC_NUM-RF_BAUDRATE_LORA_NUM-1] =
|
||||
|
||||
const SX1281_GFSKConfig_t gfskConfigList[RF_BAUDRATE_GFSK_NUM] =
|
||||
{
|
||||
{
|
||||
.BitrateBandwidth = GFS_BLE_BR_0_125_BW_0_3, // 125 Kbps, 0.3 MHz
|
||||
.ModulationIndex = GFS_BLE_MOD_IND_0_50, // 调制指数 0.5
|
||||
.ModulationShaping = RADIO_MOD_SHAPING_BT_0_5 // 调制整形 BT = 0.5
|
||||
},
|
||||
{
|
||||
.BitrateBandwidth = GFS_BLE_BR_0_250_BW_0_6, // 250 Kbps, 0.6 MHz
|
||||
.ModulationIndex = GFS_BLE_MOD_IND_0_50, // 调制指数 0.5
|
||||
.ModulationShaping = RADIO_MOD_SHAPING_BT_0_5 // 调制整形 BT = 0.5
|
||||
},
|
||||
{
|
||||
.BitrateBandwidth = GFS_BLE_BR_0_500_BW_1_2, // 500 Kbps, 1.2 MHz
|
||||
.ModulationIndex = GFS_BLE_MOD_IND_0_50, // 调制指数 0.5
|
||||
.ModulationShaping = RADIO_MOD_SHAPING_BT_0_5 // 调制整形 BT = 0.5
|
||||
},
|
||||
{
|
||||
.BitrateBandwidth = GFS_BLE_BR_1_000_BW_2_4, // 1 Mbps, 2.4 MHz
|
||||
.ModulationIndex = GFS_BLE_MOD_IND_0_50, // 调制指数 0.5
|
||||
.ModulationShaping = RADIO_MOD_SHAPING_BT_0_5 // 调制整形 BT = 0.5
|
||||
}
|
||||
};
|
||||
|
||||
const SX1281_FLRCConfig_t flrcConfigList[RF_BAUDRATE_FLRC_NUM] =
|
||||
{
|
||||
{//0.13Mbps
|
||||
.BitrateBandwidth =FLRC_BR_0_260_BW_0_3,
|
||||
@ -134,7 +197,6 @@ const SX1281_FLRCConfig_t flrcConfigList[RF_BAUDRATE_FLRC_NUM-RF_BAUDRATE_LORA_N
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
/*!
|
||||
* \brief Defines the states of the application
|
||||
*/
|
||||
@ -233,28 +295,12 @@ typedef union
|
||||
BleAdvHeaders_t ble_header_adv;
|
||||
|
||||
|
||||
PacketParams_t packetParams;
|
||||
|
||||
ModulationParams_t modulationParams;
|
||||
|
||||
|
||||
int8_t SX1281_SetMode(SX1281_t *radio, SX1281_Mode_t mode) {
|
||||
if (radio==NULL) {
|
||||
return DEVICE_ERR;
|
||||
}
|
||||
|
||||
radio->mode = mode;
|
||||
|
||||
return DEVICE_OK;
|
||||
}
|
||||
|
||||
int8_t SX1281_Init(SX1281_t *radio, SX1281_Mode_t mode) {
|
||||
if (radio==NULL) {
|
||||
return DEVICE_ERR;
|
||||
}
|
||||
radio->mode = mode;
|
||||
|
||||
|
||||
SX1281_BSPInit() ;
|
||||
HAL_Delay( 500 );/* let DC/DC power ramp up */
|
||||
Radio.Init( &Callbacks );
|
||||
@ -263,102 +309,126 @@ int8_t SX1281_Init(SX1281_t *radio, SX1281_Mode_t mode) {
|
||||
|
||||
#ifdef SX1281_VIEW
|
||||
/* 打印版本号,检查SPI是否跑通 */
|
||||
printf( "\n\n\r SX1281 Ping Pong Demo Application. %s\n\n\r", FIRMWARE_VERSION );
|
||||
printf( "\n\n\r SX1281 Application. %s\n\n\r", FIRMWARE_VERSION );
|
||||
printf( "\n\n\r Radio firmware version 0x%x\n\n\r", Radio.GetFirmwareVersion( ) );
|
||||
#endif //SX1281_VIEW
|
||||
|
||||
radio->param.baudrate.ble=RF_BAUDRATE_BLE_1M;
|
||||
radio->param.baudrate.lora=RF_BAUDRATE_LORA_005K;
|
||||
radio->param.baudrate.gfks=RF_BAUDRATE_GFSK_125K;
|
||||
radio->param.baudrate.flrc=RF_BAUDRATE_FLRC_130K;
|
||||
|
||||
/* 根据模式选择属性 */
|
||||
switch (mode) {
|
||||
case MODE_BLE:
|
||||
#ifdef SX1281_VIEW
|
||||
printf( "\nrunning in BLE mode\n\r" );
|
||||
#endif //SX1281_VIEW
|
||||
radio->modulationParams.PacketType = PACKET_TYPE_BLE;
|
||||
radio->modulationParams.Params.Ble.BitrateBandwidth = GFS_BLE_BR_1_000_BW_1_2;
|
||||
radio->modulationParams.Params.Ble.ModulationIndex = GFS_BLE_MOD_IND_0_50;
|
||||
radio->modulationParams.Params.Ble.ModulationShaping = RADIO_MOD_SHAPING_BT_0_5;
|
||||
radio->param.modulationParams.PacketType = PACKET_TYPE_BLE;
|
||||
radio->param.modulationParams.Params.Ble.BitrateBandwidth
|
||||
= bleConfigList[radio->param.baudrate.ble].BitrateBandwidth;
|
||||
radio->param.modulationParams.Params.Ble.ModulationIndex
|
||||
= bleConfigList[radio->param.baudrate.ble].ModulationIndex;
|
||||
radio->param.modulationParams.Params.Ble.ModulationShaping
|
||||
= bleConfigList[radio->param.baudrate.ble].ModulationShaping;
|
||||
|
||||
radio->packetParams.PacketType = PACKET_TYPE_BLE;
|
||||
radio->packetParams.Params.Ble.BlePacketType = BLE_EYELONG_1_0;
|
||||
radio->packetParams.Params.Ble.ConnectionState = BLE_ADVERTISER;
|
||||
radio->packetParams.Params.Ble.CrcField = BLE_CRC_3B;
|
||||
radio->packetParams.Params.Ble.Whitening = RADIO_WHITENING_ON;
|
||||
|
||||
radio->baudrate=RF_BAUDRATE_NONE;
|
||||
radio->param.packetParams.PacketType = PACKET_TYPE_BLE;
|
||||
radio->param.packetParams.Params.Ble.BlePacketType = BLE_EYELONG_1_0;
|
||||
radio->param.packetParams.Params.Ble.ConnectionState = BLE_ADVERTISER;
|
||||
radio->param.packetParams.Params.Ble.CrcField = BLE_CRC_3B;
|
||||
radio->param.packetParams.Params.Ble.Whitening = RADIO_WHITENING_ON;
|
||||
break;
|
||||
case MODE_LORA:
|
||||
#ifdef SX1281_VIEW
|
||||
printf( "\nrunning in LORA mode\n\r" );
|
||||
#endif //SX1281_VIEW
|
||||
radio->modulationParams.PacketType = PACKET_TYPE_LORA;
|
||||
radio->modulationParams.Params.LoRa.SpreadingFactor = LORA_SF11;
|
||||
radio->modulationParams.Params.LoRa.Bandwidth = LORA_BW_1600;
|
||||
radio->modulationParams.Params.LoRa.CodingRate = LORA_CR_LI_4_7;
|
||||
radio->param.modulationParams.PacketType = PACKET_TYPE_LORA;
|
||||
radio->param.modulationParams.Params.LoRa.SpreadingFactor
|
||||
= loraConfigList[radio->param.baudrate.lora].SpreadingFactor;
|
||||
radio->param.modulationParams.Params.LoRa.Bandwidth
|
||||
= loraConfigList[radio->param.baudrate.lora].Bandwidth;
|
||||
radio->param.modulationParams.Params.LoRa.CodingRate
|
||||
= loraConfigList[radio->param.baudrate.lora].CodingRate;
|
||||
|
||||
radio->packetParams.PacketType = PACKET_TYPE_LORA;
|
||||
radio->packetParams.Params.LoRa.PreambleLength = 12;
|
||||
radio->packetParams.Params.LoRa.HeaderType = LORA_PACKET_VARIABLE_LENGTH;
|
||||
radio->packetParams.Params.LoRa.PayloadLength = BUFFER_SIZE;
|
||||
radio->packetParams.Params.LoRa.CrcMode = LORA_CRC_ON;
|
||||
radio->packetParams.Params.LoRa.InvertIQ = LORA_IQ_NORMAL;
|
||||
|
||||
radio->baudrate=RF_BAUDRATE_LORA_005K;
|
||||
radio->param.packetParams.PacketType = PACKET_TYPE_LORA;
|
||||
radio->param.packetParams.Params.LoRa.PreambleLength = 12;
|
||||
radio->param.packetParams.Params.LoRa.HeaderType = LORA_PACKET_VARIABLE_LENGTH;
|
||||
radio->param.packetParams.Params.LoRa.PayloadLength = BUFFER_SIZE;
|
||||
radio->param.packetParams.Params.LoRa.CrcMode = LORA_CRC_ON;
|
||||
radio->param.packetParams.Params.LoRa.InvertIQ = LORA_IQ_NORMAL;
|
||||
break;
|
||||
case MODE_GFSK:
|
||||
#ifdef SX1281_VIEW
|
||||
printf( "\nrunning in GFSK mode\n\r" );
|
||||
#endif //SX1281_VIEW
|
||||
radio->modulationParams.PacketType = PACKET_TYPE_GFSK;
|
||||
radio->modulationParams.Params.Gfsk.BitrateBandwidth = GFS_BLE_BR_0_125_BW_0_3;
|
||||
radio->modulationParams.Params.Gfsk.ModulationIndex = GFS_BLE_MOD_IND_1_00;
|
||||
radio->modulationParams.Params.Gfsk.ModulationShaping = RADIO_MOD_SHAPING_BT_1_0;
|
||||
radio->param.modulationParams.PacketType = PACKET_TYPE_GFSK;
|
||||
radio->param.modulationParams.Params.Gfsk.BitrateBandwidth
|
||||
= gfskConfigList[radio->param.baudrate.gfks].BitrateBandwidth;
|
||||
radio->param.modulationParams.Params.Gfsk.ModulationIndex
|
||||
= gfskConfigList[radio->param.baudrate.gfks].ModulationIndex;
|
||||
radio->param.modulationParams.Params.Gfsk.ModulationShaping
|
||||
= gfskConfigList[radio->param.baudrate.gfks].ModulationShaping;
|
||||
|
||||
radio->packetParams.PacketType = PACKET_TYPE_GFSK;
|
||||
radio->packetParams.Params.Gfsk.PreambleLength = PREAMBLE_LENGTH_32_BITS;
|
||||
radio->packetParams.Params.Gfsk.SyncWordLength = GFS_SYNCWORD_LENGTH_5_BYTE;
|
||||
radio->packetParams.Params.Gfsk.SyncWordMatch = RADIO_RX_MATCH_SYNCWORD_1;
|
||||
radio->packetParams.Params.Gfsk.HeaderType = RADIO_PACKET_VARIABLE_LENGTH;
|
||||
radio->packetParams.Params.Gfsk.PayloadLength = BUFFER_SIZE;
|
||||
radio->packetParams.Params.Gfsk.CrcLength = RADIO_CRC_3_BYTES;
|
||||
radio->packetParams.Params.Gfsk.Whitening = RADIO_WHITENING_ON;
|
||||
|
||||
radio->baudrate=RF_BAUDRATE_NONE;
|
||||
radio->param.packetParams.PacketType = PACKET_TYPE_GFSK;
|
||||
radio->param.packetParams.Params.Gfsk.PreambleLength = PREAMBLE_LENGTH_32_BITS;
|
||||
radio->param.packetParams.Params.Gfsk.SyncWordLength = GFS_SYNCWORD_LENGTH_5_BYTE;
|
||||
radio->param.packetParams.Params.Gfsk.SyncWordMatch = RADIO_RX_MATCH_SYNCWORD_1;
|
||||
radio->param.packetParams.Params.Gfsk.HeaderType = RADIO_PACKET_VARIABLE_LENGTH;
|
||||
radio->param.packetParams.Params.Gfsk.PayloadLength = BUFFER_SIZE;
|
||||
radio->param.packetParams.Params.Gfsk.CrcLength = RADIO_CRC_3_BYTES;
|
||||
radio->param.packetParams.Params.Gfsk.Whitening = RADIO_WHITENING_ON;
|
||||
break;
|
||||
case MODE_FLRC:
|
||||
#ifdef SX1281_VIEW
|
||||
printf( "\nrunning in FLRC mode\n\r" );
|
||||
#endif //SX1281_VIEW
|
||||
radio->modulationParams.PacketType = PACKET_TYPE_FLRC;
|
||||
radio->modulationParams.Params.Flrc.BitrateBandwidth = FLRC_BR_0_260_BW_0_3;
|
||||
radio->modulationParams.Params.Flrc.CodingRate = FLRC_CR_1_2;
|
||||
radio->modulationParams.Params.Flrc.ModulationShaping = RADIO_MOD_SHAPING_BT_1_0;
|
||||
radio->param.modulationParams.PacketType = PACKET_TYPE_FLRC;
|
||||
radio->param.modulationParams.Params.Flrc.BitrateBandwidth
|
||||
= flrcConfigList[radio->param.baudrate.flrc].BitrateBandwidth;
|
||||
radio->param.modulationParams.Params.Flrc.CodingRate
|
||||
= flrcConfigList[radio->param.baudrate.flrc].CodingRate;
|
||||
radio->param.modulationParams.Params.Flrc.ModulationShaping
|
||||
= flrcConfigList[radio->param.baudrate.flrc].ModulationShaping;
|
||||
|
||||
radio->packetParams.PacketType = PACKET_TYPE_FLRC;
|
||||
radio->packetParams.Params.Flrc.PreambleLength = PREAMBLE_LENGTH_32_BITS;
|
||||
radio->packetParams.Params.Flrc.SyncWordLength = FLRC_SYNCWORD_LENGTH_4_BYTE;
|
||||
radio->packetParams.Params.Flrc.SyncWordMatch = RADIO_RX_MATCH_SYNCWORD_1;
|
||||
radio->packetParams.Params.Flrc.HeaderType = RADIO_PACKET_VARIABLE_LENGTH;
|
||||
radio->packetParams.Params.Flrc.PayloadLength = BUFFER_SIZE;
|
||||
radio->packetParams.Params.Flrc.CrcLength = RADIO_CRC_3_BYTES;
|
||||
radio->packetParams.Params.Flrc.Whitening = RADIO_WHITENING_OFF;
|
||||
radio->param.packetParams.PacketType = PACKET_TYPE_FLRC;
|
||||
radio->param.packetParams.Params.Flrc.PreambleLength = PREAMBLE_LENGTH_32_BITS;
|
||||
radio->param.packetParams.Params.Flrc.SyncWordLength = FLRC_SYNCWORD_LENGTH_4_BYTE;
|
||||
radio->param.packetParams.Params.Flrc.SyncWordMatch = RADIO_RX_MATCH_SYNCWORD_1;
|
||||
radio->param.packetParams.Params.Flrc.HeaderType = RADIO_PACKET_VARIABLE_LENGTH;
|
||||
radio->param.packetParams.Params.Flrc.PayloadLength = BUFFER_SIZE;
|
||||
radio->param.packetParams.Params.Flrc.CrcLength = RADIO_CRC_3_BYTES;
|
||||
radio->param.packetParams.Params.Flrc.Whitening = RADIO_WHITENING_OFF;
|
||||
|
||||
radio->baudrate=RF_BAUDRATE_FLRC_130K;
|
||||
break;
|
||||
default:
|
||||
return DEVICE_ERR;
|
||||
}
|
||||
|
||||
/* 默认功率13dBm */
|
||||
radio->txOutputPower=13;
|
||||
|
||||
radio->param.txOutputPower=13;
|
||||
radio->param.rampTime=RADIO_RAMP_02_US;
|
||||
radio->param.rfFrequency=2426000000;
|
||||
// 设置同步字
|
||||
if (radio->mode==MODE_GFSK) {
|
||||
uint8_t syncWord1[5] = {0x12, 0x34, 0x56, 0x78, 0x9A};
|
||||
// uint8_t syncWord2[5] = {0x01, 0x02, 0x03, 0x04, 0x05};
|
||||
// uint8_t syncWord3[5] = {0x23, 0x45, 0x67, 0x89, 0xAB};
|
||||
Radio.SetSyncWord(1, syncWord1); // 设置第一个同步字
|
||||
}
|
||||
if (radio->mode==MODE_FLRC) {
|
||||
uint8_t syncWord1[4] = {0x12, 0x34, 0x56, 0x78}; // 示例同步字
|
||||
// uint8_t syncWord2[5] = {0x01, 0x02, 0x03, 0x04,};
|
||||
// uint8_t syncWord3[5] = {0x23, 0x45, 0x67, 0x89,};
|
||||
Radio.SetSyncWord(1, syncWord1); // 设置第一个同步字
|
||||
}
|
||||
/* 设置属性 */
|
||||
Radio.SetStandby( STDBY_RC );
|
||||
Radio.SetPacketType( modulationParams.PacketType );
|
||||
Radio.SetModulationParams( &modulationParams );
|
||||
Radio.SetPacketParams( &packetParams );
|
||||
Radio.SetRfFrequency( RF_FREQUENCY );//设置射频工作中心频率
|
||||
Radio.SetBufferBaseAddresses( 0x00, 0x00 );
|
||||
Radio.SetTxParams( radio->txOutputPower, RADIO_RAMP_02_US );
|
||||
Radio.SetPacketType( radio->param.modulationParams.PacketType );//包类型
|
||||
Radio.SetModulationParams( &radio->param.modulationParams );//调制属性
|
||||
Radio.SetPacketParams( &radio->param.packetParams );//包属性
|
||||
Radio.SetRfFrequency( radio->param.rfFrequency );//设置射频工作中心频率
|
||||
Radio.SetBufferBaseAddresses( 0x00, 0x00 );//缓冲区起始地址
|
||||
Radio.SetTxParams( radio->param.txOutputPower, radio->param.rampTime);//发送属性
|
||||
|
||||
#ifdef SX1281_INTERRUP_MODE
|
||||
/* 中断模式 */
|
||||
@ -370,96 +440,109 @@ int8_t SX1281_Init(SX1281_t *radio, SX1281_Mode_t mode) {
|
||||
#endif
|
||||
|
||||
/* 还没搞懂这里是干啥的 */
|
||||
if (radio->mode==MODE_BLE) {
|
||||
// only used in GENERIC and BLE mode
|
||||
Radio.SetSyncWord( 1, ( uint8_t[] ){ 0xDD, 0xA0, 0x96, 0x69, 0xDD } );
|
||||
Radio.WriteRegister(0x9c7, 0x55 );
|
||||
Radio.WriteRegister(0x9c8, 0x55 );
|
||||
Radio.WriteRegister(0x9c9, 0x55 );
|
||||
//Radio.WriteRegister( 0x9c5, 0x33 );
|
||||
Radio.SetBleAdvertizerAccessAddress( );
|
||||
Radio.SetWhiteningSeed( 0x33 );
|
||||
ble_header_adv.Fields.length = 2;
|
||||
ble_header_adv.Fields.pduType = 2;
|
||||
}
|
||||
// if (radio->mode==MODE_BLE) {
|
||||
// // only used in GENERIC and BLE mode
|
||||
// Radio.SetSyncWord( 1, ( uint8_t[] ){ 0xDD, 0xA0, 0x96, 0x69, 0xDD } );
|
||||
// Radio.WriteRegister(0x9c7, 0x55 );
|
||||
// Radio.WriteRegister(0x9c8, 0x55 );
|
||||
// Radio.WriteRegister(0x9c9, 0x55 );
|
||||
// //Radio.WriteRegister( 0x9c5, 0x33 );
|
||||
// Radio.SetBleAdvertizerAccessAddress( );
|
||||
// Radio.SetWhiteningSeed( 0x33 );
|
||||
// ble_header_adv.Fields.length = 2;
|
||||
// ble_header_adv.Fields.pduType = 2;
|
||||
// }
|
||||
return DEVICE_OK;
|
||||
}
|
||||
|
||||
int8_t SX1281_SetRFFrequency(SX1281_t *radio, uint32_t frequency) {
|
||||
if (radio==NULL) {
|
||||
return DEVICE_ERR;
|
||||
}
|
||||
Radio.SetStandby( STDBY_RC );
|
||||
Radio.SetPacketType( radio->param.modulationParams.PacketType );
|
||||
|
||||
radio->param.rfFrequency=frequency;
|
||||
Radio.SetRfFrequency( radio->param.rfFrequency );//设置射频工作中心频率
|
||||
return DEVICE_OK;
|
||||
}
|
||||
|
||||
|
||||
/////蓝牙还没研究明白
|
||||
void SetBLEAdvertisingPacket(SX1281_t *radio, uint8_t *data, uint8_t length) {
|
||||
if (radio->mode != MODE_BLE) {
|
||||
printf("Error: Not in BLE mode\n");
|
||||
return;
|
||||
}
|
||||
// if (radio->mode != MODE_BLE) {
|
||||
// printf("Error: Not in BLE mode\n");
|
||||
// return;
|
||||
// }
|
||||
|
||||
// 检查数据长度是否符合BLE规范
|
||||
if (length > 37) { // BLE广告PDU最大有效载荷为37字节
|
||||
printf("Error: BLE advertising data too long: %d bytes (max 37)\n", length);
|
||||
return;
|
||||
}
|
||||
// // 检查数据长度是否符合BLE规范
|
||||
// if (length > 37) { // BLE广告PDU最大有效载荷为37字节
|
||||
// printf("Error: BLE advertising data too long: %d bytes (max 37)\n", length);
|
||||
// return;
|
||||
// }
|
||||
|
||||
// 根据BLE规范构建PDU报头
|
||||
uint8_t pduHeader[2] = {0};
|
||||
// // 根据BLE规范构建PDU报头
|
||||
// uint8_t pduHeader[2] = {0};
|
||||
|
||||
// 第一字节: PDU类型(4位) + RFU(2位) + TxAdd(1位) + RxAdd(1位)
|
||||
// ADV_IND类型 = 0x0, TxAdd=1(随机地址), RxAdd=0
|
||||
pduHeader[0] = (0x0 << 4) | (0x0 << 2) | (0x1 << 1) | (0x0 << 0);
|
||||
// // 第一字节: PDU类型(4位) + RFU(2位) + TxAdd(1位) + RxAdd(1位)
|
||||
// // ADV_IND类型 = 0x0, TxAdd=1(随机地址), RxAdd=0
|
||||
// pduHeader[0] = (0x0 << 4) | (0x0 << 2) | (0x1 << 1) | (0x0 << 0);
|
||||
|
||||
// 第二字节: 长度(6位) + RFU(2位)
|
||||
// 长度不包括报头本身,只包括有效载荷
|
||||
pduHeader[1] = (length & 0x3F) | (0x0 << 6);
|
||||
// // 第二字节: 长度(6位) + RFU(2位)
|
||||
// // 长度不包括报头本身,只包括有效载荷
|
||||
// pduHeader[1] = (length & 0x3F) | (0x0 << 6);
|
||||
|
||||
printf("PDU Header: 0x%02X 0x%02X\n", pduHeader[0], pduHeader[1]);
|
||||
printf("Payload length: %d\n", length);
|
||||
// printf("PDU Header: 0x%02X 0x%02X\n", pduHeader[0], pduHeader[1]);
|
||||
// printf("Payload length: %d\n", length);
|
||||
|
||||
// 组合完整的PDU: 报头(2字节) + 有效载荷
|
||||
uint8_t completePdu[2 + length];
|
||||
completePdu[0] = pduHeader[0];
|
||||
completePdu[1] = pduHeader[1];
|
||||
memcpy(&completePdu[2], data, length);
|
||||
// // 组合完整的PDU: 报头(2字节) + 有效载荷
|
||||
// uint8_t completePdu[2 + length];
|
||||
// completePdu[0] = pduHeader[0];
|
||||
// completePdu[1] = pduHeader[1];
|
||||
// memcpy(&completePdu[2], data, length);
|
||||
|
||||
// 设置BLE模式
|
||||
Radio.SetStandby(STDBY_RC);
|
||||
Radio.SetPacketType(PACKET_TYPE_BLE);
|
||||
// // 设置BLE模式
|
||||
// Radio.SetStandby(STDBY_RC);
|
||||
// Radio.SetPacketType(PACKET_TYPE_BLE);
|
||||
|
||||
// 设置调制参数
|
||||
ModulationParams_t modulationParams;
|
||||
modulationParams.PacketType = PACKET_TYPE_BLE;
|
||||
modulationParams.Params.Ble.BitrateBandwidth = GFS_BLE_BR_1_000_BW_1_2;
|
||||
modulationParams.Params.Ble.ModulationIndex = GFS_BLE_MOD_IND_0_50;
|
||||
modulationParams.Params.Ble.ModulationShaping = RADIO_MOD_SHAPING_BT_0_5;
|
||||
Radio.SetModulationParams(&modulationParams);
|
||||
// // 设置调制参数
|
||||
// ModulationParams_t modulationParams;
|
||||
// modulationParams.PacketType = PACKET_TYPE_BLE;
|
||||
// modulationParams.Params.Ble.BitrateBandwidth = GFS_BLE_BR_1_000_BW_1_2;
|
||||
// modulationParams.Params.Ble.ModulationIndex = GFS_BLE_MOD_IND_0_50;
|
||||
// modulationParams.Params.Ble.ModulationShaping = RADIO_MOD_SHAPING_BT_0_5;
|
||||
// Radio.SetModulationParams(&modulationParams);
|
||||
|
||||
// 设置包参数 - BLE模式下没有PayloadLength字段
|
||||
PacketParams_t packetParams;
|
||||
packetParams.PacketType = PACKET_TYPE_BLE;
|
||||
packetParams.Params.Ble.BlePacketType = BLE_EYELONG_1_0;
|
||||
packetParams.Params.Ble.ConnectionState = BLE_ADVERTISER;
|
||||
packetParams.Params.Ble.CrcField = BLE_CRC_3B;
|
||||
packetParams.Params.Ble.Whitening = RADIO_WHITENING_ON;
|
||||
Radio.SetPacketParams(&packetParams);
|
||||
// // 设置包参数 - BLE模式下没有PayloadLength字段
|
||||
// PacketParams_t packetParams;
|
||||
// packetParams.PacketType = PACKET_TYPE_BLE;
|
||||
// packetParams.Params.Ble.BlePacketType = BLE_EYELONG_1_0;
|
||||
// packetParams.Params.Ble.ConnectionState = BLE_ADVERTISER;
|
||||
// packetParams.Params.Ble.CrcField = BLE_CRC_3B;
|
||||
// packetParams.Params.Ble.Whitening = RADIO_WHITENING_ON;
|
||||
// Radio.SetPacketParams(&packetParams);
|
||||
|
||||
// 设置频率 - BLE广告信道38: 2426000000 Hz
|
||||
Radio.SetRfFrequency(RF_FREQUENCY);
|
||||
// // 设置频率 - BLE广告信道38: 2426000000 Hz
|
||||
// Radio.SetRfFrequency(radio->param.rfFrequency);
|
||||
|
||||
// 设置BLE特定参数
|
||||
Radio.SetSyncWord(1, (uint8_t[]){0xDD, 0xA0, 0x96, 0x69, 0xDD});
|
||||
Radio.SetBleAdvertizerAccessAddress();
|
||||
Radio.SetWhiteningSeed(0x33);
|
||||
// // 设置BLE特定参数
|
||||
// Radio.SetSyncWord(1, (uint8_t[]){0xDD, 0xA0, 0x96, 0x69, 0xDD});
|
||||
// Radio.SetBleAdvertizerAccessAddress();
|
||||
// Radio.SetWhiteningSeed(0x33);
|
||||
|
||||
// 写入寄存器配置
|
||||
Radio.WriteRegister(0x9C7, 0x55);
|
||||
Radio.WriteRegister(0x9C8, 0x55);
|
||||
Radio.WriteRegister(0x9C9, 0x55);
|
||||
// // 写入寄存器配置
|
||||
// Radio.WriteRegister(0x9C7, 0x55);
|
||||
// Radio.WriteRegister(0x9C8, 0x55);
|
||||
// Radio.WriteRegister(0x9C9, 0x55);
|
||||
|
||||
// 设置中断参数并发送完整的PDU
|
||||
uint16_t TxIrqMask = IRQ_TX_DONE | IRQ_RX_TX_TIMEOUT;
|
||||
Radio.SetDioIrqParams(TxIrqMask, TxIrqMask, IRQ_RADIO_NONE, IRQ_RADIO_NONE);
|
||||
// // 设置中断参数并发送完整的PDU
|
||||
// uint16_t TxIrqMask = IRQ_TX_DONE | IRQ_RX_TX_TIMEOUT;
|
||||
// Radio.SetDioIrqParams(TxIrqMask, TxIrqMask, IRQ_RADIO_NONE, IRQ_RADIO_NONE);
|
||||
|
||||
// 发送完整的PDU(报头+有效载荷)
|
||||
Radio.SendPayload(completePdu, length + 2, (TickTime_t){RX_TIMEOUT_TICK_SIZE, TX_TIMEOUT_VALUE});
|
||||
// // 发送完整的PDU(报头+有效载荷)
|
||||
// Radio.SendPayload(completePdu, length + 2, (TickTime_t){RX_TIMEOUT_TICK_SIZE, TX_TIMEOUT_VALUE});
|
||||
|
||||
printf("BLE Advertising packet sent, total PDU length: %d\n", length + 2);
|
||||
// printf("BLE Advertising packet sent, total PDU length: %d\n", length + 2);
|
||||
}
|
||||
|
||||
|
||||
@ -481,45 +564,126 @@ int8_t SX1281_SetTX (void) {
|
||||
return DEVICE_OK;
|
||||
}
|
||||
|
||||
int8_t SX1281_SetBaudrate(SX1281_t *radio, SX1281_Baudrate_t baudrate) {
|
||||
|
||||
int8_t SX1281_SetMode(SX1281_t *radio, SX1281_Mode_t mode) {
|
||||
if (radio==NULL) {
|
||||
return DEVICE_ERR;
|
||||
}
|
||||
radio->baudrate=baudrate;
|
||||
Radio.SetStandby( STDBY_RC );
|
||||
|
||||
Radio.SetPacketType( radio->param.modulationParams.PacketType );
|
||||
radio->mode = mode;
|
||||
switch (radio->mode) {
|
||||
case MODE_BLE:
|
||||
case MODE_GFSK:
|
||||
return DEVICE_OK;
|
||||
case MODE_LORA:
|
||||
if (radio->modulationParams.PacketType != PACKET_TYPE_LORA) {
|
||||
#ifdef SX1281_VIEW
|
||||
printf("error: <sx1281.c> Incorrect parameter");
|
||||
#endif
|
||||
return DEVICE_ERR;
|
||||
}
|
||||
// radio->modulationParams.Params.LoRa.SpreadingFactor = loraConfigList[baudrate].SpreadingFactor;
|
||||
// radio->modulationParams.Params.LoRa.Bandwidth = loraConfigList[baudrate].SignalBw;
|
||||
// radio->modulationParams.Params.LoRa.CodingRate = loraConfigList[baudrate].ErrorCoding;
|
||||
radio->param.modulationParams.PacketType = PACKET_TYPE_BLE;
|
||||
radio->param.packetParams.PacketType = PACKET_TYPE_BLE;
|
||||
Radio.SetPacketType( radio->param.modulationParams.PacketType );
|
||||
Radio.SetModulationParams( &radio->param.modulationParams );
|
||||
Radio.SetPacketParams( &radio->param.packetParams );
|
||||
break;
|
||||
case MODE_LORA:
|
||||
radio->param.modulationParams.PacketType = PACKET_TYPE_LORA;
|
||||
radio->param.packetParams.PacketType = PACKET_TYPE_LORA;
|
||||
Radio.SetPacketType( radio->param.modulationParams.PacketType );
|
||||
Radio.SetModulationParams( &radio->param.modulationParams );
|
||||
Radio.SetPacketParams( &radio->param.packetParams );
|
||||
break;
|
||||
case MODE_GFSK:
|
||||
radio->param.modulationParams.PacketType = PACKET_TYPE_GFSK;
|
||||
radio->param.packetParams.PacketType = PACKET_TYPE_LORA;
|
||||
Radio.SetPacketType( radio->param.modulationParams.PacketType );
|
||||
Radio.SetModulationParams( &radio->param.modulationParams );
|
||||
Radio.SetPacketParams( &radio->param.packetParams );
|
||||
break;
|
||||
|
||||
case MODE_FLRC:
|
||||
if (radio->modulationParams.PacketType != PACKET_TYPE_FLRC) {
|
||||
#ifdef SX1281_VIEW
|
||||
printf("error: <sx1281.c> Incorrect parameter");
|
||||
#endif
|
||||
return DEVICE_ERR;
|
||||
}
|
||||
// radio->modulationParams.Params.Flrc.BitrateBandwidth = flrcConfigList[baudrate-(RF_BAUDRATE_LORA_NUM+1)].BitrateBandwidth;
|
||||
// radio->modulationParams.Params.Flrc.CodingRate = flrcConfigList[baudrate-(RF_BAUDRATE_LORA_NUM+1)].CodingRate;
|
||||
// radio->modulationParams.Params.Flrc.ModulationShaping = flrcConfigList[baudrate-(RF_BAUDRATE_LORA_NUM+1)].ModulationShaping;
|
||||
radio->param.modulationParams.PacketType = PACKET_TYPE_FLRC;
|
||||
radio->param.packetParams.PacketType = PACKET_TYPE_LORA;
|
||||
Radio.SetPacketType( radio->param.modulationParams.PacketType );
|
||||
Radio.SetModulationParams( &radio->param.modulationParams );
|
||||
Radio.SetPacketParams( &radio->param.packetParams );
|
||||
break;
|
||||
default:
|
||||
return DEVICE_ERR;
|
||||
break;
|
||||
}
|
||||
Radio.SetModulationParams( &radio->modulationParams );
|
||||
|
||||
return DEVICE_OK;
|
||||
}
|
||||
|
||||
int8_t SX1281_SetBLEBaudrate(SX1281_t *radio, SX1281_Baudrate_t baudrate) {
|
||||
if (radio==NULL) {
|
||||
return DEVICE_ERR;
|
||||
}
|
||||
radio->param.baudrate=baudrate;
|
||||
Radio.SetStandby( STDBY_RC );
|
||||
|
||||
radio->param.modulationParams.Params.Ble.BitrateBandwidth
|
||||
= bleConfigList[radio->param.baudrate.ble].BitrateBandwidth;
|
||||
radio->param.modulationParams.Params.Ble.ModulationIndex
|
||||
= bleConfigList[radio->param.baudrate.ble].ModulationIndex;
|
||||
radio->param.modulationParams.Params.Ble.ModulationShaping
|
||||
= bleConfigList[radio->param.baudrate.ble].ModulationShaping;
|
||||
|
||||
Radio.SetPacketType( radio->param.modulationParams.PacketType );
|
||||
Radio.SetModulationParams( &radio->param.modulationParams );
|
||||
|
||||
return DEVICE_OK;
|
||||
}
|
||||
|
||||
int8_t SX1281_SetLORABaudrate(SX1281_t *radio, SX1281_Baudrate_t baudrate) {
|
||||
if (radio==NULL) {
|
||||
return DEVICE_ERR;
|
||||
}
|
||||
radio->param.baudrate=baudrate;
|
||||
Radio.SetStandby( STDBY_RC );
|
||||
|
||||
radio->param.modulationParams.Params.LoRa.SpreadingFactor
|
||||
= loraConfigList[radio->param.baudrate.lora].SpreadingFactor;
|
||||
radio->param.modulationParams.Params.LoRa.Bandwidth
|
||||
= loraConfigList[radio->param.baudrate.lora].Bandwidth;
|
||||
radio->param.modulationParams.Params.LoRa.CodingRate
|
||||
= loraConfigList[radio->param.baudrate.lora].CodingRate;
|
||||
|
||||
Radio.SetPacketType( radio->param.modulationParams.PacketType );
|
||||
Radio.SetModulationParams( &radio->param.modulationParams );
|
||||
|
||||
return DEVICE_OK;
|
||||
}
|
||||
|
||||
int8_t SX1281_SetGFSKBaudrate(SX1281_t *radio, SX1281_Baudrate_t baudrate) {
|
||||
if (radio==NULL) {
|
||||
return DEVICE_ERR;
|
||||
}
|
||||
radio->param.baudrate=baudrate;
|
||||
Radio.SetStandby( STDBY_RC );
|
||||
|
||||
radio->param.modulationParams.Params.Gfsk.BitrateBandwidth
|
||||
= gfskConfigList[radio->param.baudrate.gfks].BitrateBandwidth;
|
||||
radio->param.modulationParams.Params.Gfsk.ModulationIndex
|
||||
= gfskConfigList[radio->param.baudrate.gfks].ModulationIndex;
|
||||
radio->param.modulationParams.Params.Gfsk.ModulationShaping
|
||||
= gfskConfigList[radio->param.baudrate.gfks].ModulationShaping;
|
||||
|
||||
Radio.SetPacketType( radio->param.modulationParams.PacketType );
|
||||
Radio.SetModulationParams( &radio->param.modulationParams );
|
||||
|
||||
return DEVICE_OK;
|
||||
}
|
||||
|
||||
int8_t SX1281_SetFLRCBaudrate(SX1281_t *radio, SX1281_Baudrate_t baudrate) {
|
||||
if (radio==NULL) {
|
||||
return DEVICE_ERR;
|
||||
}
|
||||
radio->param.baudrate=baudrate;
|
||||
Radio.SetStandby( STDBY_RC );
|
||||
|
||||
radio->param.modulationParams.Params.Flrc.BitrateBandwidth
|
||||
= flrcConfigList[radio->param.baudrate.flrc].BitrateBandwidth;
|
||||
radio->param.modulationParams.Params.Flrc.CodingRate
|
||||
= flrcConfigList[radio->param.baudrate.flrc].CodingRate;
|
||||
radio->param.modulationParams.Params.Flrc.ModulationShaping
|
||||
= flrcConfigList[radio->param.baudrate.flrc].ModulationShaping;
|
||||
|
||||
Radio.SetPacketType( radio->param.modulationParams.PacketType );
|
||||
Radio.SetModulationParams( &radio->param.modulationParams );
|
||||
|
||||
return DEVICE_OK;
|
||||
}
|
||||
@ -537,8 +701,7 @@ int8_t SX1281_SetPacketConfig(SX1281_t *radio) {
|
||||
* @brief 退出射频进入休眠
|
||||
*
|
||||
*/
|
||||
int8_t SX1281_SetSleep(SX1281_t *radio)
|
||||
{
|
||||
int8_t SX1281_SetSleep(SX1281_t *radio) {
|
||||
if (radio == 0)
|
||||
{
|
||||
return DEVICE_ERR;
|
||||
@ -554,22 +717,18 @@ int8_t SX1281_SetSleep(SX1281_t *radio)
|
||||
return DEVICE_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取射频波特率
|
||||
* @param : br->
|
||||
*/
|
||||
//SX1281_Baudrate_t SX1281_GetBaudrate(SX1281_t *radio)
|
||||
//{
|
||||
// if (radio==NULL)
|
||||
// {
|
||||
// return DEVICE_ERR;
|
||||
// }
|
||||
// // return radio->baudrate;
|
||||
//}
|
||||
int8_t SX1281_GetState(SX1281_t *radio) {
|
||||
if (radio==NULL) {
|
||||
return DEVICE_ERR;
|
||||
}
|
||||
radio->appState=sx1281_state;
|
||||
return DEVICE_OK;
|
||||
}
|
||||
|
||||
int8_t SX1281_Running() {
|
||||
int8_t SX1281_Running(SX1281_t *radio) {
|
||||
SX1281ProcessIrqs();
|
||||
HAL_Delay(10);
|
||||
SX1281_GetState(radio);
|
||||
HAL_Delay(5);
|
||||
return DEVICE_OK;
|
||||
}
|
||||
|
||||
|
||||
@ -43,8 +43,16 @@ typedef enum {
|
||||
LORA_CAD_DONE
|
||||
}SX1281_States_t;
|
||||
|
||||
|
||||
typedef enum{
|
||||
RF_BAUDRATE_LORA_216B=0,
|
||||
RF_BAUDRATE_BLE_250K=0,
|
||||
RF_BAUDRATE_BLE_500K,
|
||||
RF_BAUDRATE_BLE_1M,
|
||||
RF_BAUDRATE_BLE_NUM,
|
||||
}SX1281_BLEBaudrate_t;
|
||||
|
||||
typedef enum{
|
||||
RF_BAUDRATE_LORA_216=0,
|
||||
RF_BAUDRATE_LORA_001K,
|
||||
RF_BAUDRATE_LORA_005K,
|
||||
RF_BAUDRATE_LORA_010K,
|
||||
@ -53,40 +61,53 @@ typedef enum {
|
||||
RF_BAUDRATE_LORA_127K,
|
||||
RF_BAUDRATE_LORA_203K,
|
||||
RF_BAUDRATE_LORA_NUM,
|
||||
}SX1281_LORABaudrate_t;
|
||||
|
||||
RF_BAUDRATE_FLRC_130K,
|
||||
typedef enum{
|
||||
RF_BAUDRATE_GFSK_125K=0,
|
||||
RF_BAUDRATE_GFSK_250K,
|
||||
RF_BAUDRATE_GFSK_500K,
|
||||
RF_BAUDRATE_GFSK_1M,
|
||||
RF_BAUDRATE_GFSK_NUM,
|
||||
}SX1281_GFKSBaudrate_t;
|
||||
|
||||
typedef enum{
|
||||
RF_BAUDRATE_FLRC_130K=0,
|
||||
RF_BAUDRATE_FLRC_260K,
|
||||
RF_BAUDRATE_FLRC_520K,
|
||||
RF_BAUDRATE_FLRC_1040K,
|
||||
RF_BAUDRATE_FLRC_NUM,
|
||||
|
||||
RF_BAUDRATE_NONE
|
||||
}SX1281_Baudrate_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint8_t SignalBw; // LORA_BW_0200, LORA_BW_0400, LORA_BW_0800, LORA_BW_1600,
|
||||
uint8_t SpreadingFactor; // LORA_SF5~LORA_SF12
|
||||
uint8_t ErrorCoding; // 1-LORA_CR_4_5, 2-LORA_CR_4_6, 3-LORA_CR_4_7 , 4-LORA_CR_4_8 , 5-LORA_CR_LI_4_5, 6-LORA_CR_LI_4_6, 7-LORA_CR_LI_4_7,
|
||||
}SX1281_LORAConfig_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint8_t BitrateBandwidth; //@RadioFlrcBitrates_t
|
||||
uint8_t CodingRate; //@RadioFlrcCodingRates_t
|
||||
uint8_t ModulationShaping; //@RadioModShapings_t
|
||||
}SX1281_FLRCConfig_t;
|
||||
}SX1281_FLRCBaudrate_t;
|
||||
|
||||
typedef struct {
|
||||
SX1281_BLEBaudrate_t ble;
|
||||
SX1281_LORABaudrate_t lora;
|
||||
SX1281_GFKSBaudrate_t gfks;
|
||||
SX1281_FLRCBaudrate_t flrc;
|
||||
}SX1281_Baudrate_t;
|
||||
|
||||
int8_t txOutputPower;//The range of the output power is [-18..+13] dBm
|
||||
|
||||
typedef struct {
|
||||
PacketParams_t packetParams;
|
||||
|
||||
ModulationParams_t modulationParams;
|
||||
|
||||
uint64_t rfFrequency;//射频中心频率
|
||||
|
||||
int8_t txOutputPower;//发射功率 The range of the output power is [-18..+13] dBm
|
||||
RadioRampTimes_t rampTime;//发射斜坡时间
|
||||
|
||||
SX1281_Baudrate_t baudrate;//LORA,FLRC模式下不同调制方式的波特率
|
||||
|
||||
}SX1281_Params_t;
|
||||
|
||||
typedef struct {
|
||||
|
||||
SX1281_Params_t param;
|
||||
|
||||
SX1281_Mode_t mode;
|
||||
SX1281_Baudrate_t baudrate;
|
||||
|
||||
SX1281_States_t appState;
|
||||
|
||||
PacketStatus_t packetStatus;
|
||||
|
||||
int8_t rxBuffer[BUFFER_SIZE];
|
||||
@ -100,7 +121,7 @@ int8_t SX1281_Init(SX1281_t *radio, SX1281_Mode_t mode);
|
||||
int8_t SX1281_SetRXSingle(void);
|
||||
int8_t SX1281_SetRXSuccessive(void);
|
||||
int8_t SX1281_SetTX (void);
|
||||
int8_t SX1281_Running(void);
|
||||
int8_t SX1281_Running(SX1281_t *radio);
|
||||
|
||||
void SetBLEAdvertisingPacket(SX1281_t *radio, uint8_t *data, uint8_t length);
|
||||
/* USER FUNCTION END */
|
||||
|
||||
Loading…
Reference in New Issue
Block a user