//***************************************************************************** // //! Reports the device power status (bus- or self-powered) to the USB library. //! //! \param pvInstance is the pointer to the mouse device instance structure. //! \param ucPower indicates the current power status, either \b //! USB_STATUS_SELF_PWR or \b USB_STATUS_BUS_PWR. //! //! Applications which support switching between bus- or self-powered //! operation should call this function whenever the power source changes //! to indicate the current power status to the USB library. This information //! is required by the USB library to allow correct responses to be provided //! when the host requests status from the device. //! //! \return None. // //***************************************************************************** void USBDHIDMousePowerStatusSet(void *pvInstance, unsigned char ucPower) { tUSBDHIDMouseDevice *psDevice; tUSBDHIDDevice *psHIDDevice; ASSERT(pvInstance); // // Get the keyboard device pointer. // psDevice = (tUSBDHIDMouseDevice *)pvInstance; // // Get a pointer to the HID device data. // psHIDDevice = &psDevice->psPrivateHIDMouseData->sHIDDevice; // // Pass the request through to the lower layer. // USBDHIDPowerStatusSet((void *)psHIDDevice, ucPower); }
//***************************************************************************** // //! Reports the device power status (bus or self powered) to the USB library. //! //! \param pvKeyboardDevice is the pointer to the keyboard device instance //! structure. //! \param ui8Power indicates the current power status, either //! \b USB_STATUS_SELF_PWR or \b USB_STATUS_BUS_PWR. //! //! Applications which support switching between bus or self powered //! operation should call this function whenever the power source changes //! to indicate the current power status to the USB library. This information //! is required by the USB library to allow correct responses to be provided //! when the host requests status from the device. //! //! \return None. // //***************************************************************************** void USBDHIDKeyboardPowerStatusSet(void *pvKeyboardDevice, uint8_t ui8Power) { tUSBDHIDKeyboardDevice *psHIDKbDevice; tUSBDHIDDevice *psHIDDevice; ASSERT(pvKeyboardDevice); // // Get the keyboard device pointer. // psHIDKbDevice = (tUSBDHIDKeyboardDevice *)pvKeyboardDevice; // // Get a pointer to the HID device data. psHIDDevice = &psHIDKbDevice->sPrivateData.sHIDDevice; // // Pass the request through to the lower layer. // USBDHIDPowerStatusSet((void *)psHIDDevice, ui8Power); }