test public
Dependencies: HttpServer_snapshot_mbed-os
TLV320_RBSP Class Reference
TLV320_RBSP class, defined on the I2C master bus. More...
#include <TLV320_RBSP.h>
Inherits AUDIO_RBSP.
Inherited by AUDIO_GRBoard.
Public Member Functions | |
TLV320_RBSP (PinName cs, PinName sda, PinName scl, PinName sck, PinName ws, PinName tx, PinName rx, uint8_t int_level=0x80, int32_t max_write_num=16, int32_t max_read_num=16) | |
Create a TLV320_RBSP object defined on the I2C port. | |
void | power (int device) |
Overloaded power() function default = 0x80, record requires 0x02. | |
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. | |
void | reset (void) |
Reset TLV320. | |
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. | |
bool | inputVolume (float leftVolumeIn, float rightVolumeIn) |
Line in volume control i.e. | |
virtual bool | outputVolume (float leftVolumeOut, float rightVolumeOut) |
Headphone out volume control. | |
void | bypass (bool bypassVar) |
Analog audio path control (Bypass) function default = false. | |
void | mic (bool micVar) |
Analog audio path control (Input select for ADC) function default = false. | |
void | micVolume (bool mute, bool boost) |
Microphone volume. | |
virtual bool | micVolume (float VolumeIn) |
Microphone volume. | |
void | mute (bool softMute) |
Digital audio path control. |
Detailed Description
TLV320_RBSP class, defined on the I2C master bus.
Definition at line 34 of file TLV320_RBSP.h.
Constructor & Destructor Documentation
TLV320_RBSP | ( | PinName | cs, |
PinName | sda, | ||
PinName | scl, | ||
PinName | sck, | ||
PinName | ws, | ||
PinName | tx, | ||
PinName | rx, | ||
uint8_t | int_level = 0x80 , |
||
int32_t | max_write_num = 16 , |
||
int32_t | max_read_num = 16 |
||
) |
Create a TLV320_RBSP object defined on the I2C port.
- Parameters:
-
cs Control port input latch/address select (codec pin) sda I2C data line pin scl I2C clock line pin sck SSIF serial bit clock ws SSIF word selection tx SSIF serial data output rx SSIF serial data input int_level Interupt priority (SSIF) max_write_num The upper limit of write buffer (SSIF) max_read_num The upper limit of read buffer (SSIF)
Definition at line 31 of file TLV320_RBSP.cpp.
Member Function Documentation
void bypass | ( | bool | bypassVar ) |
Analog audio path control (Bypass) function default = false.
- Parameters:
-
bypassVar Route analogue audio direct from line in to headphone out
Definition at line 119 of file TLV320_RBSP.cpp.
bool format | ( | char | length ) | [virtual] |
Set I2S interface bit length and mode.
- Parameters:
-
length Set bit length to 16, 20, 24 or 32 bits
- Returns:
- true = success, false = failure
Implements AUDIO_RBSP.
Reimplemented in AUDIO_GRBoard.
Definition at line 175 of file TLV320_RBSP.cpp.
bool frequency | ( | int | hz ) | [virtual] |
Set sample frequency.
- Parameters:
-
frequency Sample frequency of data in Hz
- Returns:
- true = success, false = failure
The TLV320 supports the following frequencies: 8kHz, 8.021kHz, 32kHz, 44.1kHz, 48kHz, 88.2kHz, 96kHz Default is 44.1kHz
Implements AUDIO_RBSP.
Reimplemented in AUDIO_GRBoard.
Definition at line 204 of file TLV320_RBSP.cpp.
int32_t GetSsifChNo | ( | void | ) |
Get a value of SSIF channel number.
- Returns:
- SSIF channel number
Definition at line 106 of file TLV320_RBSP.h.
bool inputVolume | ( | float | leftVolumeIn, |
float | rightVolumeIn | ||
) |
Line in volume control i.e.
record volume
- Parameters:
-
leftVolumeIn Left line-in volume rightVolumeIn Right line-in volume
- Returns:
- Returns "true" for success, "false" if parameters are out of range Parameters accept a value, where 0.0 < parameter < 1.0 and where 0.0 maps to -34.5dB and 1.0 maps to +12dB (0.74 = 0 dB default).
Definition at line 71 of file TLV320_RBSP.cpp.
void mic | ( | bool | micVar ) |
Analog audio path control (Input select for ADC) function default = false.
- Parameters:
-
micVar Input select for ADC. true : Microphone , false : Line
Definition at line 132 of file TLV320_RBSP.cpp.
void micVolume | ( | bool | mute, |
bool | boost | ||
) |
Microphone volume.
- Parameters:
-
mute Microphone mute. true : mute , false : normal boost Microphone boost. true : 20dB , false : 0dB
Definition at line 143 of file TLV320_RBSP.cpp.
virtual bool micVolume | ( | float | VolumeIn ) | [virtual] |
Microphone volume.
- Parameters:
-
VolumeIn Microphone volume
- Returns:
- Returns "true" for success, "false" if parameters are out of range
Implements AUDIO_RBSP.
Reimplemented in AUDIO_GRBoard.
Definition at line 176 of file TLV320_RBSP.h.
void mute | ( | bool | softMute ) |
Digital audio path control.
- Parameters:
-
softMute Mute output
Definition at line 159 of file TLV320_RBSP.cpp.
bool outputVolume | ( | float | leftVolumeOut, |
float | rightVolumeOut | ||
) | [virtual] |
Headphone out volume control.
- Parameters:
-
leftVolumeOut Left headphone-out volume rightVolumeOut Right headphone-out volume
- Returns:
- Returns "true" for success, "false" if parameters are out of range Parameters accept a value, where 0.0 < parameter < 1.0 and where 0.0 maps to -73dB (mute) and 1.0 maps to +6dB (0.5 = default)
Implements AUDIO_RBSP.
Reimplemented in AUDIO_GRBoard.
Definition at line 95 of file TLV320_RBSP.cpp.
virtual void power | ( | bool | type = true ) |
[virtual] |
Overloaded power()
- Parameters:
-
type true=power up, false=power down
Implements AUDIO_RBSP.
Reimplemented in AUDIO_GRBoard.
Definition at line 72 of file TLV320_RBSP.h.
void power | ( | int | device ) |
Overloaded power() function default = 0x80, record requires 0x02.
- Parameters:
-
device Call individual devices to power up/down Device power 0x00 = On 0x80 = Off Clock 0x00 = On 0x40 = Off Oscillator 0x00 = On 0x20 = Off Outputs 0x00 = On 0x10 = Off DAC 0x00 = On 0x08 = Off ADC 0x00 = On 0x04 = Off Microphone input 0x00 = On 0x02 = Off Line input 0x00 = On 0x01 = Off
Definition at line 169 of file TLV320_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_data Location of the data data_size Number of bytes to read p_data_conf Asynchronous control block structure
- Returns:
- Number of bytes read on success. negative number on error.
Implements AUDIO_RBSP.
Reimplemented in AUDIO_GRBoard.
Definition at line 128 of file TLV320_RBSP.h.
void reset | ( | void | ) |
Reset TLV320.
Definition at line 257 of file TLV320_RBSP.cpp.
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_data Location of the data data_size Number of bytes to write p_data_conf Asynchronous control block structure
- Returns:
- Number of bytes written on success. negative number on error.
Implements AUDIO_RBSP.
Reimplemented in AUDIO_GRBoard.
Definition at line 117 of file TLV320_RBSP.h.
Generated on Wed Jul 13 2022 05:33:38 by 1.7.2