test public

Dependencies:   HttpServer_snapshot_mbed-os

Embed: (wiki syntax)

« Back to documentation index

PwmOutSpeaker Class Reference

PwmOutSpeaker Class Reference

PwmOutSpeaker class. More...

#include <PwmOutSpeaker.h>

Inherits AUDIO_RBSP.

Public Member Functions

 PwmOutSpeaker (PinName pwm_l, PinName pwm_r)
 Create a PwmOutSpeaker.
virtual void power (bool type=true)
 Overloaded power()
virtual bool format (char length)
 Set I2S interface bit length and mode.
virtual bool frequency (int hz)
 Set sample frequency.
virtual int write (void *const p_data, uint32_t data_size, const rbsp_data_conf_t *const p_data_conf=NULL)
 Enqueue asynchronous write request.
virtual int read (void *const p_data, uint32_t data_size, const rbsp_data_conf_t *const p_data_conf=NULL)
 Enqueue asynchronous read request.
virtual bool outputVolume (float leftVolumeOut, float rightVolumeOut)
 Volume control.
virtual bool micVolume (float VolumeIn)
 Microphone volume.

Detailed Description

PwmOutSpeaker class.

Definition at line 26 of file PwmOutSpeaker.h.


Constructor & Destructor Documentation

PwmOutSpeaker ( PinName  pwm_l,
PinName  pwm_r 
)

Create a PwmOutSpeaker.

Parameters:
pwm_l
pwm_r

Definition at line 19 of file PwmOutSpeaker.cpp.


Member Function Documentation

bool format ( char  length ) [virtual]

Set I2S interface bit length and mode.

Parameters:
lengthSet bit length to 8 or 16 bits
Returns:
true = success, false = failure

Implements AUDIO_RBSP.

Definition at line 45 of file PwmOutSpeaker.cpp.

bool frequency ( int  hz ) [virtual]

Set sample frequency.

Parameters:
frequencySample frequency of data in Hz
Returns:
true = success, false = failure

Supports the following frequencies: 8kHz, 8.021kHz, 32kHz, 44.1kHz, 48kHz Default is 44.1kHz

Implements AUDIO_RBSP.

Definition at line 58 of file PwmOutSpeaker.cpp.

virtual bool micVolume ( float  VolumeIn ) [virtual]

Microphone volume.

Parameters:
VolumeInMicrophone volume
Returns:
Returns "true" for success, "false" if parameters are out of range

Implements AUDIO_RBSP.

Definition at line 78 of file PwmOutSpeaker.h.

bool outputVolume ( float  leftVolumeOut,
float  rightVolumeOut 
) [virtual]

Volume control.

Parameters:
volumeSpeaker volume
Returns:
Returns "true" for success, "false" if parameters are out of range Parameters accept a value, where 0.0 <= parameter <= 1.0 (1.0 = default)

Implements AUDIO_RBSP.

Definition at line 143 of file PwmOutSpeaker.cpp.

virtual void power ( bool  type = true ) [virtual]

Overloaded power()

Parameters:
typetrue=power up, false=power down

Implements AUDIO_RBSP.

Definition at line 37 of file PwmOutSpeaker.h.

virtual int read ( void *const   p_data,
uint32_t  data_size,
const rbsp_data_conf_t *const   p_data_conf = NULL 
) [virtual]

Enqueue asynchronous read request.

Parameters:
p_dataLocation of the data
data_sizeNumber of bytes to read
p_data_confAsynchronous control block structure
Returns:
Number of bytes read on success. negative number on error.

Implements AUDIO_RBSP.

Definition at line 66 of file PwmOutSpeaker.h.

int write ( void *const   p_data,
uint32_t  data_size,
const rbsp_data_conf_t *const   p_data_conf = NULL 
) [virtual]

Enqueue asynchronous write request.

Parameters:
p_dataLocation of the data
data_sizeNumber of bytes to write
Returns:
Number of bytes written on success. negative number on error.

Implements AUDIO_RBSP.

Definition at line 94 of file PwmOutSpeaker.cpp.