Allow configuration of intel pstates paired with fan-modes

This commit is contained in:
Luke
2020-05-02 19:31:40 +12:00
parent 1a967f315b
commit f12bb1d4f6
10 changed files with 169 additions and 92 deletions

View File

@@ -24,12 +24,12 @@ use uhid_virt::{Bus, CreateParams, UHIDDevice};
/// `rogcore.virt_keys().press([0x01, 0, 0, 0x82, 0, 0, 0, 0]); // Sleep`
///
/// `rogcore.virt_keys().press([0x01, 0, 0, 0x66, 0, 0, 0, 0]); // Power (menu)`
pub(crate) struct VirtKeys {
pub struct VirtKeys {
device: UHIDDevice<std::fs::File>,
}
impl VirtKeys {
pub(crate) fn new() -> Self {
pub fn new() -> Self {
VirtKeys {
device: UHIDDevice::create(CreateParams {
name: String::from("Virtual ROG buttons"),
@@ -96,7 +96,7 @@ impl VirtKeys {
}
/// A single on/off key press
pub(crate) fn press(&mut self, input: [u8; 32]) {
pub fn press(&mut self, input: [u8; 32]) {
self.device.write(&input).unwrap();
let mut reset = [0u8; 32];
reset[0] = input[0];
@@ -106,7 +106,7 @@ impl VirtKeys {
#[allow(dead_code)]
#[derive(Copy, Clone)]
pub(crate) enum ConsumerKeys {
pub enum ConsumerKeys {
Power = 0x30,
Sleep = 0x32,
Menu = 0x0040,