esp-cpp / espp

C++ components for ESP
https://esp-cpp.github.io/espp/
MIT License
30 stars 9 forks source link

feat(kts1622) Add new set_direction method to change I/O direction register #247

Closed shogo-sugihara closed 4 months ago

shogo-sugihara commented 4 months ago

Add a new set_direction() method to change the I/O direction register to the KTS1622 class.

Description

Motivation and Context

The EN_USB_PLG is controlled by the right KTS1622 I/O expander P1_4 on the proto1 sample. image During the UM3506 FW update, this pin outputs the same value as the EN_USB_PLG_UM pin to prevent the UM3506 bootloader from losing control and causing USB MUX malfunctions (USB REC/PLUG miss-switching). The I/O direction register needs to be changed at the EN_USB_PLG_UM port level read and at the EN_USB_PLG port output.

This new set_direction() method is used in the following function: [FIR-137] Ability to update UM3506 FW from ESP32

199

How has this been tested?

I confirmed that the following um3506_example.cpp code reads the value of the EN_USB_PLG_UM port and outputs it from the EN_USB_PLG port. image

I also confirmed that the following proto1.cpp code reads the value of the EN_USB_PLG_UM port and outputs it from the EN_USB_PLG port. image

Screenshots (if appropriate, e.g. schematic, board, console logs, lab pictures):

Types of changes

Checklist:

Software

Hardware

github-actions[bot] commented 4 months ago

:white_check_mark:Static analysis result - no issues found! :white_check_mark: