Skip to content

Instantly share code, notes, and snippets.

@rwhitby
Last active January 14, 2021 06:42
Show Gist options
  • Save rwhitby/b98254e84ae402e87a25c6b981303511 to your computer and use it in GitHub Desktop.
Save rwhitby/b98254e84ae402e87a25c6b981303511 to your computer and use it in GitHub Desktop.
Demonstration of applying an action to different pin sets.

(Waveform A and B side is from the viewpoint of the receptacle on the M1 MacMini)

Normal orientation: Normal Normal

Flipped orientation: Flipped Flipped

ConfigSetOutgoingVDM(0, FormatStructuredVDMv1(VID_APPLE, 1, INITIATOR, 0x12));

ConfigSetOutgoingVDM(1, 0x00000000);
ConfigSetCommand(EC_COMMAND_SEND_VDM_PPD);

ConfigSetOutgoingVDM(1, 0x00810306);
ConfigSetCommand(EC_COMMAND_SEND_VDM_PPD);
ConfigSetOutgoingVDM(1, 0x00820306);
ConfigSetCommand(EC_COMMAND_SEND_VDM_PPD);
ConfigSetOutgoingVDM(1, 0x00840306);
ConfigSetCommand(EC_COMMAND_SEND_VDM_PPD);

ConfigSetOutgoingVDM(1, 0x02810306);
ConfigSetCommand(EC_COMMAND_SEND_VDM_PPD);
ConfigSetOutgoingVDM(1, 0x02820306);
ConfigSetCommand(EC_COMMAND_SEND_VDM_PPD);
ConfigSetOutgoingVDM(1, 0x02840306);
ConfigSetCommand(EC_COMMAND_SEND_VDM_PPD);

ConfigSetOutgoingVDM(1, 0x00810606);
ConfigSetCommand(EC_COMMAND_SEND_VDM_PPD);
ConfigSetOutgoingVDM(1, 0x00820606);
ConfigSetCommand(EC_COMMAND_SEND_VDM_PPD);
# ConfigSetOutgoingVDM(1, 0x00820606);
# ConfigSetCommand(EC_COMMAND_SEND_VDM_PPD);

ConfigSetOutgoingVDM(1, 0x02810606);
ConfigSetCommand(EC_COMMAND_SEND_VDM_PPD);
ConfigSetOutgoingVDM(1, 0x02820606);
ConfigSetCommand(EC_COMMAND_SEND_VDM_PPD);
# ConfigSetOutgoingVDM(1, 0200820606);
# ConfigSetCommand(EC_COMMAND_SEND_VDM_PPD);

ConfigSetOutgoingVDM(1, 0x00814606);
ConfigSetCommand(EC_COMMAND_SEND_VDM_PPD);
ConfigSetOutgoingVDM(1, 0x00824606);
ConfigSetCommand(EC_COMMAND_SEND_VDM_PPD);
# ConfigSetOutgoingVDM(1, 0x00844606);
# ConfigSetCommand(EC_COMMAND_SEND_VDM_PPD);

ConfigSetOutgoingVDM(1, 0x02814606);
ConfigSetCommand(EC_COMMAND_SEND_VDM_PPD);
ConfigSetOutgoingVDM(1, 0x02824606);
ConfigSetCommand(EC_COMMAND_SEND_VDM_PPD);
# ConfigSetOutgoingVDM(1, 0x02844606);
# ConfigSetCommand(EC_COMMAND_SEND_VDM_PPD);

# ConfigSetOutgoingVDM(1, 0x00810803);
# ConfigSetCommand(EC_COMMAND_SEND_VDM_PPD);
ConfigSetOutgoingVDM(1, 0x00820803);
ConfigSetCommand(EC_COMMAND_SEND_VDM_PPD);
ConfigSetOutgoingVDM(1, 0x00840803);
ConfigSetCommand(EC_COMMAND_SEND_VDM_PPD);

# ConfigSetOutgoingVDM(1, 0x02810803);
# ConfigSetCommand(EC_COMMAND_SEND_VDM_PPD);
ConfigSetOutgoingVDM(1, 0x02820803);
ConfigSetCommand(EC_COMMAND_SEND_VDM_PPD);
ConfigSetOutgoingVDM(1, 0x02840803);
ConfigSetCommand(EC_COMMAND_SEND_VDM_PPD);

# ConfigSetOutgoingVDM(1, 0x00810809);
# ConfigSetCommand(EC_COMMAND_SEND_VDM_PPD);
ConfigSetOutgoingVDM(1, 0x00820809);
ConfigSetCommand(EC_COMMAND_SEND_VDM_PPD);
ConfigSetOutgoingVDM(1, 0x00840809);
ConfigSetCommand(EC_COMMAND_SEND_VDM_PPD);

# ConfigSetOutgoingVDM(1, 0x02810809);
# ConfigSetCommand(EC_COMMAND_SEND_VDM_PPD);
ConfigSetOutgoingVDM(1, 0x02820809);
ConfigSetCommand(EC_COMMAND_SEND_VDM_PPD);
ConfigSetOutgoingVDM(1, 0x02840809);
ConfigSetCommand(EC_COMMAND_SEND_VDM_PPD);

ConfigSetOutgoingVDM(1, 0x00000000);
ConfigSetCommand(EC_COMMAND_SEND_VDM_PPD);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment