STMicroelectronics' implementation of an I2S driver, also including DMA support.

Dependents:   temp X_NUCLEO_CCA01M1 X_NUCLEO_CCA01M1 X_NUCLEO_CCA02M1

Platform compatibility

This driver has been designed to support a wide range of the Nucleo F4 Family of platforms and MCUs, but not all members of this family support I2S and/or some of the members might require slight modifications to the sources of this driver in order to make it work on those.

This driver has for now been tested only with the following platforms:

Revision:
10:1a612c2e4a85
Parent:
9:c4c2240e06d6
Child:
12:7309748f058a
--- a/targets/TARGET_STM/stm_i2s_api.c	Thu Dec 22 11:10:10 2016 +0100
+++ b/targets/TARGET_STM/stm_i2s_api.c	Thu Dec 22 12:02:24 2016 +0100
@@ -898,13 +898,16 @@
 
 int8_t i2s_harmonize(i2s_t *dev_i2s_1, uint32_t *freq_i2s_1, i2s_t *dev_i2s_2, uint32_t *freq_i2s_2)
 {
-    if (*freq_i2s_1 == *freq_i2s_2)
-        return 0;
-
     /* Compute the real frequencies. */
     float f1 = i2s_compute_real_frequency(dev_i2s_1);
     float f2 = i2s_compute_real_frequency(dev_i2s_2);
 
+    if (f1 == f2) {
+        *freq_i2s_1 = (uint32_t)f1;
+        *freq_i2s_2 = (uint32_t)f2;
+        return 0;
+    }
+
     //printf("REAL: %f %f\r\n", f1, f2);
 
     /* Compute the desired frequencies so that they are multiple one of the