The main part of developing a new module involves
implementing several standard callback functions, combined
"under the roof" of the module's instance of
the input_module_t structure.
Consider implementing the following callbacks:
- init()
- Should be called for a one-time initialization of a
module's state after it's loaded.
- reset()
- Used to reset a module's and/or device's state. You
would call it when the module is linked into an event bus
line; if necessary, it could be called from your code as a
reaction to any sort of device trouble.
- input()
- You usually implement this callback function in protocol
modules as part of the device-to-interface data channel.
- output()
- Usually called by higher-layer modules asking for data
to be sent to the device. You can use this callback for
passing commands to control an input device.
- pulse()
- Usually implemented in device class modules. This
callback is automatically activated each time that a
registered interrupt handler wants to notify a device module
about input activity.
- parm()
- Called by the Input Runtime System to parse any
command-line parameters given to the module.
- devctrl()
- Used by modules in an event bus line to send commands to
each other. This callback may also be called as a response
to the external devctl() call. You can use this
callback for reconfiguring a driver on the fly.
- shutdown()
- Called when the Input Runtime System is shutting down.