API Reference

adafruit_pcm51xx

CircuitPython driver for the Adafruit PCM51xx I2S DAC

  • Author(s): Liz Clark

Implementation Notes

Hardware:

Software and Dependencies:

class adafruit_pcm51xx.PCM51XX(i2c_bus: busio.I2C, address: int = PCM51XX_DEFAULT_ADDR)

Driver for the PCM51xx I2S DAC.

Parameters:
  • i2c_bus (I2C) – The I2C bus the PCM51xx is connected to.

  • address (int) – The I2C device address. Defaults to PCM51XX_DEFAULT_ADDR

reset_modules() bool

Reset interpolation filter and DAC modules.

Returns:

True if successful, False if timeout

reset_registers() bool

Reset registers back to their initial values.

Returns:

True if successful, False if timeout

property standby: bool

Standby mode control.

property powerdown: bool

Powerdown mode control.

property i2s_format: int

I2S data format (I2S_FORMAT_*).

property i2s_size: int

I2S word length (I2S_SIZE_*).

property pll_reference: int

PLL reference clock source (PLL_REF_*).

property volume_db: tuple[float, float]

Digital volume in dB for left and right channels.

Returns:

Tuple of (left_db, right_db)

property dsp_boot: bool

Check if DSP boot is complete (read-only).

property power_state: int

Current power state (read-only, POWER_*).

property dac_source: int

DAC clock source (DAC_CLK_*).

property auto_mute: bool

Auto mute enable.

property mute: bool

Mute state for both channels.

property pll_enabled: bool

PLL enable.

property pll_locked: bool

Check if PLL is locked (read-only).

property deemphasis: bool

De-emphasis filter enable.

property vcom_enabled: bool

VCOM mode enable (True for VCOM, False for VREF).

property vcom_powered: bool

VCOM power state.

property gpio5_output: int

GPIO5 output function (GPIO5_*).

property ignore_fs_detect: bool

Ignore FS detection.

property ignore_bck_detect: bool

Ignore BCK detection.

property ignore_sck_detect: bool

Ignore SCK detection.

property ignore_clock_halt: bool

Ignore clock halt detection.

property ignore_clock_missing: bool

Ignore LRCK/BCK missing detection.

property disable_clock_autoset: bool

Disable clock divider autoset mode.

property ignore_pll_unlock: bool

Ignore PLL unlock detection.

digital_read(pin: int) bool

Read digital state of GPIO pin.

Parameters:

pin – GPIO pin number (1-6)

Returns:

True if pin is high, False if low

Raises:

ValueError – If pin number is invalid

class Pin(pcm: PCM51XX, pin: int)

Digitalio-style pin interface.

switch_to_output(value: bool = False, drive_mode: int = None) None

Switch the pin to output mode.

switch_to_input(pull: int = None) None

Switch the pin to input mode.

property direction: int

Get pin direction (0=INPUT, 1=OUTPUT).

property value: bool

Get or set the pin value.