Class for handling detailed Amcor A/C messages.
More...
#include <ir_Amcor.h>
|
| | IRAmcorAc (const uint16_t pin, const bool inverted=false, const bool use_modulation=true) |
| | Class constructor.
|
| |
| void | stateReset () |
| | Reset the internals of the object to a known good state.
|
| |
| void | send (const uint16_t repeat=kAmcorDefaultRepeat) |
| | Send the current internal state as an IR message.
|
| |
| int8_t | calibrate (void) |
| | Run the calibration to calculate uSec timing offsets for this platform.
|
| |
| void | begin () |
| | Set up hardware to be able to send a message.
|
| |
| void | setPower (const bool state) |
| | Set the internal state to have the desired power.
|
| |
| bool | getPower (void) const |
| | Get the power setting from the internal state.
|
| |
| void | on (void) |
| | Set the internal state to have the power on.
|
| |
| void | off (void) |
| | Set the internal state to have the power off.
|
| |
| void | setTemp (const uint8_t temp) |
| | Set the temperature.
|
| |
| uint8_t | getTemp (void) const |
| | Get the current temperature setting.
|
| |
| void | setMax (const bool on) |
| | Control the current Maximum Cooling or Heating setting. (i.e. Turbo)
|
| |
| bool | getMax (void) const |
| | Is the Maximum Cooling or Heating setting (i.e. Turbo) setting on?
|
| |
| void | setFan (const uint8_t speed) |
| | Set the speed of the fan.
|
| |
| uint8_t | getFan (void) const |
| | Get the current fan speed setting.
|
| |
| void | setMode (const uint8_t mode) |
| | Set the desired operation mode.
|
| |
| uint8_t | getMode (void) const |
| | Get the current operation mode setting.
|
| |
| uint8_t * | getRaw (void) |
| | Get the raw state of the object, suitable to be sent with the appropriate IRsend object method.
|
| |
| void | setRaw (const uint8_t state[]) |
| | Set the raw state of the object.
|
| |
| stdAc::state_t | toCommon (void) const |
| | Convert the current internal state into its stdAc::state_t equivalent.
|
| |
| String | toString (void) const |
| | Convert the current internal state into a human readable string.
|
| |
|
| void | checksum (void) |
| | Update the checksum value for the internal state.
|
| |
Class for handling detailed Amcor A/C messages.
◆ IRAmcorAc()
| IRAmcorAc::IRAmcorAc |
( |
const uint16_t |
pin, |
|
|
const bool |
inverted = false, |
|
|
const bool |
use_modulation = true |
|
) |
| |
|
explicit |
Class constructor.
- Parameters
-
| [in] | pin | GPIO to be used when sending. |
| [in] | inverted | Is the output signal to be inverted? |
| [in] | use_modulation | Is frequency modulation to be used? |
◆ begin()
| void IRAmcorAc::begin |
( |
void |
| ) |
|
Set up hardware to be able to send a message.
◆ calcChecksum()
| uint8_t IRAmcorAc::calcChecksum |
( |
const uint8_t |
state[], |
|
|
const uint16_t |
length = kAmcorStateLength |
|
) |
| |
|
static |
Calculate the checksum for the supplied state.
- Parameters
-
| [in] | state | The source state to generate the checksum from. |
| [in] | length | Length of the supplied state to checksum. |
- Returns
- The checksum value.
◆ calibrate()
| int8_t IRAmcorAc::calibrate |
( |
void |
| ) |
|
|
inline |
Run the calibration to calculate uSec timing offsets for this platform.
- Returns
- The uSec timing offset needed per modulation of the IR Led.
- Note
- This will produce a 65ms IR signal pulse at 38kHz. Only ever needs to be run once per object instantiation, if at all.
◆ checksum()
| void IRAmcorAc::checksum |
( |
void |
| ) |
|
|
private |
Update the checksum value for the internal state.
◆ convertFan()
Convert a stdAc::fanspeed_t enum into it's native speed.
- Parameters
-
| [in] | speed | The enum to be converted. |
- Returns
- The native equivalent of the enum.
◆ convertMode()
Convert a stdAc::opmode_t enum into its native mode.
- Parameters
-
| [in] | mode | The enum to be converted. |
- Returns
- The native equivalent of the enum.
◆ getFan()
| uint8_t IRAmcorAc::getFan |
( |
void |
| ) |
const |
Get the current fan speed setting.
- Returns
- The current fan speed.
◆ getMax()
| bool IRAmcorAc::getMax |
( |
void |
| ) |
const |
Is the Maximum Cooling or Heating setting (i.e. Turbo) setting on?
- Returns
- The current value.
◆ getMode()
| uint8_t IRAmcorAc::getMode |
( |
void |
| ) |
const |
Get the current operation mode setting.
- Returns
- The current operation mode.
◆ getPower()
| bool IRAmcorAc::getPower |
( |
void |
| ) |
const |
Get the power setting from the internal state.
- Returns
- A boolean indicating the power setting.
◆ getRaw()
| uint8_t * IRAmcorAc::getRaw |
( |
void |
| ) |
|
Get the raw state of the object, suitable to be sent with the appropriate IRsend object method.
- Returns
- A PTR to the internal state.
◆ getTemp()
| uint8_t IRAmcorAc::getTemp |
( |
void |
| ) |
const |
Get the current temperature setting.
- Returns
- Get current setting for temp. in degrees celsius.
◆ off()
| void IRAmcorAc::off |
( |
void |
| ) |
|
Set the internal state to have the power off.
◆ on()
| void IRAmcorAc::on |
( |
void |
| ) |
|
Set the internal state to have the power on.
◆ send()
Send the current internal state as an IR message.
- Parameters
-
| [in] | repeat | Nr. of times the message will be repeated. |
◆ setFan()
| void IRAmcorAc::setFan |
( |
const uint8_t |
speed | ) |
|
Set the speed of the fan.
- Parameters
-
| [in] | speed | The desired setting. |
◆ setMax()
| void IRAmcorAc::setMax |
( |
const bool |
on | ) |
|
Control the current Maximum Cooling or Heating setting. (i.e. Turbo)
- Note
- Only allowed in Cool or Heat mode.
- Parameters
-
| [in] | on | The desired setting. |
◆ setMode()
| void IRAmcorAc::setMode |
( |
const uint8_t |
mode | ) |
|
Set the desired operation mode.
- Parameters
-
| [in] | mode | The desired operation mode. |
◆ setPower()
| void IRAmcorAc::setPower |
( |
const bool |
on | ) |
|
Set the internal state to have the desired power.
- Parameters
-
| [in] | on | The desired power state. |
◆ setRaw()
| void IRAmcorAc::setRaw |
( |
const uint8_t |
state[] | ) |
|
Set the raw state of the object.
- Parameters
-
| [in] | state | The raw state from the native IR message. |
◆ setTemp()
| void IRAmcorAc::setTemp |
( |
const uint8_t |
degrees | ) |
|
Set the temperature.
- Parameters
-
| [in] | degrees | The temperature in degrees celsius. |
◆ stateReset()
| void IRAmcorAc::stateReset |
( |
void |
| ) |
|
Reset the internals of the object to a known good state.
◆ toCommon()
Convert the current internal state into its stdAc::state_t equivalent.
- Returns
- The stdAc equivalent of the native settings.
◆ toCommonFanSpeed()
Convert a native fan speed into its stdAc equivalent.
- Parameters
-
| [in] | speed | The native setting to be converted. |
- Returns
- The stdAc equivalent of the native setting.
◆ toCommonMode()
Convert a native mode into its stdAc equivalent.
- Parameters
-
| [in] | mode | The native setting to be converted. |
- Returns
- The stdAc equivalent of the native setting.
◆ toString()
| String IRAmcorAc::toString |
( |
void |
| ) |
const |
Convert the current internal state into a human readable string.
- Returns
- A human readable string.
◆ validChecksum()
| bool IRAmcorAc::validChecksum |
( |
const uint8_t |
state[], |
|
|
const uint16_t |
length = kAmcorStateLength |
|
) |
| |
|
static |
Verify the checksum is valid for a given state.
- Parameters
-
| [in] | state | The array to verify the checksum of. |
| [in] | length | The size of the state. |
- Returns
- A boolean indicating if it's checksum is valid.
◆ _irsend
The documentation for this class was generated from the following files: