123
This commit is contained in:
parent
80123176a2
commit
4e0c956e73
@ -71,7 +71,7 @@ void MX_GPIO_Init(void)
|
|||||||
|
|
||||||
/*Configure GPIO pin : KEY_Pin */
|
/*Configure GPIO pin : KEY_Pin */
|
||||||
GPIO_InitStruct.Pin = KEY_Pin;
|
GPIO_InitStruct.Pin = KEY_Pin;
|
||||||
GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING;
|
GPIO_InitStruct.Mode = GPIO_MODE_IT_FALLING;
|
||||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||||
HAL_GPIO_Init(KEY_GPIO_Port, &GPIO_InitStruct);
|
HAL_GPIO_Init(KEY_GPIO_Port, &GPIO_InitStruct);
|
||||||
|
|
||||||
|
|||||||
@ -76,8 +76,8 @@ return ch;
|
|||||||
/*!
|
/*!
|
||||||
* Select mode of operation for the Ping Ping application
|
* Select mode of operation for the Ping Ping application
|
||||||
*/
|
*/
|
||||||
#define MODE_BLE /* Bluetooth Low Energy */
|
// #define MODE_BLE /* Bluetooth Low Energy */
|
||||||
// #define MODE_LORA /* Long Range */
|
#define MODE_LORA /* Long Range */
|
||||||
// #define MODE_GFSK /* Gaussian Frequency Shift Keying */
|
// #define MODE_GFSK /* Gaussian Frequency Shift Keying */
|
||||||
// #define MODE_FLRC /* Fast Long Range Codec */
|
// #define MODE_FLRC /* Fast Long Range Codec */
|
||||||
|
|
||||||
@ -99,7 +99,7 @@ return ch;
|
|||||||
/*!
|
/*!
|
||||||
* \brief Defines the buffer size, i.e. the payload size
|
* \brief Defines the buffer size, i.e. the payload size
|
||||||
*/
|
*/
|
||||||
#define BUFFER_SIZE 20
|
#define BUFFER_SIZE 5
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Number of tick size steps for tx timeout
|
* \brief Number of tick size steps for tx timeout
|
||||||
@ -191,7 +191,7 @@ uint8_t BufferSize = BUFFER_SIZE;
|
|||||||
/*!
|
/*!
|
||||||
* \brief The buffer
|
* \brief The buffer
|
||||||
*/
|
*/
|
||||||
uint8_t Buffer[BUFFER_SIZE];
|
int8_t Buffer[BUFFER_SIZE];
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Mask of IRQs to listen to in rx mode
|
* \brief Mask of IRQs to listen to in rx mode
|
||||||
@ -430,8 +430,8 @@ printf("Reg00=%d (expect 0x40 or 0xFF)\r\n", id);
|
|||||||
// //Radio.SetRx( ( TickTime_t ) { RX_TIMEOUT_TICK_SIZE, RX_TIMEOUT_VALUE } );
|
// //Radio.SetRx( ( TickTime_t ) { RX_TIMEOUT_TICK_SIZE, RX_TIMEOUT_VALUE } );
|
||||||
// Radio.SetRx( ( TickTime_t ) { RX_TIMEOUT_TICK_SIZE, 0xFFFF } );
|
// Radio.SetRx( ( TickTime_t ) { RX_TIMEOUT_TICK_SIZE, 0xFFFF } );
|
||||||
|
|
||||||
Radio.SetDioIrqParams( TxIrqMask, TxIrqMask, IRQ_RADIO_NONE, IRQ_RADIO_NONE );
|
// Radio.SetDioIrqParams( TxIrqMask, TxIrqMask, IRQ_RADIO_NONE, IRQ_RADIO_NONE );
|
||||||
Radio.SendPayload((uint8_t*)"12345",5, ( TickTime_t ){ RX_TIMEOUT_TICK_SIZE, TX_TIMEOUT_VALUE });
|
// Radio.SendPayload((uint8_t*)"12345",5, ( TickTime_t ){ RX_TIMEOUT_TICK_SIZE, TX_TIMEOUT_VALUE });
|
||||||
|
|
||||||
uint8_t status;
|
uint8_t status;
|
||||||
Radio.ReadRegisters(0x01, &status, 1); // 读取状态寄存器
|
Radio.ReadRegisters(0x01, &status, 1); // 读取状态寄存器
|
||||||
@ -454,9 +454,11 @@ printf("Status=%d\n", status);
|
|||||||
// printf("Force TX -> should RX myself\r\n");
|
// printf("Force TX -> should RX myself\r\n");
|
||||||
//}
|
//}
|
||||||
|
|
||||||
|
Radio.SetDioIrqParams( RxIrqMask, RxIrqMask, IRQ_RADIO_NONE, IRQ_RADIO_NONE );
|
||||||
|
Radio.SetRx( ( TickTime_t ) { RX_TIMEOUT_TICK_SIZE, RX_TIMEOUT_VALUE } );
|
||||||
|
|
||||||
SX1281ProcessIrqs( );
|
SX1281ProcessIrqs( );
|
||||||
HAL_Delay(1000);
|
HAL_Delay(100);
|
||||||
|
|
||||||
|
|
||||||
uint16_t irq = Radio.GetIrqStatus();
|
uint16_t irq = Radio.GetIrqStatus();
|
||||||
@ -681,6 +683,10 @@ void SystemClock_Config(void)
|
|||||||
|
|
||||||
/* USER CODE BEGIN 4 */
|
/* USER CODE BEGIN 4 */
|
||||||
|
|
||||||
|
void HAL_GPIO_EXTI_Falling_Callback(uint16_t GPIO_Pin)
|
||||||
|
{
|
||||||
|
HAL_Delay(10);
|
||||||
|
}
|
||||||
void OnTxDone( void )
|
void OnTxDone( void )
|
||||||
{
|
{
|
||||||
AppState = APP_TX;
|
AppState = APP_TX;
|
||||||
|
|||||||
@ -224,7 +224,7 @@ void EXTI15_10_IRQHandler(void)
|
|||||||
/* USER CODE END EXTI15_10_IRQn 0 */
|
/* USER CODE END EXTI15_10_IRQn 0 */
|
||||||
HAL_GPIO_EXTI_IRQHandler(KEY_Pin);
|
HAL_GPIO_EXTI_IRQHandler(KEY_Pin);
|
||||||
/* USER CODE BEGIN EXTI15_10_IRQn 1 */
|
/* USER CODE BEGIN EXTI15_10_IRQn 1 */
|
||||||
|
HAL_GPIO_EXTI_Falling_Callback(KEY_Pin);
|
||||||
/* USER CODE END EXTI15_10_IRQn 1 */
|
/* USER CODE END EXTI15_10_IRQn 1 */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -148,7 +148,24 @@
|
|||||||
<Name>-U7 -O2254 -SF4000 -C0 -A0 -I0 -HNlocalhost -HP7184 -P1 -N00("ARM CoreSight SW-DP") -D00(1BA01477) -L00(0) -TO131090 -TC10000000 -TT10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO15 -FD20000000 -FC800 -FN1 -FF0STM32F10x_128.FLM -FS08000000 -FL010000 -FP0($$Device:STM32F103C8$Flash\STM32F10x_128.FLM)</Name>
|
<Name>-U7 -O2254 -SF4000 -C0 -A0 -I0 -HNlocalhost -HP7184 -P1 -N00("ARM CoreSight SW-DP") -D00(1BA01477) -L00(0) -TO131090 -TC10000000 -TT10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO15 -FD20000000 -FC800 -FN1 -FF0STM32F10x_128.FLM -FS08000000 -FL010000 -FP0($$Device:STM32F103C8$Flash\STM32F10x_128.FLM)</Name>
|
||||||
</SetRegEntry>
|
</SetRegEntry>
|
||||||
</TargetDriverDllRegistry>
|
</TargetDriverDllRegistry>
|
||||||
<Breakpoint/>
|
<Breakpoint>
|
||||||
|
<Bp>
|
||||||
|
<Number>0</Number>
|
||||||
|
<Type>0</Type>
|
||||||
|
<LineNumber>438</LineNumber>
|
||||||
|
<EnabledFlag>1</EnabledFlag>
|
||||||
|
<Address>134235112</Address>
|
||||||
|
<ByteObject>0</ByteObject>
|
||||||
|
<HtxType>0</HtxType>
|
||||||
|
<ManyObjects>0</ManyObjects>
|
||||||
|
<SizeOfObject>0</SizeOfObject>
|
||||||
|
<BreakByAccess>0</BreakByAccess>
|
||||||
|
<BreakIfRCount>1</BreakIfRCount>
|
||||||
|
<Filename>../Core/Src/main.c</Filename>
|
||||||
|
<ExecCommand></ExecCommand>
|
||||||
|
<Expression>\\MR16\../Core/Src/main.c\438</Expression>
|
||||||
|
</Bp>
|
||||||
|
</Breakpoint>
|
||||||
<WatchWindow1>
|
<WatchWindow1>
|
||||||
<Ww>
|
<Ww>
|
||||||
<count>0</count>
|
<count>0</count>
|
||||||
|
|||||||
Binary file not shown.
@ -29,7 +29,16 @@ Project File Date: 11/22/2025
|
|||||||
Build target 'MR16'
|
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\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'.
|
Note: source file '..\User\bsp\spi.c' - object file renamed from 'MR16\spi.o' to 'MR16\spi_1.o'.
|
||||||
"MR16\MR16.axf" - 0 Error(s), 0 Warning(s).
|
compiling main.c...
|
||||||
|
../Core/Src/main.c(277): warning: #177-D: variable "isMaster" was declared but never referenced
|
||||||
|
bool isMaster = true;
|
||||||
|
../Core/Src/main.c(703): warning: #167-D: argument of type "int8_t *" is incompatible with parameter of type "uint8_t *"
|
||||||
|
Radio.GetPayload( Buffer, &BufferSize, BUFFER_SIZE );
|
||||||
|
../Core/Src/main.c: 2 warnings, 0 errors
|
||||||
|
linking...
|
||||||
|
Program Size: Code=19024 RO-data=636 RW-data=92 ZI-data=10652
|
||||||
|
FromELF: creating hex file...
|
||||||
|
"MR16\MR16.axf" - 0 Error(s), 2 Warning(s).
|
||||||
|
|
||||||
<h2>Software Packages used:</h2>
|
<h2>Software Packages used:</h2>
|
||||||
|
|
||||||
@ -53,7 +62,7 @@ Package Vendor: Keil
|
|||||||
|
|
||||||
* Component: ARM::CMSIS:CORE:5.4.0
|
* Component: ARM::CMSIS:CORE:5.4.0
|
||||||
Include file: CMSIS\Core\Include\tz_context.h
|
Include file: CMSIS\Core\Include\tz_context.h
|
||||||
Build Time Elapsed: 00:00:00
|
Build Time Elapsed: 00:00:04
|
||||||
</pre>
|
</pre>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,7 +1,7 @@
|
|||||||
Dependencies for Project 'MR16', Target 'MR16': (DO NOT MODIFY !)
|
Dependencies for Project 'MR16', Target 'MR16': (DO NOT MODIFY !)
|
||||||
CompilerVersion: 5060960::V5.06 update 7 (build 960)::.\ARMCC
|
CompilerVersion: 5060960::V5.06 update 7 (build 960)::.\ARMCC
|
||||||
F (startup_stm32f103xb.s)(0x69213C7F)(--cpu Cortex-M3 -g --apcs=interwork
-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 (startup_stm32f103xb.s)(0x692160B7)(--cpu Cortex-M3 -g --apcs=interwork
-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)(0x69214145)(--c99 -c --cpu Cortex-M3 -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)(0x692166FC)(--c99 -c --cpu Cortex-M3 -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)(0x6921180D)
|
I (../Core/Inc/main.h)(0x6921180D)
|
||||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h)(0x67480A20)
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h)(0x67480A20)
|
||||||
I (../Core/Inc/stm32f1xx_hal_conf.h)(0x691F1DE0)
|
I (../Core/Inc/stm32f1xx_hal_conf.h)(0x691F1DE0)
|
||||||
@ -48,7 +48,7 @@ I (D:\cangming\ARM\ARMCC\include\math.h)(0x5E8E3CC2)
|
|||||||
I (../sx1281-driver-c/sx1281-hal.h)(0x691D6737)
|
I (../sx1281-driver-c/sx1281-hal.h)(0x691D6737)
|
||||||
I (../sx1281-driver-c/boards.h)(0x69202FD4)
|
I (../sx1281-driver-c/boards.h)(0x69202FD4)
|
||||||
I (../sx1281-driver-c/radio.h)(0x5AD59CBF)
|
I (../sx1281-driver-c/radio.h)(0x5AD59CBF)
|
||||||
F (../Core/Src/gpio.c)(0x69211AA6)(--c99 -c --cpu Cortex-M3 -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)
|
F (../Core/Src/gpio.c)(0x692160B4)(--c99 -c --cpu Cortex-M3 -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)
|
||||||
I (../Core/Inc/gpio.h)(0x691B56EA)
|
I (../Core/Inc/gpio.h)(0x691B56EA)
|
||||||
I (../Core/Inc/main.h)(0x6921180D)
|
I (../Core/Inc/main.h)(0x6921180D)
|
||||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h)(0x67480A20)
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h)(0x67480A20)
|
||||||
@ -172,7 +172,7 @@ 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.h)(0x67480A20)
|
||||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim_ex.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 (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_uart.h)(0x67480A20)
|
||||||
F (../Core/Src/stm32f1xx_it.c)(0x691D6B97)(--c99 -c --cpu Cortex-M3 -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\stm32f1xx_it.o --omf_browse mr16\stm32f1xx_it.crf --depend mr16\stm32f1xx_it.d)
|
F (../Core/Src/stm32f1xx_it.c)(0x69216116)(--c99 -c --cpu Cortex-M3 -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\stm32f1xx_it.o --omf_browse mr16\stm32f1xx_it.crf --depend mr16\stm32f1xx_it.d)
|
||||||
I (../Core/Inc/main.h)(0x6921180D)
|
I (../Core/Inc/main.h)(0x6921180D)
|
||||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h)(0x67480A20)
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h)(0x67480A20)
|
||||||
I (../Core/Inc/stm32f1xx_hal_conf.h)(0x691F1DE0)
|
I (../Core/Inc/stm32f1xx_hal_conf.h)(0x691F1DE0)
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
3
MR16.ioc
3
MR16.ioc
@ -67,8 +67,9 @@ PA11.GPIOParameters=GPIO_Label
|
|||||||
PA11.GPIO_Label=WS2812
|
PA11.GPIO_Label=WS2812
|
||||||
PA11.Locked=true
|
PA11.Locked=true
|
||||||
PA11.Signal=S_TIM1_CH4
|
PA11.Signal=S_TIM1_CH4
|
||||||
PA12.GPIOParameters=GPIO_Label
|
PA12.GPIOParameters=GPIO_Label,GPIO_ModeDefaultEXTI
|
||||||
PA12.GPIO_Label=KEY
|
PA12.GPIO_Label=KEY
|
||||||
|
PA12.GPIO_ModeDefaultEXTI=GPIO_MODE_IT_FALLING
|
||||||
PA12.Locked=true
|
PA12.Locked=true
|
||||||
PA12.Signal=GPXTI12
|
PA12.Signal=GPXTI12
|
||||||
PA13.Mode=Serial_Wire
|
PA13.Mode=Serial_Wire
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user