Skip to content

Streamline Audio Control with the MicroPython Library for PT2323 6-Channel Audio Selector.

License

Notifications You must be signed in to change notification settings

zerovijay/PT2323

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PT2323 6-Channel Audio Selector IC - MicroPython Library

Overview

The PT2323 class provides a MicroPython implementation for controlling the PT2323 6-Channel Audio Selector IC using I2C communication. This library offers an intuitive interface for managing audio sources, channel muting, master mute, enhance surround mode, and mixed channel setups.

Table of Contents

Installation

  1. Download the PT2323.py file from this repository.
  2. Copy the file to your MicroPython device, placing it in the same directory as your project.

Usage

Initialization

Import the PT2323 class and initialize it with your I2C port:

from PT2323 import PT2323
from machine import Pin, I2C

# Initialize the I2C port (replace with your pins)
i2c = I2C(0, scl=Pin(1), sda=Pin(0), freq=100000)

# Initialize the PT2323 instance
pt2323 = PT2323(port=i2c)

Setting Input Source

Set the input source to route audio stereo group or the 6-channel input:

# Set input source to the third stereo group (0-4)
pt2323.input_source(source=2)

Master Mute

Enable or disable the master mute for all channels:

# Mute all channels
pt2323.master_mute(status=True)

# Unmute all channels
pt2323.master_mute(status=False)  

Channel Mute

Enable or disable mute for a specific channel (0-5):

# Mute channel 2
pt2323.channel_mute(channel=1, status=True)

# Unmute channel 4
pt2323.channel_mute(channel=3, status=False)  

Enhance Surround

Enable or disable the surround sound enhancement:

# Enable surround mode
pt2323.enhance_surround(status=True)

# Disable surround mode
pt2323.enhance_surround(status=False)  

Mixed Channel Setup

Enable or disable the 2-channel to 6-channel audio translation:

# Enable mixed channel setup
pt2323.mixed_channel(status=True)

# Disable mixed channel setup
pt2323.mixed_channel(status=False) 

Documentation

For comprehensive details about the PT2323 functionality and usage, please refer to the official PT2323 documentation.

The class documentation offers in-depth explanations, usage examples, and detailed parameter information for each method.

Getting Started

If you're new to the PT2323 6-Channel Audio Selector IC and its usage with the provided MicroPython code, here's how to start:

  • Clone or download this repository to your local machine.
  • Review the class documentation to understand available methods and usage.
  • Utilize the __doc__ or help() method to explore class details.
  • Follow the example usage provided in the Usage section of this README.md file to integrate the PT2323 class into your project.
  • If you have any suggestions or find issues, feel free to contribute by creating issues or pull requests on the repository.

Class API Reference

The class methods are documented in the PT2258 class documentation. It includes the following methods:

  • __init__(self, port: I2C = None) -> None: Initialize the PT2323 instance.
  • input_source(source: int) -> None: Set the input source for the PT2323.
  • master_mute(status: bool = False) -> None: Enable or disable master mute for all channels.
  • channel_mute(channel: int, status: bool = False) -> None: Enable or disable mute for a specific channel.
  • enhance_surround(status: bool = False) -> None: Enable or disable the surround functionality.
  • mixed_channel(status: bool = False) -> None: Enable or disable the 2-channel to 6-channel translation.

Contributions

If you find any issues or have suggestions for improvements, feel free to contribute by creating issues or pull requests on the repository.

Requirements

Credits

This code was created by @zerovijay We appreciate your contributions to enhance this project!

License

This project is licensed under the MIT License.

About

Streamline Audio Control with the MicroPython Library for PT2323 6-Channel Audio Selector.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages