Difference between revisions of "Zephyr drivers"
Jump to navigation
Jump to search
(Creating new local page for links to practical Zephyr drivers and constructs.) |
m (Add section "Zephyr Kernel Level Device Support") |
||
| Line 4: | Line 4: | ||
* https://docs.zephyrproject.org/latest/services/smf/index.html | * https://docs.zephyrproject.org/latest/services/smf/index.html | ||
| + | |||
| + | |||
| + | == [[#top|^]] Zephyr Kernel Level Device Support == | ||
| + | |||
| + | <pre> | ||
| + | 150 | ||
| + | 151 bool z_device_is_ready(const struct device *dev) | ||
| + | 152 { | ||
| + | 153 /* | ||
| + | 154 * if an invalid device pointer is passed as argument, this call | ||
| + | 155 * reports the `device` as not ready for usage. | ||
| + | 156 */ | ||
| + | 157 if (dev == NULL) { | ||
| + | 158 return false; | ||
| + | 159 } | ||
| + | 160 | ||
| + | 161 return dev->state->initialized && (dev->state->init_res == 0U); | ||
| + | 162 } | ||
| + | 163 | ||
| + | </pre> | ||
Revision as of 22:55, 1 November 2022
drivers
^ Zephyr Kernel Level Device Support
150
151 bool z_device_is_ready(const struct device *dev)
152 {
153 /*
154 * if an invalid device pointer is passed as argument, this call
155 * reports the `device` as not ready for usage.
156 */
157 if (dev == NULL) {
158 return false;
159 }
160
161 return dev->state->initialized && (dev->state->init_res == 0U);
162 }
163