mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-02-18 10:53:17 +00:00
Add name to DeviceType
This commit is contained in:
parent
adef122b00
commit
36817aaaea
@ -20,8 +20,7 @@ struct DeviceInternal;
|
||||
|
||||
/** Enables discovering devices of the same type */
|
||||
struct DeviceType {
|
||||
/* Placeholder because empty structs have a different size with C vs C++ compilers */
|
||||
uint8_t _;
|
||||
const char* name;
|
||||
};
|
||||
|
||||
/** Represents a piece of hardware */
|
||||
|
||||
@ -32,6 +32,8 @@ error_t gpio_controller_get_pin_count(struct Device* device, uint32_t* count) {
|
||||
return GPIO_DRIVER_API(driver)->get_pin_count(device, count);
|
||||
}
|
||||
|
||||
extern const struct DeviceType GPIO_CONTROLLER_TYPE { 0 };
|
||||
extern const struct DeviceType GPIO_CONTROLLER_TYPE {
|
||||
.name = "gpio-controller"
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@ -49,6 +49,8 @@ error_t i2c_controller_has_device_at_address(Device* device, uint8_t address, Ti
|
||||
return I2C_DRIVER_API(driver)->write(device, address, message, 2, timeout);
|
||||
}
|
||||
|
||||
extern const struct DeviceType I2C_CONTROLLER_TYPE { 0 };
|
||||
extern const struct DeviceType I2C_CONTROLLER_TYPE {
|
||||
.name = "i2c-controller"
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@ -32,6 +32,8 @@ error_t i2s_controller_reset(struct Device* device) {
|
||||
return I2S_DRIVER_API(driver)->reset(device);
|
||||
}
|
||||
|
||||
extern const struct DeviceType I2S_CONTROLLER_TYPE { 0 };
|
||||
extern const struct DeviceType I2S_CONTROLLER_TYPE {
|
||||
.name = "i2s-controller"
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user