I'm following the nordic academic courses, which are very nice by the way!
I've now followed three topics and I find three different variants which confuse me a lot:
1. const struct device *uart= DEVICE_DT_GET(DT_NODELABEL(uart0));
2. const struct gpio_dt_spec led0 = GPIO_DT_SPEC_GET(DT_ALIAS(led0), gpios);
3. static const struct i2c_dt_spec dev_i2c = I2C_DT_SPEC_GET(DT_NODELABEL(mysensor));
The static part, that ofcourse I get but what I do not understand is why there are (already) three different variants of getting my device structure?
sure, I do understand that the three lines are meant for different applications but to me they do kind of the same, right?
Can somebody explain the reason for that and their differences in a bit more detail because it is confusing me.