Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(hid-rp): Regenerate hid usage pages #387

Merged
merged 1 commit into from
Feb 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
feat(hid-rp): Regenerate hid usage pages
  • Loading branch information
finger563 committed Feb 27, 2025
commit ca9b8fc59f01e9031ea723e5313afad16eedd5b3
10 changes: 3 additions & 7 deletions components/hid-rp/include/hid-rp-switch-pro.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ class SwitchProGamepadInputReport : public hid::report::base<hid::report::type::
// TODO: for report id 0x31, there are aditional 313 bytes of NFC/IR data input
// after this.
} __attribute__((packed)); // data union
} __attribute__((packed)); // input report data struct
} __attribute__((packed)); // input report data struct
// this will ensure we always have enough space for the largest report
// without having padding bytes defined anywhere.
uint8_t raw_report[63];
Expand Down Expand Up @@ -203,15 +203,11 @@ class SwitchProGamepadInputReport : public hid::report::base<hid::report::type::
constexpr void set_counter(uint8_t value) { counter = value; }

/// Increment the counter
constexpr void increment_counter() {
counter = (counter + 1);
}
constexpr void increment_counter() { counter = (counter + 1); }

/// Get the counter value
/// @return The counter value
constexpr uint8_t get_counter() const {
return counter;
}
constexpr uint8_t get_counter() const { return counter; }

/// Set the subcommand ACK
/// @param ack The subcommand ACK to set
Expand Down
6 changes: 3 additions & 3 deletions components/hid-rp/include/hid/page/button.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ namespace hid::page {
class button;
template <> struct info<button> {
constexpr static page_id_t page_id = 0x0009;
constexpr static usage_id_t max_usage_id = 0x00ff;
constexpr static usage_id_t max_usage_id = 0xffff;
constexpr static const char *name = "Button";
};
class button {
public:
constexpr operator usage_id_t() const { return id; }
explicit constexpr button(std::uint8_t value)
explicit constexpr button(std::uint16_t value)
: id(value) {}
std::uint8_t id{};
std::uint16_t id{};
};
} // namespace hid::page

Expand Down
1 change: 1 addition & 0 deletions components/hid-rp/include/hid/page/generic_desktop.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ enum class generic_desktop : std::uint8_t {
SYSTEM_SPEAKER_MUTE = 0x00a7,
SYSTEM_HIBERNATE = 0x00a8,
SYSTEM_MICROPHONE_MUTE = 0x00a9,
SYSTEM_ACCESSIBILITY_BINDING = 0x00aa,
SYSTEM_DISPLAY_INVERT = 0x00b0,
SYSTEM_DISPLAY_INTERNAL = 0x00b1,
SYSTEM_DISPLAY_EXTERNAL = 0x00b2,
Expand Down
6 changes: 3 additions & 3 deletions components/hid-rp/include/hid/page/monitor_enumerated.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ namespace hid::page {
class monitor_enumerated;
template <> struct info<monitor_enumerated> {
constexpr static page_id_t page_id = 0x0081;
constexpr static usage_id_t max_usage_id = 0x00ff;
constexpr static usage_id_t max_usage_id = 0xffff;
constexpr static const char *name = "Monitor Enumerated";
};
class monitor_enumerated {
public:
constexpr operator usage_id_t() const { return id; }
constexpr monitor_enumerated(std::uint8_t value)
explicit constexpr monitor_enumerated(std::uint16_t value)
: id(value) {}
std::uint8_t id{};
std::uint16_t id{};
};
} // namespace hid::page

Expand Down
6 changes: 3 additions & 3 deletions components/hid-rp/include/hid/page/ordinal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ namespace hid::page {
class ordinal;
template <> struct info<ordinal> {
constexpr static page_id_t page_id = 0x000a;
constexpr static usage_id_t max_usage_id = 0x00ff;
constexpr static usage_id_t max_usage_id = 0xffff;
constexpr static const char *name = "Ordinal";
};
class ordinal {
public:
constexpr operator usage_id_t() const { return id; }
constexpr ordinal(std::uint8_t value)
explicit constexpr ordinal(std::uint16_t value)
: id(value) {}
std::uint8_t id{};
std::uint16_t id{};
};
} // namespace hid::page

Expand Down
2 changes: 1 addition & 1 deletion components/hid-rp/include/hid/page/unicode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ template <> struct info<unicode> {
class unicode {
public:
constexpr operator usage_id_t() const { return id; }
constexpr unicode(std::uint8_t value)
explicit constexpr unicode(std::uint8_t value)
: id(value) {}
std::uint8_t id{};
};
Expand Down