@@ -118,6 +118,15 @@ impl ControlClass {
118118 } ,
119119 }
120120 }
121+ /// This function is called after processing USB control OUT requests to handle any necessary
122+ /// work regarding the commands executed in the control_out method.
123+ ///
124+ /// The post_poll function performs actions based on the data that was set during the
125+ /// control_out phase, including refreshing measurements from the power meter, updating
126+ /// the state of control pins, and executing power or storage actions. This separation allows
127+ /// the class to batch actions that need to be taken after all USB transactions have been completed,
128+ /// ensuring that changes are applied in a controlled manner.
129+ ///
121130 pub fn post_poll < C : CTLPinsTrait , S : StorageSwitchTrait > (
122131 & mut self ,
123132 config : & mut ConfigArea ,
@@ -239,6 +248,18 @@ impl<B: UsbBus> UsbClass<B> for ControlClass {
239248 Ok ( ( ) )
240249 }
241250
251+ /// Handles control transfer IN requests from the host.
252+ ///
253+ /// This function processes various vendor-specific requests, such as:
254+ /// - Retrieving configuration settings for the device (name, tags, USB console, power settings).
255+ /// - Providing information about the current power state, voltage, and current readings.
256+ /// - Responding with the device's version information.
257+ ///
258+ /// The function checks the request type and recipient, and parses the
259+ /// request value to determine which data to send back to the host.
260+ /// Appropriate responses are constructed based on the parsed request.
261+ ///
262+ /// The responses will be sent back to the host through the ControlIn transfer.
242263 fn control_in ( & mut self , xfer : ControlIn < B > ) {
243264 let req = xfer. request ( ) ;
244265
@@ -318,7 +339,22 @@ impl<B: UsbBus> UsbClass<B> for ControlClass {
318339 }
319340 }
320341 }
321-
342+ /// Handles control transfer OUT requests from the host.
343+ ///
344+ /// This function processes various vendor-specific requests, such as:
345+ /// - Refreshing the data from the power meter.
346+ /// - Setting the power state (on, off, force on/off, or rescue).
347+ /// - Managing storage actions (off, connect to host, or DUT).
348+ /// - Configuring device settings (name, tags, USB console, power settings).
349+ /// - Setting the state of control pins (Reset, A, B, C, D).
350+ ///
351+ /// The function checks the request type and recipient, and parses the
352+ /// request value to determine the action to be taken. Appropriate
353+ /// data fields within the control class are updated based on the
354+ /// request.
355+ ///
356+ /// Any actions are taken later by the post_poll function once usb polling
357+ /// of all devices has finished.
322358 fn control_out ( & mut self , xfer : ControlOut < B > ) {
323359 let req = xfer. request ( ) ;
324360
0 commit comments