summaryrefslogtreecommitdiff
path: root/src/typec/usbc.c
diff options
context:
space:
mode:
authorHiFiPhile <[email protected]>2026-06-24 21:15:33 +0200
committerHiFiPhile <[email protected]>2026-06-24 21:15:33 +0200
commitf35af01db58ba76bef1a65a56458bc815497ebbe (patch)
tree0e890d9579690742e0a2c1e6a4f6956be5a8bbad /src/typec/usbc.c
parent3a1ced7e1333de7ddf57f8592a41cbf0605512ed (diff)
typec: add tuc_connect/tuc_disconnect api
Signed-off-by: HiFiPhile <[email protected]>
Diffstat (limited to 'src/typec/usbc.c')
-rw-r--r--src/typec/usbc.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/typec/usbc.c b/src/typec/usbc.c
index 20abd1700..8071e93c3 100644
--- a/src/typec/usbc.c
+++ b/src/typec/usbc.c
@@ -76,6 +76,14 @@ TU_ATTR_WEAK bool tuc_pd_control_received_cb(uint8_t rhport, pd_header_t const*
return false;
}
+TU_ATTR_WEAK void tcd_connect(uint8_t rhport) {
+ (void) rhport;
+}
+
+TU_ATTR_WEAK void tcd_disconnect(uint8_t rhport) {
+ (void) rhport;
+}
+
//--------------------------------------------------------------------+
//
//--------------------------------------------------------------------+
@@ -83,6 +91,20 @@ bool tuc_inited(uint8_t rhport) {
return _usbc_inited && _port_inited[rhport];
}
+bool tuc_connect(uint8_t rhport) {
+ TU_VERIFY(rhport < TUP_TYPEC_RHPORTS_NUM && tuc_inited(rhport));
+
+ tcd_connect(rhport);
+ return true;
+}
+
+bool tuc_disconnect(uint8_t rhport) {
+ TU_VERIFY(rhport < TUP_TYPEC_RHPORTS_NUM && tuc_inited(rhport));
+
+ tcd_disconnect(rhport);
+ return true;
+}
+
bool tuc_init(uint8_t rhport, uint32_t port_type) {
// Initialize stack
if (!_usbc_inited) {