public class YPwmPowerSource extends YFunction
| Modifier and Type | Class and Description |
|---|---|
static interface |
YPwmPowerSource.TimedReportCallback
TimedReportCallback for PwmPowerSource
|
static interface |
YPwmPowerSource.UpdateCallback
Deprecated UpdateCallback for PwmPowerSource
|
| Modifier and Type | Field and Description |
|---|---|
protected int |
_powerMode |
protected YPwmPowerSource.UpdateCallback |
_valueCallbackPwmPowerSource |
static int |
POWERMODE_EXT_V |
static int |
POWERMODE_INVALID |
static int |
POWERMODE_OPNDRN |
static int |
POWERMODE_USB_3V |
static int |
POWERMODE_USB_5V
invalid powerMode value
|
_advertisedValue, _cacheExpiration, _className, _dataStreams, _func, _funId, _hwId, _lastErrorMsg, _lastErrorType, _logicalName, _serial, _userData, _valueCallbackFunction, _yapi, ADVERTISEDVALUE_INVALID, FUNCTIONDESCRIPTOR_INVALID, LOGICALNAME_INVALID| Modifier | Constructor and Description |
|---|---|
protected |
YPwmPowerSource(String func) |
protected |
YPwmPowerSource(YAPIContext ctx,
String func) |
| Modifier and Type | Method and Description |
|---|---|
int |
_invokeValueCallback(String value) |
protected void |
_parseAttr(com.yoctopuce.YoctoAPI.YJSONObject json_val) |
static YPwmPowerSource |
FindPwmPowerSource(String func)
Retrieves a PWM generator power source for a given identifier.
|
static YPwmPowerSource |
FindPwmPowerSourceInContext(YAPIContext yctx,
String func)
Retrieves a PWM generator power source for a given identifier in a YAPI context.
|
static YPwmPowerSource |
FirstPwmPowerSource()
Starts the enumeration of PWM generator power sources currently accessible.
|
static YPwmPowerSource |
FirstPwmPowerSourceInContext(YAPIContext yctx)
Starts the enumeration of PWM generator power sources currently accessible.
|
int |
get_powerMode()
Returns the selected power source for the PWM on the same device.
|
int |
getPowerMode()
Returns the selected power source for the PWM on the same device.
|
YPwmPowerSource |
nextPwmPowerSource()
Continues the enumeration of PWM generator power sources started using yFirstPwmPowerSource().
|
int |
registerValueCallback(YPwmPowerSource.UpdateCallback callback)
Registers the callback function that is invoked on every change of advertised value.
|
int |
set_powerMode(int newval)
Changes the PWM power source.
|
int |
setPowerMode(int newval)
Changes the PWM power source.
|
_AddToCache, _clearDataStreamCache, _decode_json_int, _decode_json_string, _download, _escapeAttr, _FindFromCache, _FindFromCacheInContext, _get_json_path_struct, _get_json_path, _is_valid_pass, _json_get_array, _json_get_key, _json_get_string, _parse, _parserHelper, _setAttr, _throw, _UpdateTimedReportCallbackList, _UpdateValueCallbackList, _upload, _upload, _uploadEx, clearCache, describe, errMessage, errorMessage, errorType, errType, FindFunction, FindFunctionInContext, FirstFunction, FirstFunctionInContext, functionDescriptor, get_advertisedValue, get_errorMessage, get_errorType, get_friendlyName, get_functionDescriptor, get_functionId, get_hardwareId, get_logicalName, get_module, get_serialNumber, get_userData, getAdvertisedValue, getErrorMessage, getErrorType, getFriendlyName, getFunctionDescriptor, getFunctionId, getHardwareId, getLogicalName, getModule, getUserData, isOnline, isReadOnly, load, loadAttribute, module, muteValueCallbacks, nextFunction, registerValueCallback, set_advertisedValue, set_logicalName, set_userData, setLogicalName, setUserData, toString, unmuteValueCallbacks, userDatapublic static final int POWERMODE_USB_5V
public static final int POWERMODE_USB_3V
public static final int POWERMODE_EXT_V
public static final int POWERMODE_OPNDRN
public static final int POWERMODE_INVALID
protected int _powerMode
protected YPwmPowerSource.UpdateCallback _valueCallbackPwmPowerSource
protected YPwmPowerSource(YAPIContext ctx, String func)
func - : functionidprotected YPwmPowerSource(String func)
func - : functionidprotected void _parseAttr(com.yoctopuce.YoctoAPI.YJSONObject json_val)
throws Exception
_parseAttr in class YFunctionExceptionpublic int get_powerMode()
throws YAPI_Exception
YAPI_Exception - on errorpublic int getPowerMode()
throws YAPI_Exception
YAPI_Exception - on errorpublic int set_powerMode(int newval)
throws YAPI_Exception
newval - : a value among YPwmPowerSource.POWERMODE_USB_5V, YPwmPowerSource.POWERMODE_USB_3V,
YPwmPowerSource.POWERMODE_EXT_V and YPwmPowerSource.POWERMODE_OPNDRN corresponding to the PWM power sourceYAPI_Exception - on errorpublic int setPowerMode(int newval)
throws YAPI_Exception
newval - : a value among YPwmPowerSource.POWERMODE_USB_5V, YPwmPowerSource.POWERMODE_USB_3V,
YPwmPowerSource.POWERMODE_EXT_V and YPwmPowerSource.POWERMODE_OPNDRN corresponding to the PWM power sourceYAPI_Exception - on errorpublic static YPwmPowerSource FindPwmPowerSource(String func)
func - : a string that uniquely characterizes the PWM generator power source, for instance
YPWMTX01.pwmPowerSource.public static YPwmPowerSource FindPwmPowerSourceInContext(YAPIContext yctx, String func)
yctx - : a YAPI contextfunc - : a string that uniquely characterizes the PWM generator power source, for instance
YPWMTX01.pwmPowerSource.public int registerValueCallback(YPwmPowerSource.UpdateCallback callback)
callback - : the callback function to call, or a null pointer. The callback function should take two
arguments: the function object of which the value has changed, and the character string describing
the new advertised value.public int _invokeValueCallback(String value)
_invokeValueCallback in class YFunctionpublic YPwmPowerSource nextPwmPowerSource()
public static YPwmPowerSource FirstPwmPowerSource()
public static YPwmPowerSource FirstPwmPowerSourceInContext(YAPIContext yctx)
yctx - : a YAPI context.Copyright © 2026. All rights reserved.