public class YPwmInput extends YSensor
Modifier and Type | Class and Description |
---|---|
static interface |
YPwmInput.TimedReportCallback
TimedReportCallback for PwmInput
|
static interface |
YPwmInput.UpdateCallback
Deprecated UpdateCallback for PwmInput
|
Modifier and Type | Field and Description |
---|---|
protected int |
_debouncePeriod |
protected double |
_dutyCycle |
protected double |
_frequency |
protected double |
_period |
protected long |
_pulseCounter |
protected double |
_pulseDuration |
protected long |
_pulseTimer |
protected int |
_pwmReportMode |
protected YPwmInput.TimedReportCallback |
_timedReportCallbackPwmInput |
protected YPwmInput.UpdateCallback |
_valueCallbackPwmInput |
static int |
DEBOUNCEPERIOD_INVALID
invalid debouncePeriod value
|
static double |
DUTYCYCLE_INVALID
invalid dutyCycle value
|
static double |
FREQUENCY_INVALID
invalid frequency value
|
static double |
PERIOD_INVALID
invalid period value
|
static long |
PULSECOUNTER_INVALID
invalid pulseCounter value
|
static double |
PULSEDURATION_INVALID
invalid pulseDuration value
|
static long |
PULSETIMER_INVALID
invalid pulseTimer value
|
static int |
PWMREPORTMODE_INVALID |
static int |
PWMREPORTMODE_PWM_CPM |
static int |
PWMREPORTMODE_PWM_CPS |
static int |
PWMREPORTMODE_PWM_DUTYCYCLE
invalid pwmReportMode value
|
static int |
PWMREPORTMODE_PWM_EDGECOUNT |
static int |
PWMREPORTMODE_PWM_FREQUENCY |
static int |
PWMREPORTMODE_PWM_PULSECOUNT |
static int |
PWMREPORTMODE_PWM_PULSEDURATION |
static int |
PWMREPORTMODE_PWM_STATE |
_advMode, _calhdl, _calibrationParam, _calpar, _calraw, _calref, _caltyp, _currentRawValue, _currentValue, _decexp, _highestValue, _iresol, _isScal, _isScal32, _logFrequency, _lowestValue, _offset, _prevTimedReport, _reportFrequency, _resolution, _scale, _sensorState, _timedReportCallbackSensor, _unit, _valueCallbackSensor, ADVMODE_IMMEDIATE, ADVMODE_INVALID, ADVMODE_PERIOD_AVG, ADVMODE_PERIOD_MAX, ADVMODE_PERIOD_MIN, CALIBRATIONPARAM_INVALID, CURRENTRAWVALUE_INVALID, CURRENTVALUE_INVALID, HIGHESTVALUE_INVALID, LOGFREQUENCY_INVALID, LOWESTVALUE_INVALID, REPORTFREQUENCY_INVALID, RESOLUTION_INVALID, SENSORSTATE_INVALID, UNIT_INVALID
_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 |
YPwmInput(String func) |
protected |
YPwmInput(YAPIContext ctx,
String func) |
Modifier and Type | Method and Description |
---|---|
int |
_invokeTimedReportCallback(YMeasure value) |
int |
_invokeValueCallback(String value) |
protected void |
_parseAttr(com.yoctopuce.YoctoAPI.YJSONObject json_val) |
static YPwmInput |
FindPwmInput(String func)
Retrieves a PWM input for a given identifier.
|
static YPwmInput |
FindPwmInputInContext(YAPIContext yctx,
String func)
Retrieves a PWM input for a given identifier in a YAPI context.
|
static YPwmInput |
FirstPwmInput()
Starts the enumeration of PWM inputs currently accessible.
|
static YPwmInput |
FirstPwmInputInContext(YAPIContext yctx)
Starts the enumeration of PWM inputs currently accessible.
|
int |
get_debouncePeriod()
Returns the shortest expected pulse duration, in ms.
|
double |
get_dutyCycle()
Returns the PWM duty cycle, in per cents.
|
double |
get_frequency()
Returns the PWM frequency in Hz.
|
double |
get_period()
Returns the PWM period in milliseconds.
|
long |
get_pulseCounter()
Returns the pulse counter value.
|
double |
get_pulseDuration()
Returns the PWM pulse length in milliseconds, as a floating point number.
|
long |
get_pulseTimer()
Returns the timer of the pulses counter (ms).
|
int |
get_pwmReportMode()
Returns the parameter (frequency/duty cycle, pulse width, edges count) returned by the
get_currentValue function and callbacks.
|
int |
getDebouncePeriod()
Returns the shortest expected pulse duration, in ms.
|
double |
getDutyCycle()
Returns the PWM duty cycle, in per cents.
|
double |
getFrequency()
Returns the PWM frequency in Hz.
|
double |
getPeriod()
Returns the PWM period in milliseconds.
|
long |
getPulseCounter()
Returns the pulse counter value.
|
double |
getPulseDuration()
Returns the PWM pulse length in milliseconds, as a floating point number.
|
long |
getPulseTimer()
Returns the timer of the pulses counter (ms).
|
int |
getPwmReportMode()
Returns the parameter (frequency/duty cycle, pulse width, edges count) returned by the
get_currentValue function and callbacks.
|
YPwmInput |
nextPwmInput()
Continues the enumeration of PWM inputs started using yFirstPwmInput().
|
int |
registerTimedReportCallback(YPwmInput.TimedReportCallback callback)
Registers the callback function that is invoked on every periodic timed notification.
|
int |
registerValueCallback(YPwmInput.UpdateCallback callback)
Registers the callback function that is invoked on every change of advertised value.
|
int |
resetCounter()
Returns the pulse counter value as well as its timer.
|
int |
set_debouncePeriod(int newval)
Changes the shortest expected pulse duration, in ms.
|
int |
set_pulseCounter(long newval) |
int |
set_pwmReportMode(int newval)
Changes the parameter type (frequency/duty cycle, pulse width, or edge count) returned by the
get_currentValue function and callbacks.
|
int |
setDebouncePeriod(int newval)
Changes the shortest expected pulse duration, in ms.
|
int |
setPwmReportMode(int newval)
Changes the parameter type (frequency/duty cycle, pulse width, or edge count) returned by the
get_currentValue function and callbacks.
|
_applyCalibration, _decodeAvg, _decodeTimedReport, _decodeVal, _encodeCalibrationPoints, _parserHelper, calibrateFromPoints, FindSensor, FindSensorInContext, FirstSensor, FirstSensorInContext, get_advMode, get_calibrationParam, get_currentRawValue, get_currentValue, get_dataLogger, get_highestValue, get_logFrequency, get_lowestValue, get_recordedData, get_reportFrequency, get_resolution, get_sensorState, get_unit, getAdvMode, getCurrentRawValue, getCurrentValue, getHighestValue, getLogFrequency, getLowestValue, getReportFrequency, getResolution, getSensorState, getUnit, isSensorReady, loadCalibrationPoints, nextSensor, registerTimedReportCallback, registerValueCallback, set_advMode, set_calibrationParam, set_highestValue, set_logFrequency, set_lowestValue, set_reportFrequency, set_resolution, setAdvMode, setHighestValue, setLogFrequency, setLowestValue, setReportFrequency, setResolution, startDataLogger, stopDataLogger
_AddToCache, _clearDataStreamCache, _devRequest, _download, _escapeAttr, _FindFromCache, _FindFromCacheInContext, _get_json_path_struct, _get_json_path, _json_get_array, _json_get_key, _json_get_string, _parse, _setAttr, _throw, _UpdateTimedReportCallbackList, _UpdateValueCallbackList, _upload, _upload, 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_userData, getAdvertisedValue, getErrorMessage, getErrorType, getFriendlyName, getFunctionDescriptor, getFunctionId, getHardwareId, getLogicalName, getModule, getUserData, isOnline, load, loadAttribute, module, muteValueCallbacks, nextFunction, registerValueCallback, set_advertisedValue, set_logicalName, set_userData, setLogicalName, setUserData, toString, unmuteValueCallbacks, userData
public static final double DUTYCYCLE_INVALID
public static final double PULSEDURATION_INVALID
public static final double FREQUENCY_INVALID
public static final double PERIOD_INVALID
public static final long PULSECOUNTER_INVALID
public static final long PULSETIMER_INVALID
public static final int PWMREPORTMODE_PWM_DUTYCYCLE
public static final int PWMREPORTMODE_PWM_FREQUENCY
public static final int PWMREPORTMODE_PWM_PULSEDURATION
public static final int PWMREPORTMODE_PWM_EDGECOUNT
public static final int PWMREPORTMODE_PWM_PULSECOUNT
public static final int PWMREPORTMODE_PWM_CPS
public static final int PWMREPORTMODE_PWM_CPM
public static final int PWMREPORTMODE_PWM_STATE
public static final int PWMREPORTMODE_INVALID
public static final int DEBOUNCEPERIOD_INVALID
protected double _dutyCycle
protected double _pulseDuration
protected double _frequency
protected double _period
protected long _pulseCounter
protected long _pulseTimer
protected int _pwmReportMode
protected int _debouncePeriod
protected YPwmInput.UpdateCallback _valueCallbackPwmInput
protected YPwmInput.TimedReportCallback _timedReportCallbackPwmInput
protected YPwmInput(YAPIContext ctx, String func)
func
- : functionidprotected YPwmInput(String func)
func
- : functionidprotected void _parseAttr(com.yoctopuce.YoctoAPI.YJSONObject json_val) throws Exception
_parseAttr
in class YSensor
Exception
public double get_dutyCycle() throws YAPI_Exception
YAPI_Exception
- on errorpublic double getDutyCycle() throws YAPI_Exception
YAPI_Exception
- on errorpublic double get_pulseDuration() throws YAPI_Exception
YAPI_Exception
- on errorpublic double getPulseDuration() throws YAPI_Exception
YAPI_Exception
- on errorpublic double get_frequency() throws YAPI_Exception
YAPI_Exception
- on errorpublic double getFrequency() throws YAPI_Exception
YAPI_Exception
- on errorpublic double get_period() throws YAPI_Exception
YAPI_Exception
- on errorpublic double getPeriod() throws YAPI_Exception
YAPI_Exception
- on errorpublic long get_pulseCounter() throws YAPI_Exception
YAPI_Exception
- on errorpublic long getPulseCounter() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_pulseCounter(long newval) throws YAPI_Exception
YAPI_Exception
public long get_pulseTimer() throws YAPI_Exception
YAPI_Exception
- on errorpublic long getPulseTimer() throws YAPI_Exception
YAPI_Exception
- on errorpublic int get_pwmReportMode() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getPwmReportMode() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_pwmReportMode(int newval) throws YAPI_Exception
newval
- : a value among YPwmInput.PWMREPORTMODE_PWM_DUTYCYCLE,
YPwmInput.PWMREPORTMODE_PWM_FREQUENCY, YPwmInput.PWMREPORTMODE_PWM_PULSEDURATION,
YPwmInput.PWMREPORTMODE_PWM_EDGECOUNT, YPwmInput.PWMREPORTMODE_PWM_PULSECOUNT,
YPwmInput.PWMREPORTMODE_PWM_CPS, YPwmInput.PWMREPORTMODE_PWM_CPM and
YPwmInput.PWMREPORTMODE_PWM_STATE corresponding to the parameter type (frequency/duty cycle,
pulse width, or edge count) returned by the get_currentValue function and callbacksYAPI_Exception
- on errorpublic int setPwmReportMode(int newval) throws YAPI_Exception
newval
- : a value among Y_PWMREPORTMODE_PWM_DUTYCYCLE, Y_PWMREPORTMODE_PWM_FREQUENCY,
Y_PWMREPORTMODE_PWM_PULSEDURATION, Y_PWMREPORTMODE_PWM_EDGECOUNT, Y_PWMREPORTMODE_PWM_PULSECOUNT,
Y_PWMREPORTMODE_PWM_CPS, Y_PWMREPORTMODE_PWM_CPM and Y_PWMREPORTMODE_PWM_STATE corresponding to the
parameter type (frequency/duty cycle, pulse width, or edge count) returned by the
get_currentValue function and callbacksYAPI_Exception
- on errorpublic int get_debouncePeriod() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getDebouncePeriod() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_debouncePeriod(int newval) throws YAPI_Exception
newval
- : an integer corresponding to the shortest expected pulse duration, in msYAPI_Exception
- on errorpublic int setDebouncePeriod(int newval) throws YAPI_Exception
newval
- : an integer corresponding to the shortest expected pulse duration, in msYAPI_Exception
- on errorpublic static YPwmInput FindPwmInput(String func)
func
- : a string that uniquely characterizes the PWM inputpublic static YPwmInput FindPwmInputInContext(YAPIContext yctx, String func)
yctx
- : a YAPI contextfunc
- : a string that uniquely characterizes the PWM inputpublic int registerValueCallback(YPwmInput.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 YSensor
public int registerTimedReportCallback(YPwmInput.TimedReportCallback 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 an YMeasure object describing
the new advertised value.public int _invokeTimedReportCallback(YMeasure value)
_invokeTimedReportCallback
in class YSensor
public int resetCounter() throws YAPI_Exception
YAPI_Exception
- on errorpublic YPwmInput nextPwmInput()
public static YPwmInput FirstPwmInput()
public static YPwmInput FirstPwmInputInContext(YAPIContext yctx)
yctx
- : a YAPI context.Copyright © 2017. All rights reserved.