add tuh_address_set() API

minor rename and move code around
This commit is contained in:
hathach
2025-04-24 10:41:00 +07:00
parent 8b3c558881
commit 89f8d0cffb
2 changed files with 83 additions and 81 deletions

View File

@@ -250,6 +250,10 @@ bool tuh_edpt_close(uint8_t daddr, uint8_t ep_addr);
// Return true if a queued transfer is aborted, false if there is no transfer to abort
bool tuh_edpt_abort_xfer(uint8_t daddr, uint8_t ep_addr);
// Set Address (control transfer)
bool tuh_address_set(uint8_t daddr, uint8_t new_addr,
tuh_xfer_cb_t complete_cb, uintptr_t user_data);
// Set Configuration (control transfer)
// config_num = 0 will un-configure device. Note: config_num = config_descriptor_index + 1
// true on success, false if there is on-going control transfer or incorrect parameters