mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-03 03:31:41 +03:00
fix(i2s_pdm): remove incorrect check for raw PDM usage
This commit is contained in:
@@ -25,7 +25,6 @@
|
||||
#define I2S_LL_SUPPORT(_feat) I2S_LL_SUPPORT_ ## _feat
|
||||
#define I2S_LL_BUS_WIDTH 24
|
||||
#define I2S_LL_INST_NUM 2
|
||||
#define I2S_LL_PDM_SUPPORTED_PORT_MASK (1U << 0) // PDM is supported on I2S0
|
||||
#define I2S_LL_PCM2PDM_SUPPORTED_PORT_MASK (1U << 0) // PCM2PDM is supported on I2S0
|
||||
#define I2S_LL_PDM2PCM_SUPPORTED_PORT_MASK (1U << 0) // PDM2PCM is supported on I2S0
|
||||
#define I2S_LL_TRANS_SIZE_ALIGN_WORD 1 // I2S DMA transfer size must be aligned to word
|
||||
@@ -1172,14 +1171,6 @@ static inline bool i2s_ll_is_destination_supported(int port_id, i2s_destination_
|
||||
return destination == I2S_DESTINATION_DMA;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Check whether I2S PDM mode is supported on the specified port
|
||||
*/
|
||||
static inline bool i2s_ll_is_pdm_supported(int port_id)
|
||||
{
|
||||
return (I2S_LL_PDM_SUPPORTED_PORT_MASK & (1U << port_id)) != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Check whether I2S TX PCM2PDM converter is supported on the specified port
|
||||
*/
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#define I2S_LL_GET(_attr) I2S_LL_ ## _attr
|
||||
#define I2S_LL_SUPPORT(_feat) I2S_LL_SUPPORT_ ## _feat
|
||||
#define I2S_LL_INST_NUM 1
|
||||
#define I2S_LL_PDM_SUPPORTED_PORT_MASK (1U << 0) // PDM is supported on I2S0
|
||||
#define I2S_LL_PCM2PDM_SUPPORTED_PORT_MASK (1U << 0) // PCM2PDM is supported on I2S0
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -1216,14 +1215,6 @@ static inline bool i2s_ll_is_destination_supported(int port_id, i2s_destination_
|
||||
return destination == I2S_DESTINATION_DMA;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Check whether I2S PDM mode is supported on the specified port
|
||||
*/
|
||||
static inline bool i2s_ll_is_pdm_supported(int port_id)
|
||||
{
|
||||
return (I2S_LL_PDM_SUPPORTED_PORT_MASK & (1U << port_id)) != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Check whether I2S TX PCM2PDM converter is supported on the specified port
|
||||
*/
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
#define I2S_LL_GET(_attr) I2S_LL_ ## _attr
|
||||
#define I2S_LL_SUPPORT(_feat) I2S_LL_SUPPORT_ ## _feat
|
||||
#define I2S_LL_INST_NUM 1
|
||||
#define I2S_LL_PDM_SUPPORTED_PORT_MASK (1U << 0) // PDM is supported on I2S0
|
||||
#define I2S_LL_PCM2PDM_SUPPORTED_PORT_MASK (1U << 0) // PCM2PDM is supported on I2S0
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -1390,14 +1389,6 @@ static inline bool i2s_ll_is_destination_supported(int port_id, i2s_destination_
|
||||
return destination == I2S_DESTINATION_DMA;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Check whether I2S PDM mode is supported on the specified port
|
||||
*/
|
||||
static inline bool i2s_ll_is_pdm_supported(int port_id)
|
||||
{
|
||||
return (I2S_LL_PDM_SUPPORTED_PORT_MASK & (1U << port_id)) != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Check whether I2S TX PCM2PDM converter is supported on the specified port
|
||||
*/
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
#define I2S_LL_GET(_attr) I2S_LL_ ## _attr
|
||||
#define I2S_LL_SUPPORT(_feat) I2S_LL_SUPPORT_ ## _feat
|
||||
#define I2S_LL_INST_NUM 1
|
||||
#define I2S_LL_PDM_SUPPORTED_PORT_MASK (1U << 0) // PDM is supported on I2S0
|
||||
#define I2S_LL_PCM2PDM_SUPPORTED_PORT_MASK (1U << 0) // PCM2PDM is supported on I2S0
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -1262,14 +1261,6 @@ static inline bool i2s_ll_is_destination_supported(int port_id, i2s_destination_
|
||||
return destination == I2S_DESTINATION_DMA;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Check whether I2S PDM mode is supported on the specified port
|
||||
*/
|
||||
static inline bool i2s_ll_is_pdm_supported(int port_id)
|
||||
{
|
||||
return (I2S_LL_PDM_SUPPORTED_PORT_MASK & (1U << port_id)) != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Check whether I2S TX PCM2PDM converter is supported on the specified port
|
||||
*/
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
#define I2S_LL_GET(_attr) I2S_LL_ ## _attr
|
||||
#define I2S_LL_SUPPORT(_feat) I2S_LL_SUPPORT_ ## _feat
|
||||
#define I2S_LL_INST_NUM 1
|
||||
#define I2S_LL_PDM_SUPPORTED_PORT_MASK (1U << 0) // PDM is supported on I2S0
|
||||
#define I2S_LL_PCM2PDM_SUPPORTED_PORT_MASK (1U << 0) // PCM2PDM is supported on I2S0
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -1391,14 +1390,6 @@ static inline bool i2s_ll_is_destination_supported(int port_id, i2s_destination_
|
||||
return destination == I2S_DESTINATION_DMA;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Check whether I2S PDM mode is supported on the specified port
|
||||
*/
|
||||
static inline bool i2s_ll_is_pdm_supported(int port_id)
|
||||
{
|
||||
return (I2S_LL_PDM_SUPPORTED_PORT_MASK & (1U << port_id)) != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Check whether I2S TX PCM2PDM converter is supported on the specified port
|
||||
*/
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
#define I2S_LL_GET(_attr) I2S_LL_ ## _attr
|
||||
#define I2S_LL_SUPPORT(_feat) I2S_LL_SUPPORT_ ## _feat
|
||||
#define I2S_LL_INST_NUM 1
|
||||
#define I2S_LL_PDM_SUPPORTED_PORT_MASK (1U << 0) // PDM is supported on I2S0
|
||||
#define I2S_LL_PCM2PDM_SUPPORTED_PORT_MASK (1U << 0) // PCM2PDM is supported on I2S0
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -1262,14 +1261,6 @@ static inline bool i2s_ll_is_destination_supported(int port_id, i2s_destination_
|
||||
return destination == I2S_DESTINATION_DMA;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Check whether I2S PDM mode is supported on the specified port
|
||||
*/
|
||||
static inline bool i2s_ll_is_pdm_supported(int port_id)
|
||||
{
|
||||
return (I2S_LL_PDM_SUPPORTED_PORT_MASK & (1U << port_id)) != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Check whether I2S TX PCM2PDM converter is supported on the specified port
|
||||
*/
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
#define I2S_LL_GET(_attr) I2S_LL_ ## _attr
|
||||
#define I2S_LL_SUPPORT(_feat) I2S_LL_SUPPORT_ ## _feat
|
||||
#define I2S_LL_INST_NUM 1
|
||||
#define I2S_LL_PDM_SUPPORTED_PORT_MASK (1U << 0) // PDM is supported on I2S0
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -1260,14 +1259,6 @@ static inline bool i2s_ll_is_destination_supported(int port_id, i2s_destination_
|
||||
return destination == I2S_DESTINATION_DMA;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Check whether I2S PDM mode is supported on the specified port
|
||||
*/
|
||||
static inline bool i2s_ll_is_pdm_supported(int port_id)
|
||||
{
|
||||
return (I2S_LL_PDM_SUPPORTED_PORT_MASK & (1U << port_id)) != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Check whether I2S TX PCM2PDM converter is supported on the specified port
|
||||
*/
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
#define I2S_LL_GET(_attr) I2S_LL_ ## _attr
|
||||
#define I2S_LL_SUPPORT(_feat) I2S_LL_SUPPORT_ ## _feat
|
||||
#define I2S_LL_INST_NUM 1
|
||||
#define I2S_LL_PDM_SUPPORTED_PORT_MASK (1U << 0) // PDM is supported on I2S0
|
||||
#define I2S_LL_PCM2PDM_SUPPORTED_PORT_MASK (1U << 0) // PCM2PDM is supported on I2S0
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -1498,14 +1497,6 @@ static inline bool i2s_ll_is_destination_supported(int port_id, i2s_destination_
|
||||
return destination == I2S_DESTINATION_DMA;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Check whether I2S PDM mode is supported on the specified port
|
||||
*/
|
||||
static inline bool i2s_ll_is_pdm_supported(int port_id)
|
||||
{
|
||||
return (I2S_LL_PDM_SUPPORTED_PORT_MASK & (1U << port_id)) != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Check whether I2S TX PCM2PDM converter is supported on the specified port
|
||||
*/
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
#define I2S_LL_GET(_attr) I2S_LL_ ## _attr
|
||||
#define I2S_LL_SUPPORT(_feat) I2S_LL_SUPPORT_ ## _feat
|
||||
#define I2S_LL_INST_NUM 3
|
||||
#define I2S_LL_PDM_SUPPORTED_PORT_MASK (1U << 0) // PDM is supported on I2S0
|
||||
#define I2S_LL_PCM2PDM_SUPPORTED_PORT_MASK (1U << 0) // PCM2PDM is supported on I2S0
|
||||
#define I2S_LL_PDM2PCM_SUPPORTED_PORT_MASK (1U << 0) // PDM2PCM is supported on I2S0
|
||||
|
||||
@@ -1823,14 +1822,6 @@ static inline bool i2s_ll_is_destination_supported(int port_id, i2s_destination_
|
||||
return destination == I2S_DESTINATION_DMA;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Check whether I2S PDM mode is supported on the specified port
|
||||
*/
|
||||
static inline bool i2s_ll_is_pdm_supported(int port_id)
|
||||
{
|
||||
return (I2S_LL_PDM_SUPPORTED_PORT_MASK & (1U << port_id)) != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Check whether I2S TX PCM2PDM converter is supported on the specified port
|
||||
*/
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
#define I2S_LL_SUPPORT(_feat) I2S_LL_SUPPORT_ ## _feat
|
||||
#define I2S_LL_BUS_WIDTH 24
|
||||
#define I2S_LL_INST_NUM 1
|
||||
#define I2S_LL_PDM_SUPPORTED_PORT_MASK (1U << 0) // PDM is supported on I2S0
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -1035,14 +1034,6 @@ static inline bool i2s_ll_is_destination_supported(int port_id, i2s_destination_
|
||||
return destination == I2S_DESTINATION_DMA;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Check whether I2S PDM mode is supported on the specified port
|
||||
*/
|
||||
static inline bool i2s_ll_is_pdm_supported(int port_id)
|
||||
{
|
||||
return (I2S_LL_PDM_SUPPORTED_PORT_MASK & (1U << port_id)) != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Check whether I2S TX PCM2PDM converter is supported on the specified port
|
||||
*/
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#define I2S_LL_GET(_attr) I2S_LL_ ## _attr
|
||||
#define I2S_LL_SUPPORT(_feat) I2S_LL_SUPPORT_ ## _feat
|
||||
#define I2S_LL_INST_NUM 2
|
||||
#define I2S_LL_PDM_SUPPORTED_PORT_MASK (1U << 0) // PDM is supported on I2S0
|
||||
#define I2S_LL_PCM2PDM_SUPPORTED_PORT_MASK (1U << 0) // PCM2PDM is supported on I2S0
|
||||
#define I2S_LL_PDM2PCM_SUPPORTED_PORT_MASK (1U << 0) // PDM2PCM is supported on I2S0
|
||||
|
||||
@@ -1255,14 +1254,6 @@ static inline bool i2s_ll_is_destination_supported(int port_id, i2s_destination_
|
||||
return destination == I2S_DESTINATION_DMA;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Check whether I2S PDM mode is supported on the specified port
|
||||
*/
|
||||
static inline bool i2s_ll_is_pdm_supported(int port_id)
|
||||
{
|
||||
return (I2S_LL_PDM_SUPPORTED_PORT_MASK & (1U << port_id)) != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Check whether I2S TX PCM2PDM converter is supported on the specified port
|
||||
*/
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
#define I2S_LL_GET(_attr) I2S_LL_ ## _attr
|
||||
#define I2S_LL_SUPPORT(_feat) I2S_LL_SUPPORT_ ## _feat
|
||||
#define I2S_LL_INST_NUM 2 // ESP32S31 has 2 I2S instances
|
||||
#define I2S_LL_PDM_SUPPORTED_PORT_MASK (1U << 0) // PDM is supported on I2S0
|
||||
#define I2S_LL_PCM2PDM_SUPPORTED_PORT_MASK (1U << 0) // PCM2PDM is supported on I2S0
|
||||
#define I2S_LL_PDM2PCM_SUPPORTED_PORT_MASK (1U << 0) // PDM2PCM is supported on I2S0
|
||||
#define I2S_LL_BT_DEST_SUPPORTED_PORT_MASK (1U << 0) // Bluetooth destination is supported on I2S0
|
||||
@@ -1873,14 +1872,6 @@ static inline bool i2s_ll_is_destination_supported(int port_id, i2s_destination_
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Check whether I2S PDM mode is supported on the specified port
|
||||
*/
|
||||
static inline bool i2s_ll_is_pdm_supported(int port_id)
|
||||
{
|
||||
return (I2S_LL_PDM_SUPPORTED_PORT_MASK & (1U << port_id)) != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Check whether I2S TX PCM2PDM converter is supported on the specified port
|
||||
*/
|
||||
|
||||
@@ -95,11 +95,11 @@ typedef struct {
|
||||
} pdm_tx; /*!< Specific configurations for PDM TX mode */
|
||||
#endif
|
||||
#if SOC_I2S_SUPPORTS_PDM_RX
|
||||
/* PDM TX configurations */
|
||||
/* PDM RX configurations */
|
||||
struct {
|
||||
i2s_pdm_slot_mask_t slot_mask; /*!< Choose the slots to activate */
|
||||
i2s_pdm_data_fmt_t data_fmt; /*!< The data format of PDM RX mode. It determines what kind of data format is read in software.
|
||||
* Typically, set this field to I2S_PDM_DATA_FMT_PCM when PCM2PDM filter is supported in the hardware,
|
||||
* Typically, set this field to I2S_PDM_DATA_FMT_PCM when PDM2PCM filter is supported in the hardware,
|
||||
* so that the hardware PDM2PCM filter will help to convert the raw PDM data on the line into PCM format,
|
||||
* And then you can read PCM format data in software. Otherwise if this field is set to I2S_PDM_DATA_FMT_RAW,
|
||||
* The data read in software are still in raw PDM format, you may need to convert the raw PDM data into PCM format manually by a software filter.
|
||||
|
||||
@@ -100,11 +100,11 @@ typedef enum {
|
||||
I2S_PDM_DATA_FMT_PCM = 0, /*!< PDM RX:
|
||||
* Enable the hardware PDM to PCM filter to convert the inputted PDM data on the line into PCM format in software,
|
||||
* so that the read data in software is PCM format data already, no need additional software filter.
|
||||
* PCM data format is only available when PCM2PDM filter is supported in hardware.
|
||||
* PCM data format is only available when PDM2PCM filter is supported in hardware.
|
||||
* PDM TX:
|
||||
* Enable the hardware PCM to PDM filter to convert the written PCM data in software into PDM format on the line,
|
||||
* so that we only need to write the PCM data in software, no need to prepare raw PDM data in software.
|
||||
* PCM data format is only available when PDM2PCM filter is supported in hardware.
|
||||
* PCM data format is only available when PCM2PDM filter is supported in hardware.
|
||||
*/
|
||||
I2S_PDM_DATA_FMT_RAW = 1, /*!< PDM RX:
|
||||
* Read the raw PDM data directly in software, without the hardware PDM to PCM filter.
|
||||
|
||||
Reference in New Issue
Block a user