bsp.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /**
  2. ******************************************************************************
  3. * 文件名 : bsp.h
  4. * 作者 : PAN312x RF Team
  5. * 版本 : V1.0.0
  6. * 时间 :
  7. * 文件描述:
  8. *******************************************************************************/
  9. #ifndef _BSP_H_
  10. #define _BSP_H_
  11. /*******************************************************************
  12. * @brief PAN3029/3060 总线模式选择
  13. * 0: 4线SPI模式
  14. * 1: 3线SPI模式
  15. * @note
  16. * 4线SPI模式:MOSI、MISO、SCK、NSS
  17. * 3线SPI模式:MOSI、SCK、NSS
  18. * 3线SPI模式下,PAN3029/3060的MISO引脚不连接MCU,保持悬空
  19. ******************************************************************/
  20. #define USE_SPI_4LINE 0
  21. #define USE_SPI_3LINE 1
  22. #define INTERFACE_MODE USE_SPI_4LINE /* PAN3029/3060使用4线SPI模式 */
  23. //#define INTERFACE_MODE USE_SPI_3LINE /* PAN3029/3060使用3线SPI模式 */
  24. /* CPU空闲时执行的函数 */
  25. //#define CPU_IDLE() bsp_Idle()
  26. /* 开关全局中断的宏 */
  27. #define ENABLE_INT() __set_PRIMASK(0) /* 使能全局中断 */
  28. #define DISABLE_INT() __set_PRIMASK(1) /* 禁止全局中断 */
  29. /* 这个宏仅用于调试阶段排错 */
  30. #define BSP_Printf printf
  31. #define EXAMPLE_DATE "2025-04-21"
  32. #define DEMO_VER "0.0.0"
  33. /* 默认是关闭状态 */
  34. #define Enable_EventRecorder 0
  35. #if Enable_EventRecorder == 1
  36. #include "EventRecorder.h"
  37. #endif
  38. //#include "stm32f1xx_hal.h"
  39. #include <stdio.h>
  40. #include <string.h>
  41. #include <stdlib.h>
  42. #include <math.h>
  43. #include <stdint.h>
  44. #include <stdbool.h>
  45. #include "gpio.h"
  46. #include "spi.h"
  47. #ifndef TRUE
  48. #define TRUE 1
  49. #endif
  50. #ifndef FALSE
  51. #define FALSE 0
  52. #endif
  53. /* 定义优先级分组 */
  54. //#define NVIC_PREEMPT_PRIORITY 4
  55. /* 通过取消注释或者添加注释的方式控制是否包含底层驱动模块 */
  56. //#include "bsp_timer.h"
  57. //#include "bsp_led.h"
  58. //#include "bsp_key.h"
  59. //#include "bsp_dwt.h"
  60. //#include "bsp_lcd.h"
  61. //#include "bsp_uart.h"
  62. //#include "bsp_queue.h"
  63. typedef enum
  64. {
  65. RF_STAND_BY =1,
  66. RF_START_TX,
  67. RF_START_ACK_TX,
  68. RF_START_RX,
  69. RF_TX_RUNNING,
  70. RF_RX_RUNNING
  71. }RF_States;
  72. #include "PAN312x_Hal.h"
  73. #include "PAN312x_Driver.h"
  74. //void BSP_SetGpioMode(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin, uint32_t Mode);
  75. //extern void timer_delay_100us( uint32_t us );
  76. #endif
  77. /****** Copyright (C) 2025-2050 Shanghai Panchip Microelectronics Co., Ltd. All rights reserved. *******/