WXK
2024-12-16 78e84fcf264afd731cd66c807d9fcb690fe12126
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/**
 *******************************************************************************
 * @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_ */