Raspberry Pi Weighting Control System
This project serves as a simple weighting control system, that was realized as a Bachelor Thesis
|
Classes | |
struct | rfid_tag |
RFID tag structure. Stores data read from SPI. More... | |
Functions | |
void | push_event (rfid_tag tag, uint8_t flags) |
int | init (const char *, uint8_t, uint32_t, uint16_t, uint8_t) |
RFID reader init through values. More... | |
int | init_from_conf () |
RFID reader init from loaded configuration. More... | |
void | print_card_serial (rfid_tag *tag) |
void | start_reading_cards () |
Loop that is run in its own thread, reading the RFID reader. More... | |
void | clean () |
Stops the reading thread. More... | |
char | detect_tag (uint16_t *tag_type, uint8_t *buff) |
This function detects if a RFID tag was put near the reader. More... | |
char | read_tag_serialn (uint8_t *serial, uint8_t *serial_size, uint8_t *ser_ack, uint8_t *buff) |
This function reads the serial number of RIFD tag put near the reader. More... | |
int | read_tag (rfid_tag *tag) |
This function is a loop handling the scanner. More... | |
rfid_event * | poll_event () |
Polls event from RFID event_queue. More... | |
void | clear_event_queue () |
Clears event queue, discarding all waiting events. More... | |
Variables | |
std::queue< rfid_event > | event_queue |
std::mutex | eq_mutex |
std::unique_ptr< spi_config_t > | spi_config |
std::unique_ptr< SPI > | my_spi = nullptr |
bool | reading_cards = true |
void rfid_reader::clean | ( | ) |
void rfid_reader::clear_event_queue | ( | ) |
char rfid_reader::detect_tag | ( | uint16_t * | tag_type, |
uint8_t * | buff | ||
) |
This function detects if a RFID tag was put near the reader.
This function was implemented by paulvha https://github.com/paulvha/rfid-rc522.git
Definition at line 112 of file rfid_reader.cpp.
int rfid_reader::init | ( | const char * | , |
uint8_t | , | ||
uint32_t | , | ||
uint16_t | , | ||
uint8_t | |||
) |
int rfid_reader::init_from_conf | ( | ) |
RFID reader init from loaded configuration.
Definition at line 46 of file rfid_reader.cpp.
rfid_event * rfid_reader::poll_event | ( | ) |
Polls event from RFID event_queue.
Definition at line 278 of file rfid_reader.cpp.
void rfid_reader::print_card_serial | ( | rfid_tag * | tag | ) |
Definition at line 67 of file rfid_reader.cpp.
void rfid_reader::push_event | ( | rfid_tag | tag, |
uint8_t | flags | ||
) |
This function creates a RFID event and pushes it into the event queue
Definition at line 270 of file rfid_reader.cpp.
int rfid_reader::read_tag | ( | rfid_tag * | tag | ) |
This function is a loop handling the scanner.
This function was implemented by paulvha and modified by trestikp (me) https://github.com/paulvha/rfid-rc522.git
Definition at line 175 of file rfid_reader.cpp.
char rfid_reader::read_tag_serialn | ( | uint8_t * | serial, |
uint8_t * | serial_size, | ||
uint8_t * | ser_ack, | ||
uint8_t * | buff | ||
) |
This function reads the serial number of RIFD tag put near the reader.
This function was implemented by paulvha https://github.com/paulvha/rfid-rc522.git
Definition at line 123 of file rfid_reader.cpp.
void rfid_reader::start_reading_cards | ( | ) |
Loop that is run in its own thread, reading the RFID reader.
Definition at line 76 of file rfid_reader.cpp.
std::mutex rfid_reader::eq_mutex |
Definition at line 16 of file rfid_reader.cpp.
std::queue<rfid_event> rfid_reader::event_queue |
Definition at line 15 of file rfid_reader.cpp.
std::unique_ptr<SPI> rfid_reader::my_spi = nullptr |
Definition at line 19 of file rfid_reader.cpp.
bool rfid_reader::reading_cards = true |
Definition at line 20 of file rfid_reader.cpp.
std::unique_ptr<spi_config_t> rfid_reader::spi_config |
Definition at line 18 of file rfid_reader.cpp.