mirror of https://github.com/ARMmbed/mbed-os.git
				
				
				
			Add enable API to FileHandle
Add API to dynamically enable/disable input and output on FileHandles. Aim is to allow power saving by indicating that we permanently or temporarily do not require input, so that for example serial Rx interrupts can be released, and deep sleep permitted.pull/9797/head
							parent
							
								
									95906f1062
								
							
						
					
					
						commit
						e96d6581db
					
				| 
						 | 
				
			
			@ -220,6 +220,42 @@ public:
 | 
			
		|||
        return true;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /** Enable or disable input
 | 
			
		||||
     *
 | 
			
		||||
     * Control enabling of device for input. This is primarily intended
 | 
			
		||||
     * for temporary power-saving; the overall ability of the device to operate for
 | 
			
		||||
     * input and/or output may be fixed at creation time, but this call can
 | 
			
		||||
     * allow input to be temporarily disabled to permit power saving without
 | 
			
		||||
     * losing device state.
 | 
			
		||||
     *
 | 
			
		||||
     *  @param enabled      true to enable input, false to disable.
 | 
			
		||||
     *
 | 
			
		||||
     *  @return             0 on success
 | 
			
		||||
     *  @return             Negative error code on failure
 | 
			
		||||
     */
 | 
			
		||||
    virtual int enable_input(bool enabled)
 | 
			
		||||
    {
 | 
			
		||||
        return -EINVAL;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /** Enable or disable output
 | 
			
		||||
     *
 | 
			
		||||
     * Control enabling of device for output. This is primarily intended
 | 
			
		||||
     * for temporary power-saving; the overall ability of the device to operate for
 | 
			
		||||
     * input and/or output may be fixed at creation time, but this call can
 | 
			
		||||
     * allow output to be temporarily disabled to permit power saving without
 | 
			
		||||
     * losing device state.
 | 
			
		||||
     *
 | 
			
		||||
     *  @param enabled      true to enable output, false to disable.
 | 
			
		||||
     *
 | 
			
		||||
     *  @return             0 on success
 | 
			
		||||
     *  @return             Negative error code on failure
 | 
			
		||||
     */
 | 
			
		||||
    virtual int enable_output(bool enabled)
 | 
			
		||||
    {
 | 
			
		||||
        return -EINVAL;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /** Check for poll event flags
 | 
			
		||||
     * You can use or ignore the input parameter. You can return all events
 | 
			
		||||
     * or check just the events listed in events.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue