/** ******************************************************************************* * @FileName : bb_def.h * @Author : GaoQiu * @CreateDate: 2020-09-10 * @Copyright : Copyright(C) GaoQiu * All Rights Reserved. * ******************************************************************************* * * The information contained herein is confidential and proprietary property of * GaoQiu and is available under the terms of Commercial License Agreement * between GaoQiu and the licensee in separate contract or the terms described * here-in. * * This heading MUST NOT be removed from this file. * * Licensees are granted free, non-transferable use of the information in this * file under Mutual Non-Disclosure Agreement. NO WARRENTY of ANY KIND is provided. * ******************************************************************************* */ #ifndef BB_DEF_H_ #define BB_DEF_H_ #include "utils/defs_types.h" /* BB Register Base Address. */ #define BB_BASE 0x50020000 #define RCC_BASE 0x40040000 #define BB_SEQ_RAM_BASE (BB_BASE + 0x1000) #define BB_LIST_RAM_BASE (BB_BASE + 0x8000) /* 512B */ //#define BB_TX_RX_BUF_BASE (BB_BASE + 0x8200) /* 7.5K + 8K for BB TX/RX Buffer */ #define BB_TX_RX_BUF_BASE (BB_BASE + 0x8100) /* 7.5K + 8K for BB TX/RX Buffer */ #define BB_REG32(addr) (*((volatile uint32_t *)(BB_BASE + addr))) #define RCC_REG32(addr) (*((volatile uint32_t *)(RCC_BASE + addr))) #define BB_REG_WRITE(addr, mask, pos, value) \ {\ uint32_t v = BB_REG32(addr);\ v &= ~(mask);\ v |= ((value) << (pos)) & (mask);\ BB_REG32(addr) = v;\ } /* RCC Register */ #define RCC_RST0_ADDR 0x04 /* LL Register Address define. */ #define BB_VERSION_ADDR 0x0000 #define BB_CTRL_ADDR 0x0008 enum{ BB_CTRL_BUS_CLK_EN_Pos = 10, #define BB_CTRL_BUS_CLK_EN_Mask (1< CRC16 Or not CRC8 BB_PRI0_PHY_MODE_Pos = 5, // 1Mbps / 2Mbps #define BB_PRI0_PHY_MODE_Mask (1ul << BB_PRI0_PHY_MODE_Pos) BB_PRI0_RF_MODE_Pos = 3, //BLE mode / nordic mode / 297 mode #define BB_PRI0_RF_MODE_Mask (3ul << BB_PRI0_RF_MODE_Pos) BB_PRI0_RX_TX_CTRL_Pos = 0, }; #define BB_PRI1_ADDR 0x4C4 //PRI_R01 - Tx done irq | Rx done irq | Crc Error | Rx timeout | enum{ BB_PRI1_RX_PID_Pos = 29, #define BB_PRI1_RX_PID_Mask (0x3UL<