input_common: Add camera driver

This commit is contained in:
german77 2022-06-18 23:32:07 -05:00
parent 97729fd8e9
commit f19e7be6e8
11 changed files with 299 additions and 6 deletions

View file

@ -28,7 +28,7 @@ enum class InputType {
Color,
Vibration,
Nfc,
Ir,
IrSensor,
};
// Internal battery charge level
@ -53,6 +53,15 @@ enum class PollingMode {
IR,
};
enum class CameraFormat {
Size320x240,
Size160x120,
Size80x60,
Size40x30,
Size20x15,
None,
};
// Vibration reply from the controller
enum class VibrationError {
None,
@ -68,6 +77,13 @@ enum class PollingError {
Unknown,
};
// Ir camera reply from the controller
enum class CameraError {
None,
NotSupported,
Unknown,
};
// Hint for amplification curve to be used
enum class VibrationAmplificationType {
Linear,
@ -176,6 +192,12 @@ struct LedStatus {
bool led_4{};
};
// Raw data fom camera
struct CameraStatus {
CameraFormat format{CameraFormat::None};
std::vector<u8> data{};
};
// List of buttons to be passed to Qt that can be translated
enum class ButtonNames {
Undefined,
@ -233,6 +255,7 @@ struct CallbackStatus {
BodyColorStatus color_status{};
BatteryStatus battery_status{};
VibrationStatus vibration_status{};
CameraStatus camera_status{};
};
// Triggered once every input change
@ -281,6 +304,10 @@ public:
virtual PollingError SetPollingMode([[maybe_unused]] PollingMode polling_mode) {
return PollingError::NotSupported;
}
virtual CameraError SetCameraFormat([[maybe_unused]] CameraFormat camera_format) {
return CameraError::NotSupported;
}
};
/// An abstract class template for a factory that can create input devices.