123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- /**
- ******************************************************************************
- * 文件名 : bsp.h
- * 作者 : PAN312x RF Team
- * 版本 : V1.0.0
- * 时间 :
- * 文件描述:
- *******************************************************************************/
- #ifndef _BSP_H_
- #define _BSP_H_
- /*******************************************************************
- * @brief PAN3029/3060 总线模式选择
- * 0: 4线SPI模式
- * 1: 3线SPI模式
- * @note
- * 4线SPI模式:MOSI、MISO、SCK、NSS
- * 3线SPI模式:MOSI、SCK、NSS
- * 3线SPI模式下,PAN3029/3060的MISO引脚不连接MCU,保持悬空
- ******************************************************************/
- #define USE_SPI_4LINE 0
- #define USE_SPI_3LINE 1
- #define INTERFACE_MODE USE_SPI_4LINE /* PAN3029/3060使用4线SPI模式 */
- //#define INTERFACE_MODE USE_SPI_3LINE /* PAN3029/3060使用3线SPI模式 */
- /* CPU空闲时执行的函数 */
- //#define CPU_IDLE() bsp_Idle()
- /* 开关全局中断的宏 */
- #define ENABLE_INT() __set_PRIMASK(0) /* 使能全局中断 */
- #define DISABLE_INT() __set_PRIMASK(1) /* 禁止全局中断 */
- /* 这个宏仅用于调试阶段排错 */
- #define BSP_Printf printf
- #define EXAMPLE_DATE "2025-04-21"
- #define DEMO_VER "0.0.0"
- /* 默认是关闭状态 */
- #define Enable_EventRecorder 0
- #if Enable_EventRecorder == 1
- #include "EventRecorder.h"
- #endif
- //#include "stm32f1xx_hal.h"
- #include <stdio.h>
- #include <string.h>
- #include <stdlib.h>
- #include <math.h>
- #include <stdint.h>
- #include <stdbool.h>
- #include "gpio.h"
- #include "spi.h"
- #ifndef TRUE
- #define TRUE 1
- #endif
- #ifndef FALSE
- #define FALSE 0
- #endif
- /* 定义优先级分组 */
- //#define NVIC_PREEMPT_PRIORITY 4
- /* 通过取消注释或者添加注释的方式控制是否包含底层驱动模块 */
- //#include "bsp_timer.h"
- //#include "bsp_led.h"
- //#include "bsp_key.h"
- //#include "bsp_dwt.h"
- //#include "bsp_lcd.h"
- //#include "bsp_uart.h"
- //#include "bsp_queue.h"
- typedef enum
- {
- RF_STAND_BY =1,
- RF_START_TX,
- RF_START_ACK_TX,
- RF_START_RX,
- RF_TX_RUNNING,
- RF_RX_RUNNING
- }RF_States;
- #include "PAN312x_Hal.h"
- #include "PAN312x_Driver.h"
- //void BSP_SetGpioMode(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin, uint32_t Mode);
- //extern void timer_delay_100us( uint32_t us );
- #endif
- /****** Copyright (C) 2025-2050 Shanghai Panchip Microelectronics Co., Ltd. All rights reserved. *******/
|