Skip to content

Commit 87b93f2

Browse files
committed
revert commit/73ca054
1 parent 5065c93 commit 87b93f2

File tree

2 files changed

+20
-92
lines changed

2 files changed

+20
-92
lines changed

components/hal/esp32/include/hal/i2s_ll.h

Lines changed: 10 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424

2525
#include <stdbool.h>
2626
#include "hal/misc.h"
27-
#include "hal/assert.h"
2827
#include "soc/i2s_periph.h"
2928
#include "soc/i2s_struct.h"
3029
#include "hal/i2s_types.h"
@@ -689,57 +688,22 @@ static inline void i2s_ll_rx_enable_msb_shift(i2s_dev_t *hw, bool msb_shift_enab
689688
* @brief Set I2S tx chan mode
690689
*
691690
* @param hw Peripheral I2S hardware instance address.
692-
* @param chan_fmt The channel format of the TX channel
693-
*/
694-
static inline void i2s_ll_tx_set_chan_mod(i2s_dev_t *hw, i2s_channel_fmt_t chan_fmt)
695-
{
696-
switch (chan_fmt) {
697-
case I2S_CHANNEL_FMT_ALL_RIGHT:
698-
hw->conf_chan.tx_chan_mod = 1;
699-
break;
700-
case I2S_CHANNEL_FMT_ONLY_RIGHT:
701-
hw->conf_chan.tx_chan_mod = 3;
702-
break;
703-
case I2S_CHANNEL_FMT_ALL_LEFT:
704-
hw->conf_chan.tx_chan_mod = 2;
705-
break;
706-
case I2S_CHANNEL_FMT_ONLY_LEFT:
707-
hw->conf_chan.tx_chan_mod = 4;
708-
break;
709-
case I2S_CHANNEL_FMT_RIGHT_LEFT:
710-
hw->conf_chan.tx_chan_mod = 0;
711-
break;
712-
default:
713-
HAL_ASSERT(false);
714-
}
691+
* @param val value to set tx chan mode
692+
*/
693+
static inline void i2s_ll_tx_set_chan_mod(i2s_dev_t *hw, uint32_t val)
694+
{
695+
hw->conf_chan.tx_chan_mod = val;
715696
}
716697

717698
/**
718699
* @brief Set I2S rx chan mode
719700
*
720701
* @param hw Peripheral I2S hardware instance address.
721-
* @param chan_fmt The channel format of the RX channel
722-
* @param is_msb_right Is msb_right enabled, if it does, we need to flip the channel
723-
*/
724-
static inline void i2s_ll_rx_set_chan_mod(i2s_dev_t *hw, i2s_channel_fmt_t chan_fmt, bool is_msb_right)
725-
{
726-
switch (chan_fmt) {
727-
case I2S_CHANNEL_FMT_ALL_RIGHT:
728-
/* fall through */
729-
case I2S_CHANNEL_FMT_ONLY_RIGHT:
730-
hw->conf_chan.rx_chan_mod = is_msb_right ? 1 : 2;
731-
break;
732-
case I2S_CHANNEL_FMT_ALL_LEFT:
733-
/* fall through */
734-
case I2S_CHANNEL_FMT_ONLY_LEFT:
735-
hw->conf_chan.rx_chan_mod = is_msb_right ? 2 : 1;
736-
break;
737-
case I2S_CHANNEL_FMT_RIGHT_LEFT:
738-
hw->conf_chan.rx_chan_mod = 0;
739-
break;
740-
default:
741-
HAL_ASSERT(false);
742-
}
702+
* @param val value to set rx chan mode
703+
*/
704+
static inline void i2s_ll_rx_set_chan_mod(i2s_dev_t *hw, uint32_t val)
705+
{
706+
hw->conf_chan.rx_chan_mod = val;
743707
}
744708

745709
/**

components/hal/esp32s2/include/hal/i2s_ll.h

Lines changed: 10 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424

2525
#include <stdbool.h>
2626
#include "hal/misc.h"
27-
#include "hal/assert.h"
2827
#include "soc/i2s_periph.h"
2928
#include "soc/i2s_struct.h"
3029
#include "hal/i2s_types.h"
@@ -765,57 +764,22 @@ static inline void i2s_ll_rx_enable_msb_shift(i2s_dev_t *hw, bool msb_shift_enab
765764
* @brief Set I2S tx chan mode
766765
*
767766
* @param hw Peripheral I2S hardware instance address.
768-
* @param chan_fmt The channel format of the TX channel
769-
*/
770-
static inline void i2s_ll_tx_set_chan_mod(i2s_dev_t *hw, i2s_channel_fmt_t chan_fmt)
771-
{
772-
switch (chan_fmt) {
773-
case I2S_CHANNEL_FMT_ALL_RIGHT:
774-
hw->conf_chan.tx_chan_mod = 1;
775-
break;
776-
case I2S_CHANNEL_FMT_ONLY_RIGHT:
777-
hw->conf_chan.tx_chan_mod = 3;
778-
break;
779-
case I2S_CHANNEL_FMT_ALL_LEFT:
780-
hw->conf_chan.tx_chan_mod = 2;
781-
break;
782-
case I2S_CHANNEL_FMT_ONLY_LEFT:
783-
hw->conf_chan.tx_chan_mod = 4;
784-
break;
785-
case I2S_CHANNEL_FMT_RIGHT_LEFT:
786-
hw->conf_chan.tx_chan_mod = 0;
787-
break;
788-
default:
789-
HAL_ASSERT(false);
790-
}
767+
* @param val value to set tx chan mode
768+
*/
769+
static inline void i2s_ll_tx_set_chan_mod(i2s_dev_t *hw, uint32_t val)
770+
{
771+
hw->conf_chan.tx_chan_mod = val;
791772
}
792773

793774
/**
794775
* @brief Set I2S rx chan mode
795776
*
796777
* @param hw Peripheral I2S hardware instance address.
797-
* @param chan_fmt The channel format of the RX channel
798-
* @param is_msb_right Is msb_right enabled, if it does, we need to flip the channel
799-
*/
800-
static inline void i2s_ll_rx_set_chan_mod(i2s_dev_t *hw, i2s_channel_fmt_t chan_fmt, bool is_msb_right)
801-
{
802-
switch (chan_fmt) {
803-
case I2S_CHANNEL_FMT_ALL_RIGHT:
804-
/* fall through */
805-
case I2S_CHANNEL_FMT_ONLY_RIGHT:
806-
hw->conf_chan.rx_chan_mod = is_msb_right ? 1 : 2;
807-
break;
808-
case I2S_CHANNEL_FMT_ALL_LEFT:
809-
/* fall through */
810-
case I2S_CHANNEL_FMT_ONLY_LEFT:
811-
hw->conf_chan.rx_chan_mod = is_msb_right ? 2 : 1;
812-
break;
813-
case I2S_CHANNEL_FMT_RIGHT_LEFT:
814-
hw->conf_chan.rx_chan_mod = 0;
815-
break;
816-
default:
817-
HAL_ASSERT(false);
818-
}
778+
* @param val value to set rx chan mode
779+
*/
780+
static inline void i2s_ll_rx_set_chan_mod(i2s_dev_t *hw, uint32_t val)
781+
{
782+
hw->conf_chan.rx_chan_mod = val;
819783
}
820784

821785
/**

0 commit comments

Comments
 (0)