diff options
Diffstat (limited to 'ports/stm32/machine_i2s.c')
-rw-r--r-- | ports/stm32/machine_i2s.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/ports/stm32/machine_i2s.c b/ports/stm32/machine_i2s.c index dbee81bb3..a2a0a8291 100644 --- a/ports/stm32/machine_i2s.c +++ b/ports/stm32/machine_i2s.c @@ -94,19 +94,19 @@ typedef struct _machine_i2s_obj_t { const dma_descr_t *dma_descr_rx; } machine_i2s_obj_t; -STATIC mp_obj_t machine_i2s_deinit(mp_obj_t self_in); +static mp_obj_t machine_i2s_deinit(mp_obj_t self_in); // The frame map is used with the readinto() method to transform the audio sample data coming // from DMA memory (32-bit stereo) to the format specified // in the I2S constructor. e.g. 16-bit mono -STATIC const int8_t i2s_frame_map[NUM_I2S_USER_FORMATS][I2S_RX_FRAME_SIZE_IN_BYTES] = { +static const int8_t i2s_frame_map[NUM_I2S_USER_FORMATS][I2S_RX_FRAME_SIZE_IN_BYTES] = { { 0, 1, -1, -1, -1, -1, -1, -1 }, // Mono, 16-bits { 2, 3, 0, 1, -1, -1, -1, -1 }, // Mono, 32-bits { 0, 1, -1, -1, 2, 3, -1, -1 }, // Stereo, 16-bits { 2, 3, 0, 1, 6, 7, 4, 5 }, // Stereo, 32-bits }; -STATIC const plli2s_config_t plli2s_config[] = PLLI2S_TABLE; +static const plli2s_config_t plli2s_config[] = PLLI2S_TABLE; void machine_i2s_init0() { for (uint8_t i = 0; i < MICROPY_HW_MAX_I2S; i++) { @@ -114,7 +114,7 @@ void machine_i2s_init0() { } } -STATIC bool lookup_plli2s_config(int8_t bits, int32_t rate, uint16_t *plli2sn, uint16_t *plli2sr) { +static bool lookup_plli2s_config(int8_t bits, int32_t rate, uint16_t *plli2sn, uint16_t *plli2sr) { for (uint16_t i = 0; i < MP_ARRAY_SIZE(plli2s_config); i++) { if ((plli2s_config[i].bits == bits) && (plli2s_config[i].rate == rate)) { *plli2sn = plli2s_config[i].plli2sn; @@ -148,7 +148,7 @@ STATIC bool lookup_plli2s_config(int8_t bits, int32_t rate, uint16_t *plli2sn, u // where: // LEFT Channel = 0x99, 0xBB, 0x11, 0x22 // RIGHT Channel = 0x44, 0x55, 0xAB, 0x77 -STATIC void reformat_32_bit_samples(int32_t *sample, uint32_t num_samples) { +static void reformat_32_bit_samples(int32_t *sample, uint32_t num_samples) { int16_t sample_ms; int16_t sample_ls; for (uint32_t i = 0; i < num_samples; i++) { @@ -158,7 +158,7 @@ STATIC void reformat_32_bit_samples(int32_t *sample, uint32_t num_samples) { } } -STATIC int8_t get_frame_mapping_index(int8_t bits, format_t format) { +static int8_t get_frame_mapping_index(int8_t bits, format_t format) { if (format == MONO) { if (bits == 16) { return 0; @@ -174,7 +174,7 @@ STATIC int8_t get_frame_mapping_index(int8_t bits, format_t format) { } } -STATIC int8_t get_dma_bits(uint16_t mode, int8_t bits) { +static int8_t get_dma_bits(uint16_t mode, int8_t bits) { if (mode == I2S_MODE_MASTER_TX) { if (bits == 16) { return I2S_DATAFORMAT_16B; @@ -189,7 +189,7 @@ STATIC int8_t get_dma_bits(uint16_t mode, int8_t bits) { } // function is used in IRQ context -STATIC void empty_dma(machine_i2s_obj_t *self, ping_pong_t dma_ping_pong) { +static void empty_dma(machine_i2s_obj_t *self, ping_pong_t dma_ping_pong) { uint16_t dma_buffer_offset = 0; if (dma_ping_pong == TOP_HALF) { @@ -212,7 +212,7 @@ STATIC void empty_dma(machine_i2s_obj_t *self, ping_pong_t dma_ping_pong) { } // function is used in IRQ context -STATIC void feed_dma(machine_i2s_obj_t *self, ping_pong_t dma_ping_pong) { +static void feed_dma(machine_i2s_obj_t *self, ping_pong_t dma_ping_pong) { uint16_t dma_buffer_offset = 0; if (dma_ping_pong == TOP_HALF) { @@ -262,7 +262,7 @@ STATIC void feed_dma(machine_i2s_obj_t *self, ping_pong_t dma_ping_pong) { MP_HAL_CLEAN_DCACHE(dma_buffer_p, SIZEOF_HALF_DMA_BUFFER_IN_BYTES); } -STATIC bool i2s_init(machine_i2s_obj_t *self) { +static bool i2s_init(machine_i2s_obj_t *self) { // init the GPIO lines GPIO_InitTypeDef GPIO_InitStructure; @@ -439,7 +439,7 @@ void HAL_I2S_TxHalfCpltCallback(I2S_HandleTypeDef *hi2s) { feed_dma(self, TOP_HALF); } -STATIC void mp_machine_i2s_init_helper(machine_i2s_obj_t *self, mp_arg_val_t *args) { +static void mp_machine_i2s_init_helper(machine_i2s_obj_t *self, mp_arg_val_t *args) { memset(&self->hi2s, 0, sizeof(self->hi2s)); // are I2S pin assignments valid? @@ -558,7 +558,7 @@ STATIC void mp_machine_i2s_init_helper(machine_i2s_obj_t *self, mp_arg_val_t *ar } } -STATIC machine_i2s_obj_t *mp_machine_i2s_make_new_instance(mp_int_t i2s_id) { +static machine_i2s_obj_t *mp_machine_i2s_make_new_instance(mp_int_t i2s_id) { uint8_t i2s_id_zero_base = 0; if (0) { @@ -590,7 +590,7 @@ STATIC machine_i2s_obj_t *mp_machine_i2s_make_new_instance(mp_int_t i2s_id) { return self; } -STATIC void mp_machine_i2s_deinit(machine_i2s_obj_t *self) { +static void mp_machine_i2s_deinit(machine_i2s_obj_t *self) { if (self->ring_buffer_storage != NULL) { dma_deinit(self->dma_descr_tx); dma_deinit(self->dma_descr_rx); @@ -611,7 +611,7 @@ STATIC void mp_machine_i2s_deinit(machine_i2s_obj_t *self) { } } -STATIC void mp_machine_i2s_irq_update(machine_i2s_obj_t *self) { +static void mp_machine_i2s_irq_update(machine_i2s_obj_t *self) { (void)self; } |