3 ms·
Just the other day I was looking at some embedded SoC which had some data structures for setting up various GPIOs and pins and such, it was something like:
by ChuckMcM 13y ago
Just the other day I was looking at some embedded SoC which had some data structures for setting up various GPIOs and pins and such, it was something like:
struct gpio_config {
uint8_t func;
uint8_t options;
uint32_t *loc;
};
struct gpio_alloc {
struct gpio_config pins[4];
struct gpio_alloc *next;
};
struct gpio_alloc fsmc_1 = {
...
};
All the pre-initialization stuff (which was being stored in flash so it was really read-only data) was code I realized not a lot of people wrote in C these days.