ST / X_NUCLEO_CCA02M1

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 ST Expansion SW Team

Embed: (wiki syntax)

« Back to documentation index

XNucleoCCA02M1 Class Reference

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:
dpinpin name of the data input/output pin of the I2S device.
clkpin name of the clock pin of the I2S device.
wselpin name of the word select output pin of the I2S device (might be NC for PDM sources).
fdpinpin name of the data input pin of the I2S device (for full-duplex operations, default = NC).
mckpin 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:
fptrCallback 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:
tptrPointer to an object.
mptrPointer 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:
0in 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:
0in 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:
nargNarg 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:
initPointer to device specific initalization structure.
Return values:
0in 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:
0in 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.