/**
|
*******************************************************************************
|
* @FileName : bb_api.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_API_H_
|
#define BB_API_H_
|
|
#include "bb_def.h"
|
|
/*! Base-band Power level. */
|
typedef enum {
|
BB_POWER_N45_dB = -45,
|
BB_POWER_N44_dB = -44,
|
|
BB_POWER_N3_dB = -3,
|
BB_POWER_N2_dB = -2,
|
BB_POWER_N1_dB = -1,
|
BB_POWER_0_dB = 0,
|
BB_POWER_1_dB = 1,
|
BB_POWER_2_dB = 2,
|
BB_POWER_3_dB = 3,
|
BB_POWER_4_dB = 4,
|
BB_POWER_5_dB = 5,
|
BB_POWER_6_dB = 6,
|
BB_POWER_7_dB = 7,
|
}BB_Power_Type_t;
|
|
/**
|
* @brief : Set RF TX power.
|
* @param : pwr can be BB_POWER_0_dB ...
|
* @return: none.
|
*/
|
void BB_SetTxPower(uint8_t level);
|
|
/**
|
* @brief : Set BLE Channel
|
* @param : bleChn ble channel
|
* @return: none.
|
*/
|
void BB_SetBleChannel(uint8_t bleChn);
|
|
|
|
/*! BB time */
|
static inline uint32_t BB_GetCurTick(void)
|
{
|
return BB_REG32(BB_SLEEP_TIMER3_ADDR); // 32KHz tick
|
}
|
bool_t BB_IsTimeExpired(uint32_t refTick, uint32_t us);
|
void BB_Delay(uint32_t tick);
|
|
uint32_t BB_UsToTick(uint32_t us);
|
uint32_t BB_TickToUs(uint32_t t);
|
|
/*! 32k RC calibrate and measure */
|
void BB_Start32kRCMeasure(uint32_t dst_clk_cnt);
|
void BB_Get32kRCMeasureValue(void);
|
void BB_Calibrate32kRC(uint32_t expected_freq);
|
bool_t BB_Is32kClkTrackBusy(void);
|
|
/*! BB Debug */
|
void BB_DebugInit(void);
|
void BB_DebugReset(void);
|
void BB_SetDebugChn(uint8_t chnId, uint8_t sigCode);
|
|
#endif /* BB_API_H_ */
|