test public

Dependencies:   HttpServer_snapshot_mbed-os

Embed: (wiki syntax)

« Back to documentation index

SPDIF_RBSP Class Reference

SPDIF_RBSP Class Reference

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

#include <SPDIF_RBSP.h>

Inherits AUDIO_RBSP.

Inherited by SPDIF_GRBoard.

Public Member Functions

 SPDIF_RBSP (PinName audio_clk, PinName tx, PinName rx, bool tx_udata_enable=false, uint8_t int_level=0x80, int32_t max_write_num=16, int32_t max_read_num=16)
 Create a SPDIF_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

SPDIF_RBSP class, defined on the I2C master bus.

Definition at line 35 of file SPDIF_RBSP.h.


Constructor & Destructor Documentation

SPDIF_RBSP ( PinName  audio_clk,
PinName  tx,
PinName  rx,
bool  tx_udata_enable = false,
uint8_t  int_level = 0x80,
int32_t  max_write_num = 16,
int32_t  max_read_num = 16 
)

Create a SPDIF_RBSP object defined on the I2C port.

Parameters:
audio_clkaudio clock
txSPDIF serial data output
rxSPDIF serial data input
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 SPDIF_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.

Definition at line 63 of file SPDIF_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.

Definition at line 67 of file SPDIF_RBSP.cpp.

int32_t GetSsifChNo ( void   )

Get a value of SSIF channel number.

Returns:
SPDIF channel number

Definition at line 79 of file SPDIF_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.

Definition at line 54 of file SPDIF_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.

Definition at line 49 of file SPDIF_RBSP.cpp.

void power ( bool  type = true ) [virtual]

Overloaded power()

Parameters:
typetrue=power up, false=power down

Implements AUDIO_RBSP.

Definition at line 59 of file SPDIF_RBSP.cpp.

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 113 of file SPDIF_RBSP.cpp.

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.

Definition at line 105 of file SPDIF_RBSP.cpp.