/** * @brief USB device disconnection handler. * @note If this function is not called from an ISR then an explicit call * to @p osalOsRescheduleS() in necessary afterward. * * @param[in] sdup pointer to a @p SerialUSBDriver object * * @iclass */ void sduDisconnectI(SerialUSBDriver *sdup) { /* Queues reset in order to signal the driver stop to the application.*/ chnAddFlagsI(sdup, CHN_DISCONNECTED); ibqResetI(&sdup->ibqueue); obqResetI(&sdup->obqueue); }
/** * @brief USB device disconnection handler. * @note If this function is not called from an ISR then an explicit call * to @p osalOsRescheduleS() in necessary afterward. * * @param[in] uhdp pointer to a @p USBHIDDriver object * * @iclass */ void hidDisconnectI(USBHIDDriver *uhdp) { /* Queues reset in order to signal the driver stop to the application.*/ chnAddFlagsI(uhdp, CHN_DISCONNECTED); ibqResetI(&uhdp->ibqueue); obqResetI(&uhdp->obqueue); }
/** * @brief USB device configured handler. * * @param[in] sdup pointer to a @p SerialUSBDriver object * * @iclass */ void sduConfigureHookI(SerialUSBDriver *sdup) { uint8_t *buf; ibqResetI(&sdup->ibqueue); obqResetI(&sdup->obqueue); chnAddFlagsI(sdup, CHN_CONNECTED); /* Starts the first OUT transaction immediately.*/ buf = ibqGetEmptyBufferI(&sdup->ibqueue); osalDbgAssert(buf != NULL, "no free buffer"); usbStartReceiveI(sdup->config->usbp, sdup->config->bulk_out, buf, SERIAL_USB_BUFFERS_SIZE); }
/** * @brief USB device configured handler. * * @param[in] uhdp pointer to a @p USBHIDDriver object * * @iclass */ void hidConfigureHookI(USBHIDDriver *uhdp) { uint8_t *buf; ibqResetI(&uhdp->ibqueue); obqResetI(&uhdp->obqueue); chnAddFlagsI(uhdp, CHN_CONNECTED); /* Starts the first OUT transaction immediately.*/ buf = ibqGetEmptyBufferI(&uhdp->ibqueue); osalDbgAssert(buf != NULL, "no free buffer"); usbStartReceiveI(uhdp->config->usbp, uhdp->config->int_out, buf, USB_HID_BUFFERS_SIZE); }