AIROC™ BTSDK v4.9 - Documentation | ||||
Data Structures | |
struct | KeyscanQueueState |
Keyscan circular event queue state. More... | |
Typedefs | |
struct { | |
BYTE keyCode | |
Key code. More... | |
BYTE reserved: 6 | |
Reserved bits. | |
BYTE upDownFlag: 1 | |
Up/down flag. | |
BYTE scanCycleFlag: 1 | |
Should be toggled for every scan cycle in which a new event is queued. More... | |
} | KeyEvent |
Definition of a key event. | |
Enumerations | |
enum | { KEY_DOWN = 0x0, KEY_UP = 0x1 } |
Defines a keyscan driver. More... | |
enum | { ROLLOVER = 0xff, END_OF_SCAN_CYCLE = 0xfe } |
Special event codes used internally by the driver. More... | |
enum | { MIA_KEY_EVENT_FIFO_SIZE = 20, KEYSCAN_FW_FIFO_SIZE = (2*MIA_KEY_EVENT_FIFO_SIZE + 6) } |
Keyscan driver constants. More... | |
Functions | |
void | ksq_init (void *buffer, BYTE elementSize, BYTE maxElements) |
Initialize the keyscan queue. More... | |
void | ksq_flush (void) |
Flush all elements from the keyscan queue. | |
BYTE | ksq_getCurNumElements (void) |
Get the number of elements currently in the queue. More... | |
BOOL32 | ksq_putExcludeOverflowSlot (void *elm, BYTE len) |
Add the given element (by copying into) to the queue, leaving one slot for an overflow indicator. More... | |
BOOL32 | ksq_putIncludeOverflowSlot (void *elm, BYTE len) |
Add the given element (by copying into) to the queue. More... | |
void * | ksq_getCurElmPtr (void) |
Get element at the front of the queue. More... | |
void | ksq_removeCurElement (void) |
Remove the element at the front of the queue. | |
BOOL32 | ksq_put (void *elm, BYTE len) |
Puts an element into the queue. More... | |
void | ksq_markCurrentEventForRollBack (void) |
Mark current events to save them when an atomic add is required. More... | |
void | ksq_rollbackUptoMarkedEvents (void) |
Rollback to marked item on error when using atomic adds. | |
void | ksq_putEvent (KeyEvent *event) |
Put a key event into the keyscan data queue. More... | |
void | ksq_getEvent (KeyEvent *event) |
Copy over the keyscan event at the front of the queue and delete from the queue. More... | |
INLINE BOOLEAN | ksq_isEmpty (void) |
Check if the KeyscanQueue is empty. More... | |
anonymous enum |
Defines a keyscan driver.
The keyscan interface is practically defined as a queue from the consumer's perspective. Key up/down events are seen as a stream coming from the driver. In addition the interface provides the user with the ability to reset the HW as well as turn keyscanning on/off.Up/down flag
anonymous enum |
anonymous enum |
void* ksq_getCurElmPtr | ( | void | ) |
Get element at the front of the queue.
BYTE ksq_getCurNumElements | ( | void | ) |
Get the number of elements currently in the queue.
void ksq_getEvent | ( | KeyEvent * | event | ) |
Copy over the keyscan event at the front of the queue and delete from the queue.
event | The buffer into which to copy the event at the head. |
void ksq_init | ( | void * | buffer, |
BYTE | elementSize, | ||
BYTE | maxElements | ||
) |
Initialize the keyscan queue.
buffer | Pointer to a permanently allocated buffer that will be used as the storage area for the circular queue. Use cfa_mm_Sbrk() to allocate in app create. |
elementSize | The max size of each element in the allocated keyscan queue. |
maxElements | The maximum number of elements that can fit in the allocated queue. |
INLINE BOOLEAN ksq_isEmpty | ( | void | ) |
Check if the KeyscanQueue is empty.
void ksq_markCurrentEventForRollBack | ( | void | ) |
Mark current events to save them when an atomic add is required.
This is useful for rolling back what we added in case we encounter errors.
BOOL32 ksq_put | ( | void * | elm, |
BYTE | len | ||
) |
Puts an element into the queue.
Does not perform any bound checking.
elm | pointer to the element. |
len | number of bytes in element. This number of bytes is copied into the internal storage of the queue. This must be <= the maximum element size specified when the queue was initialized, otherwise the results are undefined. |
void ksq_putEvent | ( | KeyEvent * | event | ) |
Put a key event into the keyscan data queue.
event | Pointer to the event that is to be added to the end of the queue. |
BOOL32 ksq_putExcludeOverflowSlot | ( | void * | elm, |
BYTE | len | ||
) |
Add the given element (by copying into) to the queue, leaving one slot for an overflow indicator.
elm | Pointer to the buffer that contains the data to be added to the queue. |
len | Length of the element being added (can be < max size). |
BOOL32 ksq_putIncludeOverflowSlot | ( | void * | elm, |
BYTE | len | ||
) |
Add the given element (by copying into) to the queue.
elm | Pointer to the buffer that contains the data to be added to the queue. |
len | Length of the element being added (can be < max size). |