nRF Connect SDK API 3.3.99
Loading...
Searching...
No Matches
hid_eventq.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2025 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
11#ifndef _HID_EVENTQ_H_
12#define _HID_EVENTQ_H_
13
21#ifdef __cplusplus
22extern "C" {
23#endif
24
25#include <zephyr/sys/slist.h>
26
28struct hid_eventq {
29 sys_slist_t root;
30 uint16_t cnt;
31 uint16_t cnt_max;
32};
33
42void hid_eventq_init(struct hid_eventq *q, uint16_t max_queued);
43
53bool hid_eventq_is_full(const struct hid_eventq *q);
54
64bool hid_eventq_is_empty(const struct hid_eventq *q);
65
85int hid_eventq_keypress_enqueue(struct hid_eventq *q, uint16_t id, bool pressed, bool drop_oldest);
86
99int hid_eventq_keypress_dequeue(struct hid_eventq *q, uint16_t *id, bool *pressed);
100
109
122void hid_eventq_cleanup(struct hid_eventq *q, int64_t min_timestamp);
123
124#ifdef __cplusplus
125}
126#endif
127
132#endif /*_HID_EVENTQ_H_ */
void hid_eventq_cleanup(struct hid_eventq *q, int64_t min_timestamp)
Cleanup a HID event queue object instance.
int hid_eventq_keypress_dequeue(struct hid_eventq *q, uint16_t *id, bool *pressed)
Get an enqueued keypress event from HID event queue.
void hid_eventq_reset(struct hid_eventq *q)
Reset a HID event queue object instance.
void hid_eventq_init(struct hid_eventq *q, uint16_t max_queued)
Initialize a HID event queue object instance.
int hid_eventq_keypress_enqueue(struct hid_eventq *q, uint16_t id, bool pressed, bool drop_oldest)
Enqueue a keypress event in HID event queue.
bool hid_eventq_is_empty(const struct hid_eventq *q)
Check if a HID event queue is empty.
bool hid_eventq_is_full(const struct hid_eventq *q)
Check if a HID event queue is full.
uint16_t cnt
Definition hid_eventq.h:30
uint16_t cnt_max
Definition hid_eventq.h:31
sys_slist_t root
Definition hid_eventq.h:29
Event queue structure.
Definition hid_eventq.h:28