Corsair Lighting Protocol  0.15.0
Control LEDs connected to an Arduino with iCUE
TemperatureController.h
Go to the documentation of this file.
1 /*
2  Copyright 2019 Leon Kiefer
3 
4  Licensed under the Apache License, Version 2.0 (the "License");
5  you may not use this file except in compliance with the License.
6  You may obtain a copy of the License at
7 
8  http://www.apache.org/licenses/LICENSE-2.0
9 
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15 */
16 #pragma once
17 
22 #include "Arduino.h"
23 #include "ITemperatureController.h"
24 
25 #define TEMPERATURE_NUM 4
26 
27 #define TEMPERATURE_MASK_CONNECTED 0x01
28 #define TEMPERATURE_MASK_NOT_CONNECTED 0x00
29 
30 #define VOLTAGE_RAIL_12V 0
31 #define VOLTAGE_RAIL_5V 1
32 #define VOLTAGE_RAIL_3V3 2
33 
39 public:
40  virtual void handleTemperatureControl(const Command& command,
41  const CorsairLightingProtocolResponse* response) override;
48  virtual uint16_t getTemperature(uint8_t temperatureSensor);
49 
50 protected:
57  virtual uint16_t getTemperatureValue(uint8_t temperatureSensor) = 0;
64  virtual bool isTemperatureSensorConnected(uint8_t temperatureSensor) = 0;
70  virtual uint16_t getVoltageRail12V() = 0;
76  virtual uint16_t getVoltageRail5V() = 0;
82  virtual uint16_t getVoltageRail3V3() = 0;
83 };
Definition: CorsairLightingProtocolResponse.h:20
Definition: ITemperatureController.h:25
Definition: TemperatureController.h:38
virtual uint16_t getVoltageRail12V()=0
virtual uint16_t getTemperature(uint8_t temperatureSensor)
Definition: TemperatureController.cpp:81
virtual void handleTemperatureControl(const Command &command, const CorsairLightingProtocolResponse *response) override
Definition: TemperatureController.cpp:20
virtual uint16_t getVoltageRail3V3()=0
virtual bool isTemperatureSensorConnected(uint8_t temperatureSensor)=0
virtual uint16_t getTemperatureValue(uint8_t temperatureSensor)=0
virtual uint16_t getVoltageRail5V()=0
Definition: CorsairLightingProtocolConstants.h:110