blob: ad9953f2f755ee480d8a0e99439972187f1aea59 [file] [log] [blame]
// Copyright 2023 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
library fuchsia.buttons;
using fuchsia.input.report;
/// Analog-to-Digital Converter Buttons
type AdcButtonConfig = table {
/// ADC Channel Index to read button value on.
1: channel_idx uint32;
/// If press_threshold <= value <= release_threshold, button is pressed. Otherwise, not pressed.
2: release_threshold uint32;
3: press_threshold uint32;
};
type ButtonConfig = flexible union {
/// ADC Buttons.
1: adc AdcButtonConfig;
};
type Button = table {
/// Button Types. A single button may affect multiple things and thus have multiple
/// functionalities. For example, a privacy switch that mutes both the camera and mic may map to
/// the combination of fuchsia.input.report.ConsumerControlButton.MIC_MUTE and CAMERA_DISABLE.
1: types vector<fuchsia.input.report.ConsumerControlButton>:MAX;
/// Button Config.
2: button_config ButtonConfig;
};
type Metadata = table {
/// Polling Rate in usec if exists.
1: polling_rate_usec uint32;
/// Buttons.
2: buttons vector<Button>:MAX;
};