27 #include "freertos/FreeRTOS.h" 28 #include "freertos/semphr.h" 86 bool lock(
int timeOutMS);
98 void begin(
int PS2Port);
101 int getData(
int timeOutMS);
103 void requestToResendLastByte();
105 bool sendCommand(uint8_t cmd, uint8_t expectedReply);
107 bool send_cmdLEDs(
bool numLock,
bool capsLock,
bool scrollLock);
109 bool send_cmdGetScancodeSet(uint8_t * result);
110 bool send_cmdSetScancodeSet(uint8_t scancodeSet);
111 bool send_cmdIdentify(
PS2Device * result);
112 bool send_cmdDisableScanning();
113 bool send_cmdEnableScanning();
114 bool send_cmdTypematicRateAndDelay(
int repeatRateMS,
int repeatDelayMS);
115 bool send_cmdSetSampleRate(
int sampleRate);
116 bool send_cmdSetDefaultParams();
117 bool send_cmdReset();
118 bool send_cmdSetResolution(
int resolution);
119 bool send_cmdSetScaling(
int scaling);
124 SemaphoreHandle_t m_deviceLock;
129 struct PS2DeviceLock {
130 PS2DeviceLock(PS2DeviceClass *
PS2Device) : m_PS2Device(
PS2Device) { m_PS2Device->lock(-1); }
131 ~PS2DeviceLock() { m_PS2Device->unlock(); }
133 PS2DeviceClass * m_PS2Device;
bool lock(int timeOutMS)
Gets exclusive access to the device.
Definition: ps2device.cpp:78
Definition: ps2device.h:54
This file contains fabgl::PS2ControllerClass definition and the PS2Controller instance.
Definition: ps2device.h:55
Definition: ps2device.h:50
Definition: ps2device.h:53
Definition: ps2device.h:49
Definition: canvas.cpp:47
PS2Device identify()
Identifies the device attached to the PS2 port.
Definition: ps2device.h:77
void unlock()
Releases device from exclusive access.
Definition: ps2device.cpp:84
This file contains FabGL library configuration settings, like number of supported colors...
Definition: ps2device.h:51
Base class for PS2 devices (like mouse or keyboard).
Definition: ps2device.h:68
Definition: ps2device.h:52
PS2Device
Represents the type of device attached to PS/2 port.
Definition: ps2device.h:48