rtems_io
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 _rtems_io as _rtems_io 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 57class rtems_driver_address_table(object): 58 r""" 59 This structure contains the device driver entries. 60 61 This structure is used to register a device driver via 62 rtems_io_register_driver(). 63 """ 64 65 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") 66 __repr__ = _swig_repr 67 initialization_entry = property(_rtems_io.rtems_driver_address_table_initialization_entry_get, _rtems_io.rtems_driver_address_table_initialization_entry_set, doc=r""" 68 This member is the device driver initialization entry. 69 70 This entry is called by rtems_io_initialize(). 71 """) 72 open_entry = property(_rtems_io.rtems_driver_address_table_open_entry_get, _rtems_io.rtems_driver_address_table_open_entry_set, doc=r""" 73 This member is the device driver open entry. 74 75 This entry is called by rtems_io_open(). 76 """) 77 close_entry = property(_rtems_io.rtems_driver_address_table_close_entry_get, _rtems_io.rtems_driver_address_table_close_entry_set, doc=r""" 78 This member is the device driver close entry. 79 80 This entry is called by rtems_io_close(). 81 """) 82 read_entry = property(_rtems_io.rtems_driver_address_table_read_entry_get, _rtems_io.rtems_driver_address_table_read_entry_set, doc=r""" 83 This member is the device driver read entry. 84 85 This entry is called by rtems_io_read(). 86 """) 87 write_entry = property(_rtems_io.rtems_driver_address_table_write_entry_get, _rtems_io.rtems_driver_address_table_write_entry_set, doc=r""" 88 This member is the device driver write entry. 89 90 This entry is called by rtems_io_write(). 91 """) 92 control_entry = property(_rtems_io.rtems_driver_address_table_control_entry_get, _rtems_io.rtems_driver_address_table_control_entry_set, doc=r""" 93 This member is the device driver control entry. 94 95 This entry is called by rtems_io_control(). 96 """) 97 98 def __init__(self): 99 r"""__init__(rtems_driver_address_table self) -> rtems_driver_address_table""" 100 _rtems_io.rtems_driver_address_table_swiginit(self, _rtems_io.new_rtems_driver_address_table()) 101 __swig_destroy__ = _rtems_io.delete_rtems_driver_address_table 102 103# Register rtems_driver_address_table in _rtems_io: 104_rtems_io.rtems_driver_address_table_swigregister(rtems_driver_address_table) 105 106def rtems_io_register_driver(major, driver_table, registered_major): 107 r""" 108 Registers and initializes the device with the specified device driver 109 address table and device major number in the Device Driver Table. 110 111 :type major: rtems_device_major_number 112 :param major: is the device major number. Use a value of zero to let the 113 system obtain a device major number automatically. 114 115 :type driver_table: :py:class:`rtems_driver_address_table` 116 :param driver_table: is the device driver address table. 117 118 :type registered_major: rtems_device_major_number, out 119 :param registered_major: is the pointer to an 120 ::rtems_device_major_number object. When the directive call is 121 successful, the device major number of the registered device will be 122 stored in this object. 123 124 :rtype: rtems_status_code 125 :return: Other status codes may be returned by rtems_io_initialize(). 126 127 Title: Notes 128 129 If the device major number equals zero a device major number will be 130 obtained. The device major number of the registered driver will be 131 returned. 132 133 After a successful registration, the rtems_io_initialize() directive will be 134 called to initialize the device. 135 """ 136 return _rtems_io.rtems_io_register_driver(major, driver_table, registered_major) 137 138def rtems_io_unregister_driver(major): 139 r""" 140 Removes a device driver specified by the device major number from the 141 Device Driver Table. 142 143 :type major: rtems_device_major_number 144 :param major: is the major number of the device. 145 146 Title: Notes 147 Currently no specific checks are made and the driver is not closed. 148 """ 149 return _rtems_io.rtems_io_unregister_driver(major) 150 151def rtems_io_initialize(major, minor, argument): 152 r""" 153 Initializes the device specified by the device major and minor 154 numbers. 155 156 :type major: rtems_device_major_number 157 :param major: is the major number of the device. 158 159 :type minor: rtems_device_minor_number 160 :param minor: is the minor number of the device. 161 162 :type argument: void 163 :param argument: is the argument passed to the device driver initialization 164 entry. 165 166 This directive calls the device driver initialization entry registered in 167 the Device Driver Table for the specified device major number. 168 169 :rtype: rtems_status_code 170 :return: Other status codes may be returned by the device driver 171 initialization entry. 172 173 Title: Notes 174 175 This directive is automatically invoked for each device driver defined by 176 the application configuration during the system initialization and via the 177 rtems_io_register_driver() directive. 178 179 A device driver initialization entry is responsible for initializing all 180 hardware and data structures associated with a device. If necessary, it can 181 allocate memory to be used during other operations. 182 """ 183 return _rtems_io.rtems_io_initialize(major, minor, argument) 184 185def rtems_io_register_name(device_name, major, minor): 186 r""" 187 Registers the device specified by the device major and minor numbers 188 in the file system under the specified name. 189 190 :type device_name: string 191 :param device_name: is the device name in the file system. 192 193 :type major: rtems_device_major_number 194 :param major: is the device major number. 195 196 :type minor: rtems_device_minor_number 197 :param minor: is the device minor number. 198 199 Title: Notes 200 The device is registered as a character device. 201 """ 202 return _rtems_io.rtems_io_register_name(device_name, major, minor) 203 204def rtems_io_open(major, minor, argument): 205 r""" 206 Opens the device specified by the device major and minor numbers. 207 208 :type major: rtems_device_major_number 209 :param major: is the major number of the device. 210 211 :type minor: rtems_device_minor_number 212 :param minor: is the minor number of the device. 213 214 :type argument: void 215 :param argument: is the argument passed to the device driver close entry. 216 217 This directive calls the device driver open entry registered in the Device 218 Driver Table for the specified device major number. 219 220 :rtype: rtems_status_code 221 :return: Other status codes may be returned by the device driver open entry. 222 223 Title: Notes 224 The open entry point is commonly used by device drivers to provide exclusive 225 access to a device. 226 """ 227 return _rtems_io.rtems_io_open(major, minor, argument) 228 229def rtems_io_close(major, minor, argument): 230 r""" 231 Closes the device specified by the device major and minor numbers. 232 233 :type major: rtems_device_major_number 234 :param major: is the major number of the device. 235 236 :type minor: rtems_device_minor_number 237 :param minor: is the minor number of the device. 238 239 :type argument: void 240 :param argument: is the argument passed to the device driver close entry. 241 242 This directive calls the device driver close entry registered in the Device 243 Driver Table for the specified device major number. 244 245 :rtype: rtems_status_code 246 :return: Other status codes may be returned by the device driver close entry. 247 248 Title: Notes 249 The close entry point is commonly used by device drivers to relinquish 250 exclusive access to a device. 251 """ 252 return _rtems_io.rtems_io_close(major, minor, argument) 253 254def rtems_io_read(major, minor, argument): 255 r""" 256 Reads from the device specified by the device major and minor 257 numbers. 258 259 :type major: rtems_device_major_number 260 :param major: is the major number of the device. 261 262 :type minor: rtems_device_minor_number 263 :param minor: is the minor number of the device. 264 265 :type argument: void 266 :param argument: is the argument passed to the device driver read entry. 267 268 This directive calls the device driver read entry registered in the Device 269 Driver Table for the specified device major number. 270 271 :rtype: rtems_status_code 272 :return: Other status codes may be returned by the device driver read entry. 273 274 Title: Notes 275 Read operations typically require a buffer address as part of the argument 276 parameter block. The contents of this buffer will be replaced with data 277 from the device. 278 """ 279 return _rtems_io.rtems_io_read(major, minor, argument) 280 281def rtems_io_write(major, minor, argument): 282 r""" 283 Writes to the device specified by the device major and minor numbers. 284 285 :type major: rtems_device_major_number 286 :param major: is the major number of the device. 287 288 :type minor: rtems_device_minor_number 289 :param minor: is the minor number of the device. 290 291 :type argument: void 292 :param argument: is the argument passed to the device driver write entry. 293 294 This directive calls the device driver write entry registered in the Device 295 Driver Table for the specified device major number. 296 297 :rtype: rtems_status_code 298 :return: Other status codes may be returned by the device driver write entry. 299 300 Title: Notes 301 Write operations typically require a buffer address as part of the argument 302 parameter block. The contents of this buffer will be sent to the device. 303 """ 304 return _rtems_io.rtems_io_write(major, minor, argument) 305 306def rtems_io_control(major, minor, argument): 307 r""" 308 Controls the device specified by the device major and minor numbers. 309 310 :type major: rtems_device_major_number 311 :param major: is the major number of the device. 312 313 :type minor: rtems_device_minor_number 314 :param minor: is the minor number of the device. 315 316 :type argument: void 317 :param argument: is the argument passed to the device driver I/O control 318 entry. 319 320 This directive calls the device driver I/O control entry registered in the 321 Device Driver Table for the specified device major number. 322 323 :rtype: rtems_status_code 324 :return: Other status codes may be returned by the device driver I/O control 325 entry. 326 327 Title: Notes 328 The exact functionality of the driver entry called by this directive is 329 driver dependent. It should not be assumed that the control entries of two 330 device drivers are compatible. For example, an RS-232 driver I/O control 331 operation may change the baud of a serial line, while an I/O control 332 operation for a floppy disk driver may cause a seek operation. 333 """ 334 return _rtems_io.rtems_io_control(major, minor, argument)
58class rtems_driver_address_table(object): 59 r""" 60 This structure contains the device driver entries. 61 62 This structure is used to register a device driver via 63 rtems_io_register_driver(). 64 """ 65 66 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") 67 __repr__ = _swig_repr 68 initialization_entry = property(_rtems_io.rtems_driver_address_table_initialization_entry_get, _rtems_io.rtems_driver_address_table_initialization_entry_set, doc=r""" 69 This member is the device driver initialization entry. 70 71 This entry is called by rtems_io_initialize(). 72 """) 73 open_entry = property(_rtems_io.rtems_driver_address_table_open_entry_get, _rtems_io.rtems_driver_address_table_open_entry_set, doc=r""" 74 This member is the device driver open entry. 75 76 This entry is called by rtems_io_open(). 77 """) 78 close_entry = property(_rtems_io.rtems_driver_address_table_close_entry_get, _rtems_io.rtems_driver_address_table_close_entry_set, doc=r""" 79 This member is the device driver close entry. 80 81 This entry is called by rtems_io_close(). 82 """) 83 read_entry = property(_rtems_io.rtems_driver_address_table_read_entry_get, _rtems_io.rtems_driver_address_table_read_entry_set, doc=r""" 84 This member is the device driver read entry. 85 86 This entry is called by rtems_io_read(). 87 """) 88 write_entry = property(_rtems_io.rtems_driver_address_table_write_entry_get, _rtems_io.rtems_driver_address_table_write_entry_set, doc=r""" 89 This member is the device driver write entry. 90 91 This entry is called by rtems_io_write(). 92 """) 93 control_entry = property(_rtems_io.rtems_driver_address_table_control_entry_get, _rtems_io.rtems_driver_address_table_control_entry_set, doc=r""" 94 This member is the device driver control entry. 95 96 This entry is called by rtems_io_control(). 97 """) 98 99 def __init__(self): 100 r"""__init__(rtems_driver_address_table self) -> rtems_driver_address_table""" 101 _rtems_io.rtems_driver_address_table_swiginit(self, _rtems_io.new_rtems_driver_address_table()) 102 __swig_destroy__ = _rtems_io.delete_rtems_driver_address_table
This structure contains the device driver entries.
This structure is used to register a device driver via rtems_io_register_driver().
99 def __init__(self): 100 r"""__init__(rtems_driver_address_table self) -> rtems_driver_address_table""" 101 _rtems_io.rtems_driver_address_table_swiginit(self, _rtems_io.new_rtems_driver_address_table())
__init__(rtems_driver_address_table self) -> rtems_driver_address_table
66 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
The membership flag
107def rtems_io_register_driver(major, driver_table, registered_major): 108 r""" 109 Registers and initializes the device with the specified device driver 110 address table and device major number in the Device Driver Table. 111 112 :type major: rtems_device_major_number 113 :param major: is the device major number. Use a value of zero to let the 114 system obtain a device major number automatically. 115 116 :type driver_table: :py:class:`rtems_driver_address_table` 117 :param driver_table: is the device driver address table. 118 119 :type registered_major: rtems_device_major_number, out 120 :param registered_major: is the pointer to an 121 ::rtems_device_major_number object. When the directive call is 122 successful, the device major number of the registered device will be 123 stored in this object. 124 125 :rtype: rtems_status_code 126 :return: Other status codes may be returned by rtems_io_initialize(). 127 128 Title: Notes 129 130 If the device major number equals zero a device major number will be 131 obtained. The device major number of the registered driver will be 132 returned. 133 134 After a successful registration, the rtems_io_initialize() directive will be 135 called to initialize the device. 136 """ 137 return _rtems_io.rtems_io_register_driver(major, driver_table, registered_major)
Registers and initializes the device with the specified device driver address table and device major number in the Device Driver Table.
Parameters
major: is the device major number. Use a value of zero to let the system obtain a device major number automatically.
driver_table: is the device driver address table.
registered_major: is the pointer to an ::rtems_device_major_number object. When the directive call is successful, the device major number of the registered device will be stored in this object.
Returns
Other status codes may be returned by rtems_io_initialize().
Title: Notes
If the device major number equals zero a device major number will be obtained. The device major number of the registered driver will be returned.
After a successful registration, the rtems_io_initialize() directive will be called to initialize the device.
139def rtems_io_unregister_driver(major): 140 r""" 141 Removes a device driver specified by the device major number from the 142 Device Driver Table. 143 144 :type major: rtems_device_major_number 145 :param major: is the major number of the device. 146 147 Title: Notes 148 Currently no specific checks are made and the driver is not closed. 149 """ 150 return _rtems_io.rtems_io_unregister_driver(major)
Removes a device driver specified by the device major number from the Device Driver Table.
Parameters
- major: is the major number of the device.
Title: Notes Currently no specific checks are made and the driver is not closed.
152def rtems_io_initialize(major, minor, argument): 153 r""" 154 Initializes the device specified by the device major and minor 155 numbers. 156 157 :type major: rtems_device_major_number 158 :param major: is the major number of the device. 159 160 :type minor: rtems_device_minor_number 161 :param minor: is the minor number of the device. 162 163 :type argument: void 164 :param argument: is the argument passed to the device driver initialization 165 entry. 166 167 This directive calls the device driver initialization entry registered in 168 the Device Driver Table for the specified device major number. 169 170 :rtype: rtems_status_code 171 :return: Other status codes may be returned by the device driver 172 initialization entry. 173 174 Title: Notes 175 176 This directive is automatically invoked for each device driver defined by 177 the application configuration during the system initialization and via the 178 rtems_io_register_driver() directive. 179 180 A device driver initialization entry is responsible for initializing all 181 hardware and data structures associated with a device. If necessary, it can 182 allocate memory to be used during other operations. 183 """ 184 return _rtems_io.rtems_io_initialize(major, minor, argument)
Initializes the device specified by the device major and minor numbers.
Parameters
major: is the major number of the device.
minor: is the minor number of the device.
argument: is the argument passed to the device driver initialization entry.
This directive calls the device driver initialization entry registered in the Device Driver Table for the specified device major number.
Returns
Other status codes may be returned by the device driver initialization entry.
Title: Notes
This directive is automatically invoked for each device driver defined by the application configuration during the system initialization and via the rtems_io_register_driver() directive.
A device driver initialization entry is responsible for initializing all hardware and data structures associated with a device. If necessary, it can allocate memory to be used during other operations.
186def rtems_io_register_name(device_name, major, minor): 187 r""" 188 Registers the device specified by the device major and minor numbers 189 in the file system under the specified name. 190 191 :type device_name: string 192 :param device_name: is the device name in the file system. 193 194 :type major: rtems_device_major_number 195 :param major: is the device major number. 196 197 :type minor: rtems_device_minor_number 198 :param minor: is the device minor number. 199 200 Title: Notes 201 The device is registered as a character device. 202 """ 203 return _rtems_io.rtems_io_register_name(device_name, major, minor)
Registers the device specified by the device major and minor numbers in the file system under the specified name.
Parameters
device_name: is the device name in the file system.
major: is the device major number.
minor: is the device minor number.
Title: Notes The device is registered as a character device.
205def rtems_io_open(major, minor, argument): 206 r""" 207 Opens the device specified by the device major and minor numbers. 208 209 :type major: rtems_device_major_number 210 :param major: is the major number of the device. 211 212 :type minor: rtems_device_minor_number 213 :param minor: is the minor number of the device. 214 215 :type argument: void 216 :param argument: is the argument passed to the device driver close entry. 217 218 This directive calls the device driver open entry registered in the Device 219 Driver Table for the specified device major number. 220 221 :rtype: rtems_status_code 222 :return: Other status codes may be returned by the device driver open entry. 223 224 Title: Notes 225 The open entry point is commonly used by device drivers to provide exclusive 226 access to a device. 227 """ 228 return _rtems_io.rtems_io_open(major, minor, argument)
Opens the device specified by the device major and minor numbers.
Parameters
major: is the major number of the device.
minor: is the minor number of the device.
argument: is the argument passed to the device driver close entry.
This directive calls the device driver open entry registered in the Device Driver Table for the specified device major number.
Returns
Other status codes may be returned by the device driver open entry.
Title: Notes The open entry point is commonly used by device drivers to provide exclusive access to a device.
230def rtems_io_close(major, minor, argument): 231 r""" 232 Closes the device specified by the device major and minor numbers. 233 234 :type major: rtems_device_major_number 235 :param major: is the major number of the device. 236 237 :type minor: rtems_device_minor_number 238 :param minor: is the minor number of the device. 239 240 :type argument: void 241 :param argument: is the argument passed to the device driver close entry. 242 243 This directive calls the device driver close entry registered in the Device 244 Driver Table for the specified device major number. 245 246 :rtype: rtems_status_code 247 :return: Other status codes may be returned by the device driver close entry. 248 249 Title: Notes 250 The close entry point is commonly used by device drivers to relinquish 251 exclusive access to a device. 252 """ 253 return _rtems_io.rtems_io_close(major, minor, argument)
Closes the device specified by the device major and minor numbers.
Parameters
major: is the major number of the device.
minor: is the minor number of the device.
argument: is the argument passed to the device driver close entry.
This directive calls the device driver close entry registered in the Device Driver Table for the specified device major number.
Returns
Other status codes may be returned by the device driver close entry.
Title: Notes The close entry point is commonly used by device drivers to relinquish exclusive access to a device.
255def rtems_io_read(major, minor, argument): 256 r""" 257 Reads from the device specified by the device major and minor 258 numbers. 259 260 :type major: rtems_device_major_number 261 :param major: is the major number of the device. 262 263 :type minor: rtems_device_minor_number 264 :param minor: is the minor number of the device. 265 266 :type argument: void 267 :param argument: is the argument passed to the device driver read entry. 268 269 This directive calls the device driver read entry registered in the Device 270 Driver Table for the specified device major number. 271 272 :rtype: rtems_status_code 273 :return: Other status codes may be returned by the device driver read entry. 274 275 Title: Notes 276 Read operations typically require a buffer address as part of the argument 277 parameter block. The contents of this buffer will be replaced with data 278 from the device. 279 """ 280 return _rtems_io.rtems_io_read(major, minor, argument)
Reads from the device specified by the device major and minor numbers.
Parameters
major: is the major number of the device.
minor: is the minor number of the device.
argument: is the argument passed to the device driver read entry.
This directive calls the device driver read entry registered in the Device Driver Table for the specified device major number.
Returns
Other status codes may be returned by the device driver read entry.
Title: Notes Read operations typically require a buffer address as part of the argument parameter block. The contents of this buffer will be replaced with data from the device.
282def rtems_io_write(major, minor, argument): 283 r""" 284 Writes to the device specified by the device major and minor numbers. 285 286 :type major: rtems_device_major_number 287 :param major: is the major number of the device. 288 289 :type minor: rtems_device_minor_number 290 :param minor: is the minor number of the device. 291 292 :type argument: void 293 :param argument: is the argument passed to the device driver write entry. 294 295 This directive calls the device driver write entry registered in the Device 296 Driver Table for the specified device major number. 297 298 :rtype: rtems_status_code 299 :return: Other status codes may be returned by the device driver write entry. 300 301 Title: Notes 302 Write operations typically require a buffer address as part of the argument 303 parameter block. The contents of this buffer will be sent to the device. 304 """ 305 return _rtems_io.rtems_io_write(major, minor, argument)
Writes to the device specified by the device major and minor numbers.
Parameters
major: is the major number of the device.
minor: is the minor number of the device.
argument: is the argument passed to the device driver write entry.
This directive calls the device driver write entry registered in the Device Driver Table for the specified device major number.
Returns
Other status codes may be returned by the device driver write entry.
Title: Notes Write operations typically require a buffer address as part of the argument parameter block. The contents of this buffer will be sent to the device.
307def rtems_io_control(major, minor, argument): 308 r""" 309 Controls the device specified by the device major and minor numbers. 310 311 :type major: rtems_device_major_number 312 :param major: is the major number of the device. 313 314 :type minor: rtems_device_minor_number 315 :param minor: is the minor number of the device. 316 317 :type argument: void 318 :param argument: is the argument passed to the device driver I/O control 319 entry. 320 321 This directive calls the device driver I/O control entry registered in the 322 Device Driver Table for the specified device major number. 323 324 :rtype: rtems_status_code 325 :return: Other status codes may be returned by the device driver I/O control 326 entry. 327 328 Title: Notes 329 The exact functionality of the driver entry called by this directive is 330 driver dependent. It should not be assumed that the control entries of two 331 device drivers are compatible. For example, an RS-232 driver I/O control 332 operation may change the baud of a serial line, while an I/O control 333 operation for a floppy disk driver may cause a seek operation. 334 """ 335 return _rtems_io.rtems_io_control(major, minor, argument)
Controls the device specified by the device major and minor numbers.
Parameters
major: is the major number of the device.
minor: is the minor number of the device.
argument: is the argument passed to the device driver I/O control entry.
This directive calls the device driver I/O control entry registered in the Device Driver Table for the specified device major number.
Returns
Other status codes may be returned by the device driver I/O control entry.
Title: Notes The exact functionality of the driver entry called by this directive is driver dependent. It should not be assumed that the control entries of two device drivers are compatible. For example, an RS-232 driver I/O control operation may change the baud of a serial line, while an I/O control operation for a floppy disk driver may cause a seek operation.