31#include "freertos/FreeRTOS.h"
32#include "freertos/semphr.h"
88 bool lock(
int timeOutMS);
99 bool CLKTimeOutError();
109 bool sendCommand(uint8_t cmd, uint8_t expectedReply);
132 uint16_t deviceID() {
return m_deviceID; }
140 void quickCheckHardware();
142 void begin(
int PS2Port);
145 int getData(
int timeOutMS);
147 void requestToResendLastByte();
149 bool send_cmdLEDs(
bool numLock,
bool capsLock,
bool scrollLock);
151 bool send_cmdGetScancodeSet(uint8_t * result);
152 bool send_cmdSetScancodeSet(uint8_t scancodeSet);
154 bool send_cmdDisableScanning();
155 bool send_cmdEnableScanning();
156 bool send_cmdTypematicRateAndDelay(
int repeatRateMS,
int repeatDelayMS);
157 bool send_cmdSetSampleRate(
int sampleRate);
158 bool send_cmdSetDefaultParams();
159 bool send_cmdReset();
160 bool send_cmdSetResolution(
int resolution);
161 bool send_cmdSetScaling(
int scaling);
166 int16_t m_cmdTimeOut;
167 int16_t m_cmdSubTimeOut;
173struct PS2DeviceLock {
174 PS2DeviceLock(PS2Device * PS2Device) : m_PS2Device(PS2Device) { m_PS2Device->lock(-1); }
175 ~PS2DeviceLock() { m_PS2Device->unlock(); }
177 PS2Device * m_PS2Device;
bool sendCommand(uint8_t cmd, uint8_t expectedReply)
Sends a raw command to the PS/2 device and wait for reply.
void unlock()
Releases device from exclusive access.
bool lock(int timeOutMS)
Gets exclusive access to the device.
void suspendPort()
Suspends PS/2 port driving the CLK line Low.
PS2DeviceType identify()
Identifies the device attached to the PS2 port.
void resumePort()
Resumes PS/2 port releasing CLK line.
Base class for PS2 devices (like mouse or keyboard).
This file contains FabGL library configuration settings, like number of supported colors,...
PS2DeviceType
Represents the type of device attached to PS/2 port.
@ MF2KeyboardWithTranslation
This file contains fabgl::PS2Controller definition.