mirror of
https://github.com/0xFEEDC0DE64/arduino-esp32.git
synced 2025-07-03 13:56:32 +02:00
Update IDF to aaf1239 (#1539)
* fix sdmmc config * Fix warnings in EEPROM from @Curclamas * remove leftover TAG in EEPROM * Initial add of @stickbreaker i2c * Add log_n * fix warnings when log is off * i2c code clean up and reorganization * add flags to interrupt allocator * fix sdmmc config * Fix warnings in EEPROM from @Curclamas * remove leftover TAG in EEPROM * fix errors with latest IDF * fix debug optimization (#1365) incorrect optimization for debugging tick markers. * Fix some missing BT header * Change BTSerial log calls * Update BLE lib * Arduino-ESP32 release management scripted (#1515) * Calculate an absolute path for a custom partitions table (#1452) * * Arduino-ESP32 release management scripted (ready-to-merge) * * secure env for espressif/arduino-esp32 * * build tests enabled * gitter webhook enabled * * gitter room link fixed * better comment * * filepaths fixed * BT Serial adjustments * * don't run sketch builds & tests for tagged builds * Return false from WiFi.hostByName() if hostname is not resolved * Free BT Memory when BT is not used * WIFI_MODE_NULL is not supported anymore * Select some key examples to build with PlatformIO to save some time * Update BLE lib * Fixed BLE lib * Major WiFi overhaul - auto reconnect on connection loss now works - moved to event groups - some code clean up and procedure optimizations - new methods to get a more elaborate system ststus * Add cmake tests to travis * Add initial AsyncUDP * Add NetBIOS lib and fix CMake includes * Add Initial WebServer * Fix WebServer and examples * travis not quiting on build fail * Try different travis build * Update IDF to aaf1239 * Fix WPS Example * fix script permission and add some fail tests to sketch builder * Add missing space in WiFiClient::write(Stream &stream)
This commit is contained in:
213
tools/sdk/include/bluedroid/stack/a2d_sbc.h
Normal file
213
tools/sdk/include/bluedroid/stack/a2d_sbc.h
Normal file
@ -0,0 +1,213 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright (C) 2000-2012 Broadcom Corporation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at:
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* nterface to low complexity subband codec (SBC)
|
||||
*
|
||||
******************************************************************************/
|
||||
#ifndef A2D_SBC_H
|
||||
#define A2D_SBC_H
|
||||
#if (A2D_INCLUDED == TRUE)
|
||||
/*****************************************************************************
|
||||
** Constants
|
||||
*****************************************************************************/
|
||||
/* the length of the SBC Media Payload header. */
|
||||
#define A2D_SBC_MPL_HDR_LEN 1
|
||||
|
||||
/* the LOSC of SBC media codec capabilitiy */
|
||||
#define A2D_SBC_INFO_LEN 6
|
||||
|
||||
/* for Codec Specific Information Element */
|
||||
#define A2D_SBC_IE_SAMP_FREQ_MSK 0xF0 /* b7-b4 sampling frequency */
|
||||
#define A2D_SBC_IE_SAMP_FREQ_16 0x80 /* b7:16 kHz */
|
||||
#define A2D_SBC_IE_SAMP_FREQ_32 0x40 /* b6:32 kHz */
|
||||
#define A2D_SBC_IE_SAMP_FREQ_44 0x20 /* b5:44.1kHz */
|
||||
#define A2D_SBC_IE_SAMP_FREQ_48 0x10 /* b4:48 kHz */
|
||||
|
||||
#define A2D_SBC_IE_CH_MD_MSK 0x0F /* b3-b0 channel mode */
|
||||
#define A2D_SBC_IE_CH_MD_MONO 0x08 /* b3: mono */
|
||||
#define A2D_SBC_IE_CH_MD_DUAL 0x04 /* b2: dual */
|
||||
#define A2D_SBC_IE_CH_MD_STEREO 0x02 /* b1: stereo */
|
||||
#define A2D_SBC_IE_CH_MD_JOINT 0x01 /* b0: joint stereo */
|
||||
|
||||
#define A2D_SBC_IE_BLOCKS_MSK 0xF0 /* b7-b4 number of blocks */
|
||||
#define A2D_SBC_IE_BLOCKS_4 0x80 /* 4 blocks */
|
||||
#define A2D_SBC_IE_BLOCKS_8 0x40 /* 8 blocks */
|
||||
#define A2D_SBC_IE_BLOCKS_12 0x20 /* 12blocks */
|
||||
#define A2D_SBC_IE_BLOCKS_16 0x10 /* 16blocks */
|
||||
|
||||
#define A2D_SBC_IE_SUBBAND_MSK 0x0C /* b3-b2 number of subbands */
|
||||
#define A2D_SBC_IE_SUBBAND_4 0x08 /* b3: 4 */
|
||||
#define A2D_SBC_IE_SUBBAND_8 0x04 /* b2: 8 */
|
||||
|
||||
#define A2D_SBC_IE_ALLOC_MD_MSK 0x03 /* b1-b0 allocation mode */
|
||||
#define A2D_SBC_IE_ALLOC_MD_S 0x02 /* b1: SNR */
|
||||
#define A2D_SBC_IE_ALLOC_MD_L 0x01 /* b0: loundess */
|
||||
|
||||
#define A2D_SBC_IE_MIN_BITPOOL 2
|
||||
#define A2D_SBC_IE_MAX_BITPOOL 250
|
||||
|
||||
/* for media payload header */
|
||||
#define A2D_SBC_HDR_F_MSK 0x80
|
||||
#define A2D_SBC_HDR_S_MSK 0x40
|
||||
#define A2D_SBC_HDR_L_MSK 0x20
|
||||
#define A2D_SBC_HDR_NUM_MSK 0x0F
|
||||
|
||||
/*****************************************************************************
|
||||
** Type Definitions
|
||||
*****************************************************************************/
|
||||
|
||||
/* data type for the SBC Codec Information Element*/
|
||||
typedef struct {
|
||||
UINT8 samp_freq; /* Sampling frequency */
|
||||
UINT8 ch_mode; /* Channel mode */
|
||||
UINT8 block_len; /* Block length */
|
||||
UINT8 num_subbands; /* Number of subbands */
|
||||
UINT8 alloc_mthd; /* Allocation method */
|
||||
UINT8 max_bitpool; /* Maximum bitpool */
|
||||
UINT8 min_bitpool; /* Minimum bitpool */
|
||||
} tA2D_SBC_CIE;
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
** External Function Declarations
|
||||
*****************************************************************************/
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
/******************************************************************************
|
||||
**
|
||||
** Function A2D_SbcChkFrInit
|
||||
**
|
||||
** Description check if need to init the descramble control block.
|
||||
**
|
||||
** Returns nothing.
|
||||
******************************************************************************/
|
||||
extern void A2D_SbcChkFrInit(UINT8 *p_pkt);
|
||||
|
||||
/******************************************************************************
|
||||
**
|
||||
** Function A2D_SbcDescramble
|
||||
**
|
||||
** Description descramble the packet.
|
||||
**
|
||||
** Returns nothing.
|
||||
******************************************************************************/
|
||||
extern void A2D_SbcDescramble(UINT8 *p_pkt, UINT16 len);
|
||||
|
||||
/******************************************************************************
|
||||
**
|
||||
** Function A2D_BldSbcInfo
|
||||
**
|
||||
** Description This function is called by an application to build
|
||||
** the SBC Media Codec Capabilities byte sequence
|
||||
** beginning from the LOSC octet.
|
||||
** Input Parameters:
|
||||
** media_type: Indicates Audio, or Multimedia.
|
||||
**
|
||||
** p_ie: The SBC Codec Information Element information.
|
||||
**
|
||||
** Output Parameters:
|
||||
** p_result: the resulting codec info byte sequence.
|
||||
**
|
||||
** Returns A2D_SUCCESS if function execution succeeded.
|
||||
** Error status code, otherwise.
|
||||
******************************************************************************/
|
||||
extern tA2D_STATUS A2D_BldSbcInfo(UINT8 media_type, tA2D_SBC_CIE *p_ie,
|
||||
UINT8 *p_result);
|
||||
|
||||
/******************************************************************************
|
||||
**
|
||||
** Function A2D_ParsSbcInfo
|
||||
**
|
||||
** Description This function is called by an application to parse
|
||||
** the SBC Media Codec Capabilities byte sequence
|
||||
** beginning from the LOSC octet.
|
||||
** Input Parameters:
|
||||
** p_info: the byte sequence to parse.
|
||||
**
|
||||
** for_caps: TRUE, if the byte sequence is for get capabilities response.
|
||||
**
|
||||
** Output Parameters:
|
||||
** p_ie: The SBC Codec Information Element information.
|
||||
**
|
||||
** Returns A2D_SUCCESS if function execution succeeded.
|
||||
** Error status code, otherwise.
|
||||
******************************************************************************/
|
||||
extern tA2D_STATUS A2D_ParsSbcInfo(tA2D_SBC_CIE *p_ie, UINT8 *p_info,
|
||||
BOOLEAN for_caps);
|
||||
|
||||
/******************************************************************************
|
||||
**
|
||||
** Function A2D_BldSbcMplHdr
|
||||
**
|
||||
** Description This function is called by an application to parse
|
||||
** the SBC Media Payload header.
|
||||
** Input Parameters:
|
||||
** frag: 1, if fragmented. 0, otherwise.
|
||||
**
|
||||
** start: 1, if the starting packet of a fragmented frame.
|
||||
**
|
||||
** last: 1, if the last packet of a fragmented frame.
|
||||
**
|
||||
** num: If frag is 1, this is the number of remaining fragments
|
||||
** (including this fragment) of this frame.
|
||||
** If frag is 0, this is the number of frames in this packet.
|
||||
**
|
||||
** Output Parameters:
|
||||
** p_dst: the resulting media payload header byte sequence.
|
||||
**
|
||||
** Returns void.
|
||||
******************************************************************************/
|
||||
extern void A2D_BldSbcMplHdr(UINT8 *p_dst, BOOLEAN frag, BOOLEAN start,
|
||||
BOOLEAN last, UINT8 num);
|
||||
|
||||
/******************************************************************************
|
||||
**
|
||||
** Function A2D_ParsSbcMplHdr
|
||||
**
|
||||
** Description This function is called by an application to parse
|
||||
** the SBC Media Payload header.
|
||||
** Input Parameters:
|
||||
** p_src: the byte sequence to parse..
|
||||
**
|
||||
** Output Parameters:
|
||||
** frag: 1, if fragmented. 0, otherwise.
|
||||
**
|
||||
** start: 1, if the starting packet of a fragmented frame.
|
||||
**
|
||||
** last: 1, if the last packet of a fragmented frame.
|
||||
**
|
||||
** num: If frag is 1, this is the number of remaining fragments
|
||||
** (including this fragment) of this frame.
|
||||
** If frag is 0, this is the number of frames in this packet.
|
||||
**
|
||||
** Returns void.
|
||||
******************************************************************************/
|
||||
extern void A2D_ParsSbcMplHdr(UINT8 *p_src, BOOLEAN *p_frag,
|
||||
BOOLEAN *p_start, BOOLEAN *p_last,
|
||||
UINT8 *p_num);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif ///A2D_INCLUDED == TRUE
|
||||
|
||||
#endif /* A2D_SBC_H */
|
Reference in New Issue
Block a user