test public

Dependencies:   HttpServer_snapshot_mbed-os

Embed: (wiki syntax)

« Back to documentation index

WM8978_RBSP Class Reference

WM8978_RBSP Class Reference

WM8978_RBSP class, defined on the I2C master bus. More...

#include <WM8978_RBSP.h>

Inherits AUDIO_RBSP.

Inherited by AUDIO_GRBoard.

Public Member Functions

 WM8978_RBSP (PinName mosi, PinName miso, PinName sclk, PinName ssel, PinName sck, PinName ws, PinName tx, PinName rx, PinName audio_clk, uint8_t int_level=0x80, int32_t max_write_num=16, int32_t max_read_num=16)
 Create a WM8978_RBSP object defined on the I2C port.
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.
int32_t GetSsifChNo (void)
 Get a value of SSIF channel number.
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)
 Headphone out volume control.
virtual bool micVolume (float VolumeIn)
 Microphone volume.

Detailed Description

WM8978_RBSP class, defined on the I2C master bus.

Definition at line 34 of file WM8978_RBSP.h.


Constructor & Destructor Documentation

WM8978_RBSP ( PinName  mosi,
PinName  miso,
PinName  sclk,
PinName  ssel,
PinName  sck,
PinName  ws,
PinName  tx,
PinName  rx,
PinName  audio_clk,
uint8_t  int_level = 0x80,
int32_t  max_write_num = 16,
int32_t  max_read_num = 16 
)

Create a WM8978_RBSP object defined on the I2C port.

Parameters:
mosiSPI Master Out, Slave In pin
misoSPI Master In, Slave Out pin
sclkSPI Clock pin
sselSPI chip select pin
sckSSIF serial bit clock
wsSSIF word selection
txSSIF serial data output
rxSSIF serial data input
audio_clkaudio clock
int_levelInterupt priority (SSIF)
max_write_numThe upper limit of write buffer (SSIF)
max_read_numThe upper limit of read buffer (SSIF)

Definition at line 29 of file WM8978_RBSP.cpp.


Member Function Documentation

bool format ( char  length ) [virtual]

Set I2S interface bit length and mode.

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

Implements AUDIO_RBSP.

Reimplemented in AUDIO_GRBoard.

Definition at line 88 of file WM8978_RBSP.cpp.

bool frequency ( int  hz ) [virtual]

Set sample frequency.

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

supports frequencies: 44.1kHz Default is 44.1kHz

Implements AUDIO_RBSP.

Reimplemented in AUDIO_GRBoard.

Definition at line 95 of file WM8978_RBSP.cpp.

int32_t GetSsifChNo ( void   )

Get a value of SSIF channel number.

Returns:
SSIF channel number

Definition at line 85 of file WM8978_RBSP.h.

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.

Reimplemented in AUDIO_GRBoard.

Definition at line 76 of file WM8978_RBSP.cpp.

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

Headphone out volume control.

Parameters:
leftVolumeOutLeft headphone-out volume
rightVolumeOutRight headphone-out volume
Returns:
Returns "true" for success, "false" if parameters are out of range

Implements AUDIO_RBSP.

Reimplemented in AUDIO_GRBoard.

Definition at line 67 of file WM8978_RBSP.cpp.

void power ( bool  type = true ) [virtual]

Overloaded power()

Parameters:
typetrue=power up, false=power down

Implements AUDIO_RBSP.

Reimplemented in AUDIO_GRBoard.

Definition at line 84 of file WM8978_RBSP.cpp.

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.

Reimplemented in AUDIO_GRBoard.

Definition at line 107 of file WM8978_RBSP.h.

virtual 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
p_data_confAsynchronous control block structure
Returns:
Number of bytes written on success. negative number on error.

Implements AUDIO_RBSP.

Reimplemented in AUDIO_GRBoard.

Definition at line 96 of file WM8978_RBSP.h.