code: def close(self):
          
          assert self.closed is False
  
          if self.is_swo_running:
              self.stop_swo()
          self.closed = True
          self.rx_stop_event.set()
          self.read_sem.release()
          self.thread.join()
          assert self.rcv_data[-1] is None
          self.rcv_data = []
          self.swo_data = []
          usb.util.release_interface(self.dev, self.intf_number)
          usb.util.dispose_resources(self.dev)
          self.ep_out = None
          self.ep_in = None
          self.ep_swo = None
          self.dev = None
          self.intf_number = None
          self.thread = None
docs: ! @brief Close the USB interface.