Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

These devices can be on-chip sensors (temperature, battery), interface interfaces to external sensors and actuators (e.g. GPIO, SPI, I2C), or miscellaneous devices (e.g. the random number generator).

...

  • dn_open() is used to open a device. The exact arguments to pass to this functions function depends on the device that is opened. Some devices require no arguments. Others, such as the I2C device, require you to pass an pass an argument (e.g. the baudrate).
  • dn_close() is used to close a previously opened device. Once it is closed, this device can be re-opened and re-used, for example, by a different task.
  • dn_ioctl() is used to configure a previously opened device, and is only available on select devices. An example use case is re-configuring the baudrate on the UART device.
  • dn_read() is used to read a value from a previously opened device, and is only available on select devices. An example use case is retrieving the voltage from an ADC channel.
  • dn_write() is used to write a value to a previously opened device, and is only available on select devices. An example use case is setting the output state of a GPIO.

...