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_I2S ST_FREQUENCY_DIVIDER USBDEVICE
Dependents: HelloWorld_CCA02M1 HelloWorld_CCA02M1_mbedOS HelloWorld_CCA02M1 Karaoke_CCA01M1_CCA02M1_mbedOS
Fork of X_NUCLEO_CCA02M1 by
XNucleoCCA02M1 Class Reference
Class representing a X_NUCLEO_CCA02M1 board. More...
#include <XNucleoCCA02M1.h>
Public Member Functions | |
| XNucleoCCA02M1 (PinName dpin, PinName clk, PinName wsel=NC, PinName fdpin=NC, PinName mck=NC) | |
| Constructor. | |
| virtual | ~XNucleoCCA02M1 (void) |
| Destructor. | |
| virtual status_t | init (void *init=NULL) |
| Initializing the X_NUCLEO_CCA02M1 board. | |
| virtual status_t | enable_usb (void) |
| Enabling transmission via USB. | |
| virtual status_t | disable_usb (void) |
| Disabling transmission via USB. | |
| virtual status_t | record (void) |
| Start recording audio. | |
| void | attach (void(*fptr)(int16_t *PCM_buffer, uint16_t PCM_buffer_bytes)) |
| Attach a user-defined callback that will be executed whenever PCM data are ready, i.e. | |
| template<typename T > | |
| void | attach (T *tptr, void(T::*mptr)(int16_t *PCM_buffer, uint16_t PCM_buffer_bytes)) |
| Attach a user-defined non-static callback that will be executed whenever PCM data are ready, i.e. | |
Protected Member Functions | |
| void | i2s_callback (int narg) |
| I2S callback which is executed whenever PCM data are ready, i.e. | |
| void | usb_handler (void) |
| Sending PCM data via USB. | |
Detailed Description
Class representing a X_NUCLEO_CCA02M1 board.
Definition at line 113 of file XNucleoCCA02M1.h.
Constructor & Destructor Documentation
| XNucleoCCA02M1 | ( | PinName | dpin, |
| PinName | clk, | ||
| PinName | wsel = NC, |
||
| PinName | fdpin = NC, |
||
| PinName | mck = NC |
||
| ) |
Constructor.
- Parameters:
-
dpin pin name of the data input/output pin of the I2S device. clk pin name of the clock pin of the I2S device. wsel pin name of the word select output pin of the I2S device (might be NC for PDM sources). fdpin pin name of the data input pin of the I2S device (for full-duplex operations, default = NC). mck pin name of the master clock output pin of the I2S device (additional pin when needed for some external audio devices, default = NC)
Definition at line 127 of file XNucleoCCA02M1.h.
| virtual ~XNucleoCCA02M1 | ( | void | ) | [virtual] |
Destructor.
Definition at line 150 of file XNucleoCCA02M1.h.
Member Function Documentation
| void attach | ( | void(*)(int16_t *PCM_buffer, uint16_t PCM_buffer_bytes) | fptr ) |
Attach a user-defined callback that will be executed whenever PCM data are ready, i.e.
once each millisecond. The provided PCM buffer will be filled by the microphones.
- Parameters:
-
fptr Callback to attach.
- Return values:
-
None.
Definition at line 198 of file XNucleoCCA02M1.cpp.
| void attach | ( | T * | tptr, |
| void(T::*)(int16_t *PCM_buffer, uint16_t PCM_buffer_bytes) | mptr | ||
| ) |
Attach a user-defined non-static callback that will be executed whenever PCM data are ready, i.e.
once each millisecond. The provided PCM buffer will be filled by the microphones.
- Parameters:
-
tptr Pointer to an object. mptr Pointer to an object's callback.
- Return values:
-
None.
Definition at line 218 of file XNucleoCCA02M1.cpp.
| status_t disable_usb | ( | void | ) | [virtual] |
Disabling transmission via USB.
- Parameters:
-
None.
- Return values:
-
0 in case of success, an error code otherwise.
Definition at line 155 of file XNucleoCCA02M1.cpp.
| status_t enable_usb | ( | void | ) | [virtual] |
Enabling transmission via USB.
- Parameters:
-
None.
- Return values:
-
0 in case of success, an error code otherwise.
Definition at line 136 of file XNucleoCCA02M1.cpp.
| void i2s_callback | ( | int | narg ) | [protected] |
I2S callback which is executed whenever PCM data are ready, i.e.
once each millisecond.
- Parameters:
-
narg Narg flag.
- Return values:
-
None.
Definition at line 235 of file XNucleoCCA02M1.cpp.
| status_t init | ( | void * | init = NULL ) |
[virtual] |
Initializing the X_NUCLEO_CCA02M1 board.
- Parameters:
-
init Pointer to device specific initalization structure.
- Return values:
-
0 in case of success, an error code otherwise.
Definition at line 71 of file XNucleoCCA02M1.cpp.
| status_t record | ( | void | ) | [virtual] |
Start recording audio.
- Parameters:
-
None.
- Return values:
-
0 in case of success, an error code otherwise.
Definition at line 171 of file XNucleoCCA02M1.cpp.
| void usb_handler | ( | void | ) | [protected] |
Sending PCM data via USB.
- Parameters:
-
None.
- Return values:
-
None.
Definition at line 312 of file XNucleoCCA02M1.cpp.
Generated on Wed Jul 13 2022 12:32:42 by
1.7.2

X-NUCLEO-CCA02M1 Digital MEMS Microphones Expansion Board.