Raspberry Pi Weighting Control System
This project serves as a simple weighting control system, that was realized as a Bachelor Thesis
Classes | Namespaces | Enumerations | Functions
keyboard.h File Reference
#include <queue>
#include <sys/time.h>
#include <stdint.h>

Go to the source code of this file.

Classes

struct  kb_event
 Structure of SPI keyboard event, Contains pressed scancode, flags and timestamp of event creation. More...
 

Namespaces

 keyboard
 

Enumerations

enum  KB_FLAGS_ { KB_FLAGS_NONE = 0x00 , KB_FLAGS_KEY_DOWN = 0x01 << 0 , KB_FLAGS_REPEATING = 0x01 << 1 , KB_FLAGS_TEST = 0x01 << 2 }
 

Functions

kb_eventkeyboard::poll_event ()
 Polls event from queue into param event Returns 1 on success because it is inteded to return "true" on successfull event pop. More...
 
void keyboard::clear_event_queue ()
 With this the event queue can be cleared but all events are discarded. This can be used if limiting the maximum number of handled events. More...
 
int keyboard::init (const char *device, uint8_t mode, uint32_t speed, uint16_t delay, uint8_t bits_per_word)
 Initializes spi_config and my_spi global variables and starts SPI. More...
 
int keyboard::init_from_conf ()
 Initializes my_spi with config loaded from config file into app_workspace. Starts SPI. More...
 
bool keyboard::get_kb_testing_inner ()
 
void keyboard::set_kb_testing_inner (bool val)
 
void keyboard::start_capturing_events ()
 Infinite loop that reads SPI keyboard. Runs in it's own thread! More...
 
void keyboard::clean ()
 Stops event capturing and closes SPI. More...
 

Enumeration Type Documentation

◆ KB_FLAGS_

enum KB_FLAGS_

Flags that can be set on an event

Enumerator
KB_FLAGS_NONE 
KB_FLAGS_KEY_DOWN 
KB_FLAGS_REPEATING 
KB_FLAGS_TEST 

Definition at line 11 of file keyboard.h.

11  {
12  KB_FLAGS_NONE = 0x00,
13  KB_FLAGS_KEY_DOWN = 0x01 << 0,
14  KB_FLAGS_REPEATING = 0x01 << 1,
15  KB_FLAGS_TEST = 0x01 << 2,
16 
17 };
@ KB_FLAGS_REPEATING
Definition: keyboard.h:14
@ KB_FLAGS_TEST
Definition: keyboard.h:15
@ KB_FLAGS_NONE
Definition: keyboard.h:12
@ KB_FLAGS_KEY_DOWN
Definition: keyboard.h:13