34 #include "freertos/FreeRTOS.h" 35 #include "freertos/task.h" 97 void begin(gpio_num_t port0_clkGPIO, gpio_num_t port0_datGPIO, gpio_num_t port1_clkGPIO = GPIO_UNUSED, gpio_num_t port1_datGPIO = GPIO_UNUSED);
125 bool waitData(
int timeOutMS,
int PS2Port);
171 void setKeyboard(
Keyboard * value) { m_keyboard = value; }
180 void setMouse(
Mouse * value) { m_mouse = value; }
191 bool parityError(
int PS2Port) {
return m_parityError[PS2Port]; }
195 static void IRAM_ATTR rtc_isr(
void * arg);
197 static PS2Controller * s_instance;
201 Keyboard * m_keyboard;
205 volatile int m_readPos[2];
208 volatile TaskHandle_t m_TXWaitTask[2];
211 volatile TaskHandle_t m_RXWaitTask[2];
213 intr_handle_t m_isrHandle;
215 int16_t m_suspendCount;
218 bool m_parityError[2];
int dataAvailable(int PS2Port)
Gets the number of scancodes available in the controller buffer.
Keyboard * keyboard()
Returns the instance of Keyboard object automatically created by PS2Controller.
void injectInRXBuffer(int value, int PS2Port)
Injects a byte into the RX buffer.
The PS2 Keyboard controller class.
void sendData(uint8_t data, int PS2Port)
Sends a command to the device.
This file contains some utility classes and functions.
static PS2Controller * instance()
Returns the singleton instance of PS2Controller class.
KbdMode
This enum defines how handle keyboard virtual keys.
This file contains FabGL library configuration settings, like number of supported colors...
The PS2 device controller class.
int getData(int PS2Port)
Gets a scancode from the queue.
void suspend()
Suspends PS/2 ports operations.
PS2Preset
This enum defines what is connected to PS/2 ports.
The PS2 Mouse controller class.
Mouse * mouse()
Returns the instance of Mouse object automatically created by PS2Controller.
void resume()
Resumes PS/2 ports operations.
void begin(gpio_num_t port0_clkGPIO, gpio_num_t port0_datGPIO, gpio_num_t port1_clkGPIO=GPIO_UNUSED, gpio_num_t port1_datGPIO=GPIO_UNUSED)
Initializes PS2 device controller.