API Reference

adafruit_yoto.cr95hf

CR95HF NFC/RFID Transceiver Driver for CircuitPython

  • Author(s): Liz Clark

class adafruit_yoto.cr95hf.CR95HF(uart, wake_pulse_ms=100)

CR95HF NFC/RFID driver for CircuitPython

static card_type(sak)

Card type from SAK byte

property device_name

Device identification string

field_off()

Turn off RF field

read_tag()

Read ISO14443-A tag UID. Returns (uid_bytes, sak_byte) or (None, None)

adafruit_yoto.es8156

CircuitPython driver for the ES8156 I2S DAC

  • Author(s): Liz Clark

class adafruit_yoto.es8156.ES8156(i2c_bus, address=0x08)

Driver for the ES8156 I2S DAC

Initialize the ES8156 DAC.

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

  • address (int) – The I2C device address (default: 0x08)

property chip_id

Chip ID.

property chip_version

Chip version.

configure(use_sclk_as_mclk=False)

Configure the ES8156 with default settings for I2S peripheral mode.

Parameters:

use_sclk_as_mclk (bool) – Use SCLK as main clock source (default: False)

This configures the ES8156 for: - I2S peripheral mode - 16-bit audio - Internal clock generation from SCLK (if use_sclk_as_mclk=True) - All analog outputs powered up and unmuted

property mute

Mute for all outputs (True = muted, False = unmuted)

volume

Volume level (0-255, where 0 is mute and 255 is maximum)

adafruit_yoto.graphics

Helper Library for the Yoto Players

  • Author(s): Liz Clark

Implementation Notes

Hardware:

  • Yoto Mini Player running CircuitPython

Software and Dependencies:

class adafruit_yoto.graphics.Graphics(*, default_bg=0x000000, rotation=0, auto_refresh=True, debug=False)

Graphics Helper Class for the Yoto Mini Library

Parameters:
  • default_bg – The path to your default background image file or a hex color. Defaults to 0x000000.

  • rotation (int) – Default rotation (0, 90, 180, 270). Defaults to 0.

  • auto_refresh (bool) – Automatically refresh the display after updates. Defaults to True.

  • debug – Turn on debug print outs. Defaults to False.

refresh()

Manually refresh the display

adafruit_yoto.network

Helper library for the Yoto Players

  • Author(s): Liz Clark

Implementation Notes

Hardware:

  • Yoto Mini Player running CircuitPython

Software and Dependencies:

class adafruit_yoto.network.Network(*, status_neopixel=None, extract_values=True, debug=False)

Network Helper Class for the Yoto Mini

Parameters:
  • status_neopixel – The pin for the status NeoPixel. Defaults to None.

  • extract_values (bool) – If true, single-length fetched values are automatically extracted from lists and tuples. Defaults to True.

  • debug – Turn on debug print outs. Defaults to False.

property enabled

Get or Set whether the WiFi is enabled

adafruit_yoto.peripherals

Helper Library for the Yoto Players

  • Author(s): Liz Clark

Implementation Notes

Hardware:

  • Yoto Mini Player running CircuitPython

Software and Dependencies:

class adafruit_yoto.peripherals.Peripherals

Peripherals Helper Class for the Yoto Mini Library

Provides access to: - NFC/RFID reader (CR95HF) - I2S DAC (ES8156) and audio playback - Battery charger (SGM41513) - RTC (PCF8563) - Two rotary encoders with buttons - IOExpander control pins

Initialize all Yoto Mini peripherals

property audio

Access the I2SOut audio interface directly

property battery

Access the SGM41513 battery charger directly

property charge_complete

Whether charging is complete

property charge_current

Get the charge current setting in mA

property charge_status

Get current battery and charging status

property charge_status_pin

Charge status pin state

property charge_voltage

Get the charge voltage setting in mV

property charging

Whether the battery is currently charging

property dac

Access the ES8156 DAC directly

property datetime

Get/set the RTC datetime as time.struct_time

deinit()

Deinitialize all peripherals and release hardware resources

property encoder_left

Access encoder 1 directly

property encoder_left_button

Whether encoder 1 button is pressed (True=pressed)

property encoder_left_position

Get the current position of encoder 1

property encoder_right

Access encoder 2 directly

property encoder_right_button

Whether encoder 2 button is pressed (True=pressed)

property encoder_right_position

Get the current position of encoder 2

get_card_type(sak)

Get card type description from SAK byte

property headphone_detect

Headphone jack detection pin state

property level_converter

Level converter control pin

property level_power_enable

Level shifter power enable pin

property level_vinhold

Level shifter VINHOLD pin

property mute

Get/set the mute state (True=muted, False=unmuted)

property nfc

Access the CR95HF NFC reader directly

property pactrl

Power amplifier control pin

play(audio_sample, loop=False)

Play an audio sample

property playing

Whether audio is currently playing

property plug_status

USB plug status pin state

property power_button

Power button state

read_nfc_tag()

Read an NFC tag if present. Returns (uid_bytes, sak_byte) or (None, None)

property rtc

Access the PCF8563 RTC directly

property rtc_interrupt

RTC interrupt pin state (if available)

property rtc_valid

Whether the RTC has valid time (not compromised)

stop()

Stop audio playback

property tilt

Tilt sensor state

property volume

Get/set the audio volume (0-255)

adafruit_yoto.sgm41513

CircuitPython driver for SGM41513 Battery Charger IC

  • Author(s): Liz Clark

class adafruit_yoto.sgm41513.SGM41513(i2c, address=_DEFAULT_ADDRESS)

Driver for SGM41513 Battery Charger IC

property charge_current

Charge current setting in mA

Returns:

Charge current in milliamps

Return type:

int

charge_enabled

Enable or disable battery charging

property charge_voltage

Charge voltage setting in mV

Returns:

Charge voltage in millivolts

Return type:

int

hiz_mode

Enable HIZ mode (disconnect VBUS from internal circuit)

property part_info

Part number and revision information

Returns:

Dictionary with part_number and revision

Return type:

dict

property system_status

Current system status

Returns:

Dictionary with VBUS status, charge status, power good, thermal regulation, and VSYS regulation

Return type:

dict

adafruit_yoto.yoto

Helper Library for the Yoto Players

  • Author(s): Liz Clark

Implementation Notes

Hardware:

  • Yoto Mini Player running CircuitPython

Software and Dependencies:

class adafruit_yoto.yoto.Yoto(*, url=None, headers=None, json_path=None, regexp_path=None, default_bg=0x000000, status_neopixel=None, json_transform=None, rotation=0, auto_refresh=True, debug=False)

Class representing the Yoto Mini music player

Parameters:
  • url – The URL of your data source. Defaults to None.

  • headers – The headers for authentication, typically used by Azure API’s.

  • json_path – The list of json traversal to get data out of. Can be list of lists for multiple data points. Defaults to None to not use json.

  • regexp_path – The list of regexp strings to get data out (use a single regexp group). Can be list of regexps for multiple data points. Defaults to None to not use regexp.

  • default_bg – The path to your default background image file or a hex color. Defaults to 0x000000.

  • status_neopixel – The pin for the status NeoPixel. Defaults to None.

  • json_transform – A function or a list of functions to call with the parsed JSON. Changes and additions are permitted for the dict object.

  • rotation (int) – Default rotation (0, 90, 180, 270). Defaults to 0.

  • auto_refresh (bool) – Automatically refresh the display after updates. Defaults to True.

  • debug – Turn on debug print outs. Defaults to False.