|
26 | 26 | extern "C" {
|
27 | 27 | #endif
|
28 | 28 |
|
29 |
| -/* Sampling Frequency */ |
30 |
| -#define A2DP_SBC_SAMP_FREQ_16000 BIT(7) |
31 |
| -#define A2DP_SBC_SAMP_FREQ_32000 BIT(6) |
32 |
| -#define A2DP_SBC_SAMP_FREQ_44100 BIT(5) |
33 |
| -#define A2DP_SBC_SAMP_FREQ_48000 BIT(4) |
| 29 | +/** |
| 30 | + * @name Sampling Frequency |
| 31 | + * @{ |
| 32 | + */ |
| 33 | +#define A2DP_SBC_SAMP_FREQ_16000 BIT(7) /**< 16 kHz */ |
| 34 | +#define A2DP_SBC_SAMP_FREQ_32000 BIT(6) /**< 32 kHz */ |
| 35 | +#define A2DP_SBC_SAMP_FREQ_44100 BIT(5) /**< 44.1 kHz */ |
| 36 | +#define A2DP_SBC_SAMP_FREQ_48000 BIT(4) /**< 48 kHz */ |
| 37 | +/** @} */ |
34 | 38 |
|
35 |
| -/* Channel Mode */ |
36 |
| -#define A2DP_SBC_CH_MODE_MONO BIT(3) |
37 |
| -#define A2DP_SBC_CH_MODE_DUAL BIT(2) |
38 |
| -#define A2DP_SBC_CH_MODE_STREO BIT(1) |
39 |
| -#define A2DP_SBC_CH_MODE_JOINT BIT(0) |
| 39 | +/** |
| 40 | + * @name Channel Mode |
| 41 | + * @{ |
| 42 | + */ |
| 43 | +#define A2DP_SBC_CH_MODE_MONO BIT(3) /**< Mono */ |
| 44 | +#define A2DP_SBC_CH_MODE_DUAL BIT(2) /**< Dual Channel */ |
| 45 | +#define A2DP_SBC_CH_MODE_STREO BIT(1) /**< Stereo */ |
| 46 | +#define A2DP_SBC_CH_MODE_JOINT BIT(0) /**< Joint Stereo */ |
| 47 | +/** @} */ |
40 | 48 |
|
41 |
| -/* Block Length */ |
42 |
| -#define A2DP_SBC_BLK_LEN_4 BIT(7) |
43 |
| -#define A2DP_SBC_BLK_LEN_8 BIT(6) |
44 |
| -#define A2DP_SBC_BLK_LEN_12 BIT(5) |
45 |
| -#define A2DP_SBC_BLK_LEN_16 BIT(4) |
| 49 | +/** |
| 50 | + * @name Block Length |
| 51 | + * @{ |
| 52 | + */ |
| 53 | +#define A2DP_SBC_BLK_LEN_4 BIT(7) /**< 4 blocks */ |
| 54 | +#define A2DP_SBC_BLK_LEN_8 BIT(6) /**< 8 blocks */ |
| 55 | +#define A2DP_SBC_BLK_LEN_12 BIT(5) /**< 12 blocks */ |
| 56 | +#define A2DP_SBC_BLK_LEN_16 BIT(4) /**< 16 blocks */ |
| 57 | +/** @} */ |
46 | 58 |
|
47 |
| -/* Subbands */ |
48 |
| -#define A2DP_SBC_SUBBAND_4 BIT(3) |
49 |
| -#define A2DP_SBC_SUBBAND_8 BIT(2) |
| 59 | +/** |
| 60 | + * @name Subbands |
| 61 | + * @{ |
| 62 | + */ |
| 63 | +#define A2DP_SBC_SUBBAND_4 BIT(3) /**< 4 subbands */ |
| 64 | +#define A2DP_SBC_SUBBAND_8 BIT(2) /**< 8 subbands */ |
| 65 | +/** @} */ |
50 | 66 |
|
51 |
| -/* Allocation Method */ |
52 |
| -#define A2DP_SBC_ALLOC_MTHD_SNR BIT(1) |
53 |
| -#define A2DP_SBC_ALLOC_MTHD_LOUDNESS BIT(0) |
| 67 | +/** |
| 68 | + * @name Bit pool Allocation Method |
| 69 | + * @{ |
| 70 | + */ |
| 71 | +#define A2DP_SBC_ALLOC_MTHD_SNR BIT(1) /**< Allocate based on loudness of the subband signal */ |
| 72 | +#define A2DP_SBC_ALLOC_MTHD_LOUDNESS BIT(0) /**< Allocate based on the signal-to-noise ratio */ |
| 73 | +/** @} */ |
54 | 74 |
|
| 75 | +/** |
| 76 | + * Gets the sampling rate from a codec preset |
| 77 | + * @param preset Codec preset |
| 78 | + */ |
55 | 79 | #define BT_A2DP_SBC_SAMP_FREQ(preset) ((preset->config[0] >> 4) & 0x0f)
|
| 80 | +/** |
| 81 | + * Gets the channel mode from a codec preset |
| 82 | + * @param preset Codec preset |
| 83 | + */ |
56 | 84 | #define BT_A2DP_SBC_CHAN_MODE(preset) ((preset->config[0]) & 0x0f)
|
| 85 | +/** |
| 86 | + * Gets the block length from a codec preset |
| 87 | + * @param preset Codec preset |
| 88 | + */ |
57 | 89 | #define BT_A2DP_SBC_BLK_LEN(preset) ((preset->config[1] >> 4) & 0x0f)
|
| 90 | +/** |
| 91 | + * Gets the number subbands from a codec preset |
| 92 | + * @param preset Codec preset |
| 93 | + */ |
58 | 94 | #define BT_A2DP_SBC_SUB_BAND(preset) ((preset->config[1] >> 2) & 0x03)
|
| 95 | +/** |
| 96 | + * Gets the bitpool allocation method from a codec preset |
| 97 | + * @param preset Codec preset |
| 98 | + */ |
59 | 99 | #define BT_A2DP_SBC_ALLOC_MTHD(preset) ((preset->config[1]) & 0x03)
|
60 | 100 |
|
61 | 101 | /** @brief SBC Codec */
|
|
0 commit comments