{"id":15170110,"url":"https://github.com/charkster/ap33772_i2c","last_synced_at":"2026-01-22T06:39:08.666Z","repository":{"id":248204318,"uuid":"828061340","full_name":"charkster/AP33772_I2C","owner":"charkster","description":"Python driver for Mikroe USB-C Sinkl 2 Click board which uses AP33772 to query and control USB PD 3.0 wall adapter.","archived":false,"fork":false,"pushed_at":"2024-07-13T22:46:11.000Z","size":37,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-16T20:36:26.943Z","etag":null,"topics":["ap33772","i2c","micropython","raspberry-pi","usb-pd"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/charkster.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-13T02:44:07.000Z","updated_at":"2024-07-13T22:46:15.000Z","dependencies_parsed_at":"2024-07-13T04:25:19.781Z","dependency_job_id":"9b00b62b-7e9c-4a93-b316-7fca191858cb","html_url":"https://github.com/charkster/AP33772_I2C","commit_stats":null,"previous_names":["charkster/ap33772_i2c"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charkster%2FAP33772_I2C","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charkster%2FAP33772_I2C/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charkster%2FAP33772_I2C/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charkster%2FAP33772_I2C/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/charkster","download_url":"https://codeload.github.com/charkster/AP33772_I2C/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253995213,"owners_count":21996621,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ap33772","i2c","micropython","raspberry-pi","usb-pd"],"created_at":"2024-09-27T08:00:36.699Z","updated_at":"2026-01-22T06:39:08.628Z","avatar_url":"https://github.com/charkster.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AP33772_I2C\n\n![picture](https://cdn1-shop.mikroe.com/img/product/usb-c-sink-2-click/usb-c-sink-2-click-large_default-1.jpg)\n\nPython driver for [Mikroe USB-C Sink 2 Click](https://www.mikroe.com/usb-c-sink-2-click) board which uses [AP33772](https://www.diodes.com/assets/Evaluation-Boards/AP33772-Sink-Controller-EVB-User-Guide.pdf) to query and control USB PD 3.0 wall adapter. Works on Raspberry Pi and MicroPython. For offical C language support check [here](https://github.com/MikroElektronika/mikrosdk_click_v2/tree/master/clicks/usbcsink2)\n\nI am able to query a USB PD wall adapater and request a specific PDO (including PPS!!). The board costs [$15 from Digikey](https://www.digikey.com/en/products/detail/mikroelektronika/MIKROE-5792/21326383).\n\nFour board connections are needed on the Mikroe board: GND, 3V3 (connects to MCU gpio, not 3.3V rail), SDA and SCL. \n\nThere are [4.7k Ohm I2C pullups](https://download.mikroe.com/documents/add-on-boards/click/usb-c-sink-2-click/usb-c_sink_2_click_v100_Schematic.PDF) already on the Mikroe board. I run the I2C at 100kHz (4.7k Ohms is too large for 400kHz or faster). \n\nWhen I powered the Mikroe board's 3V3 pin using a constant 3.3V rail, I was not able to reset the I2C interface (which is needed from time to time). \n\nThe AP33772 needs power from the USB PD wall adapter cable in order to respond to I2C (the 3V3 is for communication only). \nThe AN pin is a [7.32 : 1 resistor divider](https://download.mikroe.com/documents/add-on-boards/click/usb-c-sink-2-click/usb-c_sink_2_click_v100_Schematic.PDF) of VBUS (VBUS=20V has AN=2.73V). If you are going to read the AN pin with an ADC, the reference should allow for 2.73V measurements.\n\nThe LED labeled \"FAULT\" is powered by GPIO4, which isn't the interrupt pin (GPIO3). When it is solid (not flashing) it is just an indicator that VSINK (VOUT) is valid and being driven through the protection FETs with a current less than 500mA.\n\n\n**FAULT LED flickering notified of the system status:**\n- Charging: Breathing light (2 sec dimming), 1 cycle is 4 sec.\n- Fully charged: Continuously lit Charging current \u003c 500mA.\n- Mismatch: 1s flicker Voltage or power mismatch. Non-PD power source, 1 cycle is 2sec.\n- Fault: 300ms flicker OVP, 1 cycle is 600ms.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcharkster%2Fap33772_i2c","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcharkster%2Fap33772_i2c","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcharkster%2Fap33772_i2c/lists"}