arduino-audio-driver
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
TAS5805M Class Reference

Header-only driver class for the TAS5805M amplifier chip. More...

#include <TAS5805M.h>

Public Member Functions

 TAS5805M ()=default
 
error_t configI2S (codec_mode_t mode, I2SDefinition *iface)
 Configure TAS5805 codec mode and I2S interface.
 
error_t ctrlStateActive (codec_mode_t mode, bool ctrl_state_active)
 Control TAS5805 codec chip.
 
error_t deinit (void)
 Deinitialize TAS5805 codec chip.
 
error_t getMute (int *value)
 Get TAS5805 mute status.
 
error_t getVolume (int *value)
 Get voice volume (0~100)
 
error_t init (codec_config_t *codec_cfg)
 Initialize TAS5805 codec chip.
 
void setAddress (int addr)
 Defines the I2C device address.
 
error_t setDampMode (int value)
 Set DAMP mode.
 
error_t setMute (bool enable)
 Set TAS5805 mute or not Continuously call should have an interval time determined by setMuteFade()
 
error_t setMuteFade (int value)
 Mute gradually by (value)ms.
 
void setPowerPin (GpioPin pin)
 Defines the GPIO pin used to power on the amplifier.
 
error_t setVolume (int vol)
 Set voice volume (0~100)
 
void setWire (i2c_bus_handle_t handle)
 Defines the I2C bus instance to be used.
 
error_t transmitRegisters (const tas5805m_cfg_reg_t *conf_buf, int size)
 

Static Public Attributes

static constexpr uint8_t MASTER_VOL_REG_ADDR = 0x4C
 
static constexpr uint8_t MUTE_TIME_REG_ADDR = 0x51
 
static constexpr int TAS5805M_ADDR = 0x2E
 
static constexpr uint8_t TAS5805M_BOOK_00 = 0x00
 
static constexpr uint8_t TAS5805M_BOOK_8C = 0x8c
 
static constexpr uint8_t TAS5805M_DAMP_MODE_BTL = 0x0
 
static constexpr uint8_t TAS5805M_DAMP_MODE_PBTL = 0x04
 
static constexpr uint8_t TAS5805M_PAGE_00 = 0x00
 
static constexpr uint8_t TAS5805M_PAGE_2A = 0x2a
 
static constexpr uint8_t TAS5805M_REG_00 = 0x00
 
static constexpr uint8_t TAS5805M_REG_02 = 0x02
 
static constexpr uint8_t TAS5805M_REG_03 = 0x03
 
static constexpr uint8_t TAS5805M_REG_24 = 0x24
 
static constexpr uint8_t TAS5805M_REG_25 = 0x25
 
static constexpr uint8_t TAS5805M_REG_26 = 0x26
 
static constexpr uint8_t TAS5805M_REG_27 = 0x27
 
static constexpr uint8_t TAS5805M_REG_28 = 0x28
 
static constexpr uint8_t TAS5805M_REG_29 = 0x29
 
static constexpr uint8_t TAS5805M_REG_2A = 0x2a
 
static constexpr uint8_t TAS5805M_REG_2B = 0x2b
 
static constexpr uint8_t TAS5805M_REG_35 = 0x35
 
static constexpr uint8_t TAS5805M_REG_7E = 0x7e
 
static constexpr uint8_t TAS5805M_REG_7F = 0x7f
 
static constexpr int TAS5805M_VOLUME_MAX = 100
 
static constexpr int TAS5805M_VOLUME_MIN = 0
 

Protected Attributes

int i2c_addr = TAS5805M_ADDR
 
i2c_bus_handle_t i2c_handle = nullptr
 
GpioPin power_pin {}
 

Detailed Description

Header-only driver class for the TAS5805M amplifier chip.

Author
Phil Schatzmann

Constructor & Destructor Documentation

◆ TAS5805M()

TAS5805M ( )
default

Member Function Documentation

◆ configI2S()

error_t configI2S ( codec_mode_t  mode,
I2SDefinition *  iface 
)
inline

Configure TAS5805 codec mode and I2S interface.

◆ ctrlStateActive()

error_t ctrlStateActive ( codec_mode_t  mode,
bool  ctrl_state_active 
)
inline

Control TAS5805 codec chip.

◆ deinit()

error_t deinit ( void  )
inline

Deinitialize TAS5805 codec chip.

◆ getMute()

error_t getMute ( int *  value)
inline

Get TAS5805 mute status.

◆ getVolume()

error_t getVolume ( int *  value)
inline

Get voice volume (0~100)

FIXME: Got the digit volume is not right.

◆ init()

error_t init ( codec_config_t *  codec_cfg)
inline

Initialize TAS5805 codec chip.

◆ setAddress()

void setAddress ( int  addr)
inline

Defines the I2C device address.

◆ setDampMode()

error_t setDampMode ( int  value)
inline

Set DAMP mode.

Parameters
valueTAS5805M_DAMP_MODE_BTL or TAS5805M_DAMP_MODE_PBTL

◆ setMute()

error_t setMute ( bool  enable)
inline

Set TAS5805 mute or not Continuously call should have an interval time determined by setMuteFade()

◆ setMuteFade()

error_t setMuteFade ( int  value)
inline

Mute gradually by (value)ms.

Parameters
valueTime for mute with millisecond.

◆ setPowerPin()

void setPowerPin ( GpioPin  pin)
inline

Defines the GPIO pin used to power on the amplifier.

◆ setVolume()

error_t setVolume ( int  vol)
inline

Set voice volume (0~100)

◆ setWire()

void setWire ( i2c_bus_handle_t  handle)
inline

Defines the I2C bus instance to be used.

◆ transmitRegisters()

error_t transmitRegisters ( const tas5805m_cfg_reg_t *  conf_buf,
int  size 
)
inline

Member Data Documentation

◆ i2c_addr

int i2c_addr = TAS5805M_ADDR
protected

◆ i2c_handle

i2c_bus_handle_t i2c_handle = nullptr
protected

◆ MASTER_VOL_REG_ADDR

constexpr uint8_t MASTER_VOL_REG_ADDR = 0x4C
staticconstexpr

◆ MUTE_TIME_REG_ADDR

constexpr uint8_t MUTE_TIME_REG_ADDR = 0x51
staticconstexpr

◆ power_pin

GpioPin power_pin {}
protected

◆ TAS5805M_ADDR

constexpr int TAS5805M_ADDR = 0x2E
staticconstexpr

◆ TAS5805M_BOOK_00

constexpr uint8_t TAS5805M_BOOK_00 = 0x00
staticconstexpr

◆ TAS5805M_BOOK_8C

constexpr uint8_t TAS5805M_BOOK_8C = 0x8c
staticconstexpr

◆ TAS5805M_DAMP_MODE_BTL

constexpr uint8_t TAS5805M_DAMP_MODE_BTL = 0x0
staticconstexpr

◆ TAS5805M_DAMP_MODE_PBTL

constexpr uint8_t TAS5805M_DAMP_MODE_PBTL = 0x04
staticconstexpr

◆ TAS5805M_PAGE_00

constexpr uint8_t TAS5805M_PAGE_00 = 0x00
staticconstexpr

◆ TAS5805M_PAGE_2A

constexpr uint8_t TAS5805M_PAGE_2A = 0x2a
staticconstexpr

◆ TAS5805M_REG_00

constexpr uint8_t TAS5805M_REG_00 = 0x00
staticconstexpr

◆ TAS5805M_REG_02

constexpr uint8_t TAS5805M_REG_02 = 0x02
staticconstexpr

◆ TAS5805M_REG_03

constexpr uint8_t TAS5805M_REG_03 = 0x03
staticconstexpr

◆ TAS5805M_REG_24

constexpr uint8_t TAS5805M_REG_24 = 0x24
staticconstexpr

◆ TAS5805M_REG_25

constexpr uint8_t TAS5805M_REG_25 = 0x25
staticconstexpr

◆ TAS5805M_REG_26

constexpr uint8_t TAS5805M_REG_26 = 0x26
staticconstexpr

◆ TAS5805M_REG_27

constexpr uint8_t TAS5805M_REG_27 = 0x27
staticconstexpr

◆ TAS5805M_REG_28

constexpr uint8_t TAS5805M_REG_28 = 0x28
staticconstexpr

◆ TAS5805M_REG_29

constexpr uint8_t TAS5805M_REG_29 = 0x29
staticconstexpr

◆ TAS5805M_REG_2A

constexpr uint8_t TAS5805M_REG_2A = 0x2a
staticconstexpr

◆ TAS5805M_REG_2B

constexpr uint8_t TAS5805M_REG_2B = 0x2b
staticconstexpr

◆ TAS5805M_REG_35

constexpr uint8_t TAS5805M_REG_35 = 0x35
staticconstexpr

◆ TAS5805M_REG_7E

constexpr uint8_t TAS5805M_REG_7E = 0x7e
staticconstexpr

◆ TAS5805M_REG_7F

constexpr uint8_t TAS5805M_REG_7F = 0x7f
staticconstexpr

◆ TAS5805M_VOLUME_MAX

constexpr int TAS5805M_VOLUME_MAX = 100
staticconstexpr

◆ TAS5805M_VOLUME_MIN

constexpr int TAS5805M_VOLUME_MIN = 0
staticconstexpr

The documentation for this class was generated from the following file: