- Determining type of device
Re: Determining type of device
toggle quoted messageShow quoted text
Hi Johannes, as far I know, the device structure is formed by generic pointers in all its fields, in a first look this stills a good approach to keep the flexibility and while keeps the device API uniform, on other hand it is not a type-safe, so you cannot determine which type of device using only the device structure.
Please let me know if this info was useful.
is there a zephyr-way in determining which type a device is, after getting a reference to it through device_get_binding?
Since a gpio device has the same signature as a flash for example it's not obvious for me how to make sure that the right device pointer is passed in a higer-level application.
Thanks in advance,
Johannes Hutter ¦ Embedded Software Developer
Workaround GmbH (ProGlove)
Friedenstr. 4 | 81671 München
Managing Director: Thomas Kirchner
HRB: 216605 | AG München
Zephyr-users mailing list
Felipe S. Neves
Embedded software & systems engineer
+55 11 96610 – 0855
Join email@example.com to automatically receive all group messages.