counter

  1# This file was automatically generated by SWIG (https://www.swig.org).
  2# Version 4.2.1
  3#
  4# Do not make changes to this file unless you know what you are doing - modify
  5# the SWIG interface file instead.
  6
  7from sys import version_info as _swig_python_version_info
  8from mock_rtems import _counter as _counter
  9
 10try:
 11    import builtins as __builtin__
 12except ImportError:
 13    import __builtin__
 14
 15def _swig_repr(self):
 16    try:
 17        strthis = "proxy of " + self.this.__repr__()
 18    except __builtin__.Exception:
 19        strthis = ""
 20    return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
 21
 22
 23def _swig_setattr_nondynamic_instance_variable(set):
 24    def set_instance_attr(self, name, value):
 25        if name == "this":
 26            set(self, name, value)
 27        elif name == "thisown":
 28            self.this.own(value)
 29        elif hasattr(self, name) and isinstance(getattr(type(self), name), property):
 30            set(self, name, value)
 31        else:
 32            raise AttributeError("You cannot add instance attributes to %s" % self)
 33    return set_instance_attr
 34
 35
 36def _swig_setattr_nondynamic_class_variable(set):
 37    def set_class_attr(cls, name, value):
 38        if hasattr(cls, name) and not isinstance(getattr(cls, name), property):
 39            set(cls, name, value)
 40        else:
 41            raise AttributeError("You cannot add class attributes to %s" % cls)
 42    return set_class_attr
 43
 44
 45def _swig_add_metaclass(metaclass):
 46    """Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclass"""
 47    def wrapper(cls):
 48        return metaclass(cls.__name__, cls.__bases__, cls.__dict__.copy())
 49    return wrapper
 50
 51
 52class _SwigNonDynamicMeta(type):
 53    """Meta class to enforce nondynamic attributes (no new attributes) for a class"""
 54    __setattr__ = _swig_setattr_nondynamic_class_variable(type.__setattr__)
 55
 56
 57
 58def rtems_counter_frequency():
 59    r"""
 60    Returns the current counter frequency in Hz.
 61
 62    :rtype: uint32_t
 63    :return: The current counter frequency in Hz.
 64    """
 65    return _counter.rtems_counter_frequency()
 66
 67def rtems_counter_read():
 68    r"""
 69    Reads the current counter value.
 70
 71    :rtype: rtems_counter_ticks
 72    :return: The current counter value.
 73    """
 74    return _counter.rtems_counter_read()
 75
 76def rtems_counter_difference(second, first):
 77    r"""
 78    Returns the difference between the second and first CPU counter
 79    value.
 80
 81    This function is provided for backward compatibility.
 82    You may use "second - first" directly in the code.
 83
 84    :type second: rtems_counter_ticks, in
 85    :param second: The second CPU counter value.
 86    :type first: rtems_counter_ticks, in
 87    :param first: The first CPU counter value.
 88
 89    :rtype: rtems_counter_ticks
 90    :return: Returns second minus first.
 91    """
 92    return _counter.rtems_counter_difference(second, first)
 93
 94def rtems_counter_ticks_to_nanoseconds(ticks):
 95    r"""
 96    Converts counter ticks into nanoseconds.
 97
 98    :type ticks: rtems_counter_ticks, in
 99    :param ticks: The counter ticks value to convert.
100
101    :rtype: uint64_t
102    :return: The nanoseconds value corresponding to the counter ticks.  The value
103        is rounded up.
104    """
105    return _counter.rtems_counter_ticks_to_nanoseconds(ticks)
106
107def rtems_counter_nanoseconds_to_ticks(nanoseconds):
108    r"""
109    Converts nanoseconds into counter ticks.
110
111    :type nanoseconds: uint32_t, in
112    :param nanoseconds: The nanoseconds value to convert.
113
114    :rtype: rtems_counter_ticks
115    :return: The counter ticks value corresponding to the nanoseconds value.  The
116        value is rounded up.
117    """
118    return _counter.rtems_counter_nanoseconds_to_ticks(nanoseconds)
119
120def rtems_counter_ticks_to_sbintime(ticks):
121    r"""
122    Converts counter ticks into signed binary time (sbintime_t).
123
124    :type ticks: rtems_counter_ticks, in
125    :param ticks: The counter ticks value to convert.
126
127    :rtype: int64_t
128    :return: The signed binary time value corresponding to the counter ticks
129        value.  The value is rounded up.
130    """
131    return _counter.rtems_counter_ticks_to_sbintime(ticks)
132
133def rtems_counter_sbintime_to_ticks(sbt):
134    r"""
135    Converts signed binary time (sbintime_t) into counter ticks.
136
137    :type sbt: int64_t, in
138    :param sbt: The signed binary time value to convert.
139
140    :rtype: rtems_counter_ticks
141    :return: The counter ticks value corresponding to the nanoseconds value.  The
142        value is rounded up.
143    """
144    return _counter.rtems_counter_sbintime_to_ticks(sbt)
145
146def rtems_counter_initialize_converter(frequency):
147    r"""
148    Initializes the counter ticks to/from nanoseconds converter functions.
149
150    This function must be used to initialize the
151    rtems_counter_ticks_to_nanoseconds() and
152    rtems_counter_nanoseconds_to_ticks() functions.  It should be called during
153    system initialization by the board support package.
154
155    :type frequency: uint32_t, in
156    :param frequency: The current counter frequency in Hz.
157    """
158    return _counter.rtems_counter_initialize_converter(frequency)
159
160def rtems_counter_delay_ticks(ticks):
161    r"""
162    Busy wait for some counter ticks.
163
164    This function does not disable interrupts.  Thus task switches and
165    interrupts can interfere with this busy wait may prolong the delay.  This
166    function busy waits at least the specified time.  Due to some overhead the
167    actual delay may be longer.
168
169    :type ticks: rtems_counter_ticks, in
170    :param ticks: The minimum busy wait time in counter ticks.
171    """
172    return _counter.rtems_counter_delay_ticks(ticks)
173
174def rtems_counter_delay_nanoseconds(nanoseconds):
175    r"""
176    Busy wait for some nanoseconds.
177
178    This function does not disable interrupts.  Thus task switches and
179    interrupts can interfere with this busy wait may prolong the delay.  This
180    function busy waits at least the specified time.  Due to some overhead the
181    actual delay may be longer.
182
183    :type nanoseconds: uint32_t, in
184    :param nanoseconds: The minimum busy wait time in nanoseconds.
185    """
186    return _counter.rtems_counter_delay_nanoseconds(nanoseconds)
def rtems_counter_frequency():
59def rtems_counter_frequency():
60    r"""
61    Returns the current counter frequency in Hz.
62
63    :rtype: uint32_t
64    :return: The current counter frequency in Hz.
65    """
66    return _counter.rtems_counter_frequency()

Returns the current counter frequency in Hz.

Returns

The current counter frequency in Hz.

def rtems_counter_read():
68def rtems_counter_read():
69    r"""
70    Reads the current counter value.
71
72    :rtype: rtems_counter_ticks
73    :return: The current counter value.
74    """
75    return _counter.rtems_counter_read()

Reads the current counter value.

Returns

The current counter value.

def rtems_counter_difference(second, first):
77def rtems_counter_difference(second, first):
78    r"""
79    Returns the difference between the second and first CPU counter
80    value.
81
82    This function is provided for backward compatibility.
83    You may use "second - first" directly in the code.
84
85    :type second: rtems_counter_ticks, in
86    :param second: The second CPU counter value.
87    :type first: rtems_counter_ticks, in
88    :param first: The first CPU counter value.
89
90    :rtype: rtems_counter_ticks
91    :return: Returns second minus first.
92    """
93    return _counter.rtems_counter_difference(second, first)

Returns the difference between the second and first CPU counter value.

This function is provided for backward compatibility. You may use "second - first" directly in the code.

Parameters
  • second: The second CPU counter value.
  • first: The first CPU counter value.
Returns

Returns second minus first.

def rtems_counter_ticks_to_nanoseconds(ticks):
 95def rtems_counter_ticks_to_nanoseconds(ticks):
 96    r"""
 97    Converts counter ticks into nanoseconds.
 98
 99    :type ticks: rtems_counter_ticks, in
100    :param ticks: The counter ticks value to convert.
101
102    :rtype: uint64_t
103    :return: The nanoseconds value corresponding to the counter ticks.  The value
104        is rounded up.
105    """
106    return _counter.rtems_counter_ticks_to_nanoseconds(ticks)

Converts counter ticks into nanoseconds.

Parameters
  • ticks: The counter ticks value to convert.
Returns

The nanoseconds value corresponding to the counter ticks. The value is rounded up.

def rtems_counter_nanoseconds_to_ticks(nanoseconds):
108def rtems_counter_nanoseconds_to_ticks(nanoseconds):
109    r"""
110    Converts nanoseconds into counter ticks.
111
112    :type nanoseconds: uint32_t, in
113    :param nanoseconds: The nanoseconds value to convert.
114
115    :rtype: rtems_counter_ticks
116    :return: The counter ticks value corresponding to the nanoseconds value.  The
117        value is rounded up.
118    """
119    return _counter.rtems_counter_nanoseconds_to_ticks(nanoseconds)

Converts nanoseconds into counter ticks.

Parameters
  • nanoseconds: The nanoseconds value to convert.
Returns

The counter ticks value corresponding to the nanoseconds value. The value is rounded up.

def rtems_counter_ticks_to_sbintime(ticks):
121def rtems_counter_ticks_to_sbintime(ticks):
122    r"""
123    Converts counter ticks into signed binary time (sbintime_t).
124
125    :type ticks: rtems_counter_ticks, in
126    :param ticks: The counter ticks value to convert.
127
128    :rtype: int64_t
129    :return: The signed binary time value corresponding to the counter ticks
130        value.  The value is rounded up.
131    """
132    return _counter.rtems_counter_ticks_to_sbintime(ticks)

Converts counter ticks into signed binary time (sbintime_t).

Parameters
  • ticks: The counter ticks value to convert.
Returns

The signed binary time value corresponding to the counter ticks value. The value is rounded up.

def rtems_counter_sbintime_to_ticks(sbt):
134def rtems_counter_sbintime_to_ticks(sbt):
135    r"""
136    Converts signed binary time (sbintime_t) into counter ticks.
137
138    :type sbt: int64_t, in
139    :param sbt: The signed binary time value to convert.
140
141    :rtype: rtems_counter_ticks
142    :return: The counter ticks value corresponding to the nanoseconds value.  The
143        value is rounded up.
144    """
145    return _counter.rtems_counter_sbintime_to_ticks(sbt)

Converts signed binary time (sbintime_t) into counter ticks.

Parameters
  • sbt: The signed binary time value to convert.
Returns

The counter ticks value corresponding to the nanoseconds value. The value is rounded up.

def rtems_counter_initialize_converter(frequency):
147def rtems_counter_initialize_converter(frequency):
148    r"""
149    Initializes the counter ticks to/from nanoseconds converter functions.
150
151    This function must be used to initialize the
152    rtems_counter_ticks_to_nanoseconds() and
153    rtems_counter_nanoseconds_to_ticks() functions.  It should be called during
154    system initialization by the board support package.
155
156    :type frequency: uint32_t, in
157    :param frequency: The current counter frequency in Hz.
158    """
159    return _counter.rtems_counter_initialize_converter(frequency)

Initializes the counter ticks to/from nanoseconds converter functions.

This function must be used to initialize the rtems_counter_ticks_to_nanoseconds() and rtems_counter_nanoseconds_to_ticks() functions. It should be called during system initialization by the board support package.

Parameters
  • frequency: The current counter frequency in Hz.
def rtems_counter_delay_ticks(ticks):
161def rtems_counter_delay_ticks(ticks):
162    r"""
163    Busy wait for some counter ticks.
164
165    This function does not disable interrupts.  Thus task switches and
166    interrupts can interfere with this busy wait may prolong the delay.  This
167    function busy waits at least the specified time.  Due to some overhead the
168    actual delay may be longer.
169
170    :type ticks: rtems_counter_ticks, in
171    :param ticks: The minimum busy wait time in counter ticks.
172    """
173    return _counter.rtems_counter_delay_ticks(ticks)

Busy wait for some counter ticks.

This function does not disable interrupts. Thus task switches and interrupts can interfere with this busy wait may prolong the delay. This function busy waits at least the specified time. Due to some overhead the actual delay may be longer.

Parameters
  • ticks: The minimum busy wait time in counter ticks.
def rtems_counter_delay_nanoseconds(nanoseconds):
175def rtems_counter_delay_nanoseconds(nanoseconds):
176    r"""
177    Busy wait for some nanoseconds.
178
179    This function does not disable interrupts.  Thus task switches and
180    interrupts can interfere with this busy wait may prolong the delay.  This
181    function busy waits at least the specified time.  Due to some overhead the
182    actual delay may be longer.
183
184    :type nanoseconds: uint32_t, in
185    :param nanoseconds: The minimum busy wait time in nanoseconds.
186    """
187    return _counter.rtems_counter_delay_nanoseconds(nanoseconds)

Busy wait for some nanoseconds.

This function does not disable interrupts. Thus task switches and interrupts can interfere with this busy wait may prolong the delay. This function busy waits at least the specified time. Due to some overhead the actual delay may be longer.

Parameters
  • nanoseconds: The minimum busy wait time in nanoseconds.