The General Principles

Drivers are system components that are responsible for hiding all device dependencies from clients via a standard interface.

On the surface, you may say "Of course!", but things can become subtle.

Consider this example: The telescope whose driver you are writing needs to be "homed" before it can be used. This is an unusual requirement, arising from the behavior of the particular micro controller. While the Telescope Interface Standard provides a Home() method, it is not enough to simply implement Home() and leave it at that. Applications would need to know this "special info" about your mount! Since most other mounts can be used after setting Connected = True and, if needed, calling Unpark(), applications will fail when using your mount. Thus, you need to handle that initial homing as part of the driver's Connected property, or as an internal pre-condition to using any other methods or properties that depend on that initial homing. It must be hidden from clients, as it is a device dependency.

It's important to consider what aspects of your target device are exposed to clients. With this in mind, you should review the relevant specification to make sure you aren't exposing low-level limitations or unique requirements to clients. Some of the other sections listed on the left address a few specific instances of this that seem to come up commonly.

Do it correctly or signal an error.

This is the basic "contract" between a driver and its client application. Your driver absolutely must either do what it is asked or signal an error condition for the client to trap. Unless the client gets an error, it will always assume you have done what it requested and continue in its logic under that assumption. This means that you must not return "illegal" values for properties in lieu of signaling an error, or "try" to do something and return whether it was done or not. You cannot expect client applications to know about limitations and quirks of your device and avoid them (see the first principle above).