基于NRF52833芯片的DW3000 SPI驱动接口代码实现

        在前面章节DW3000芯片驱动API介绍中介绍了DW3000芯片API的程序框架和部分处理流程,下面介绍基于蓝牙芯片NRF52833芯片的相关SPI硬件接口驱动程序。

引脚配置

在port.h文件内,根据实际的硬件修改以下引脚配置定义宏,配置,

#define DW3000_IRQn_Pin   NRF_GPIO_PIN_MAP(0,31)    
#define DW3000_RESET_Pin  NRF_GPIO_PIN_MAP(1,9)    
#define DW3000_WAKEUP_Pin NRF_GPIO_PIN_MAP(0,11)    
//#define DW3000_IRQ2n_Pin  NRF_GPIO_PIN_MAP(0,31)

// SPI defs
#define DW3000_CS_Pin   NRF_GPIO_PIN_MAP(0,0)
#define DW3000_CLK_Pin  NRF_GPIO_PIN_MAP(0,5) // DWM3000 shield SPIM1 sck connected to DW3000
#define DW3000_MOSI_Pin NRF_GPIO_PIN_MAP(0,4) // DWM3000 shield SPIM1 mosi connected to DW3000
#define DW3000_MISO_Pin NRF_GPIO_PIN_MAP(0,1) // DWM3000 shield SPIM1 miso connected to DW3000

//This set the IO for waking up the chip
#define SET_WAKEUP_PIN_IO_LOW     nrf_gpio_pin_clear(DW3000_WAKEUP_Pin)
#define SET_WAKEUP_P

猜你喜欢

转载自blog.csdn.net/tianqiquan/article/details/130129888