27 #include "freertos/FreeRTOS.h" 28 #include "freertos/semphr.h" 84 bool lock(
int timeOutMS);
98 void quickCheckHardware();
100 void begin(
int PS2Port);
103 int getData(
int timeOutMS);
105 void requestToResendLastByte();
107 bool sendCommand(uint8_t cmd, uint8_t expectedReply);
109 bool send_cmdLEDs(
bool numLock,
bool capsLock,
bool scrollLock);
111 bool send_cmdGetScancodeSet(uint8_t * result);
112 bool send_cmdSetScancodeSet(uint8_t scancodeSet);
114 bool send_cmdDisableScanning();
115 bool send_cmdEnableScanning();
116 bool send_cmdTypematicRateAndDelay(
int repeatRateMS,
int repeatDelayMS);
117 bool send_cmdSetSampleRate(
int sampleRate);
118 bool send_cmdSetDefaultParams();
119 bool send_cmdReset();
120 bool send_cmdSetResolution(
int resolution);
121 bool send_cmdSetScaling(
int scaling);
125 SemaphoreHandle_t m_deviceLock;
127 int16_t m_retryCount;
128 int16_t m_cmdTimeOut;
129 int16_t m_cmdSubTimeOut;
134 struct PS2DeviceLock {
135 PS2DeviceLock(PS2Device * PS2Device) : m_PS2Device(PS2Device) { m_PS2Device->lock(-1); }
136 ~PS2DeviceLock() { m_PS2Device->unlock(); }
138 PS2Device * m_PS2Device;
This file contains fabgl::PS2Controller definition.
bool lock(int timeOutMS)
Gets exclusive access to the device.
PS2DeviceType
Represents the type of device attached to PS/2 port.
PS2DeviceType identify()
Identifies the device attached to the PS2 port.
Base class for PS2 devices (like mouse or keyboard).
This file contains FabGL library configuration settings, like number of supported colors...
void unlock()
Releases device from exclusive access.