Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: ST_FREQUENCY_DIVIDER ST_I2S USBDEVICE
Fork of X_NUCLEO_CCA02M1 by
Revision 9:4c3d94b67a6b, committed 2017-04-27
- Comitter:
- davide.aliprandi@st.com
- Date:
- Thu Apr 27 17:05:38 2017 +0200
- Parent:
- 8:4b5736648043
- Child:
- 10:3d5f819c0c56
- Child:
- 11:b2f7f79026e4
- Commit message:
- Message about configuration error added.
Changed in this revision
| BSP/XNucleoCCA02M1.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/BSP/XNucleoCCA02M1.cpp Fri Apr 21 17:43:27 2017 +0000
+++ b/BSP/XNucleoCCA02M1.cpp Thu Apr 27 17:05:38 2017 +0200
@@ -67,16 +67,23 @@
* @brief Initializing the X_NUCLEO_CCA02M1 board.
* @param init Pointer to device specific initalization structure.
* @retval "0" in case of success, an error code otherwise.
+* @note Currently only two channels at 16KHz are supported.
*/
status_t XNucleoCCA02M1::init(void *init)
{
/* Storing data. */
if (init != NULL)
{
- _frequency = (*((XNucleoCCA02M1_init_t *) init)).frequency;
- _channels = (*((XNucleoCCA02M1_init_t *) init)).channels;
+ _frequency = (*((XNucleoCCA02M1_init_t *) init)).frequency;
+ _channels = (*((XNucleoCCA02M1_init_t *) init)).channels;
}
+#ifdef USE_OPEN_PDM2PCM_LIBRARY
+ /* Checking input parameters. */
+ if (!((_frequency == 16000) && (_channels == 2)))
+ error("\r\nConfiguration error: Currently only two channels at 16KHz are supported.\n\r");
+#endif
+
/* Setting configuration. */
switch (_frequency)
{
