Raspberry Pi Weighting Control System
This project serves as a simple weighting control system, that was realized as a Bachelor Thesis
Namespaces | Macros | Functions | Variables
rfid_reader.cpp File Reference
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <queue>
#include <chrono>
#include <spdlog/spdlog.h>
#include "rfid_reader.h"
#include "rc522.h"
#include "app_workspace.h"

Go to the source code of this file.

Namespaces

 rfid_reader
 

Macros

#define REPEATING_FLAG_DELAY   500
 
#define RFID_READ_INTERVAL   100000
 

Functions

void rfid_reader::push_event (rfid_tag tag, uint8_t flags)
 
int rfid_reader::init (const char *, uint8_t, uint32_t, uint16_t, uint8_t)
 RFID reader init through values. More...
 
int rfid_reader::init_from_conf ()
 RFID reader init from loaded configuration. More...
 
void rfid_reader::print_card_serial (rfid_tag *tag)
 
void rfid_reader::start_reading_cards ()
 Loop that is run in its own thread, reading the RFID reader. More...
 
void rfid_reader::clean ()
 Stops the reading thread. More...
 
char rfid_reader::detect_tag (uint16_t *tag_type, uint8_t *buff)
 This function detects if a RFID tag was put near the reader. More...
 
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. More...
 
int rfid_reader::read_tag (rfid_tag *tag)
 This function is a loop handling the scanner. More...
 
rfid_eventrfid_reader::poll_event ()
 Polls event from RFID event_queue. More...
 
void rfid_reader::clear_event_queue ()
 Clears event queue, discarding all waiting events. More...
 

Variables

std::queue< rfid_eventrfid_reader::event_queue
 
std::mutex rfid_reader::eq_mutex
 
std::unique_ptr< spi_config_t > rfid_reader::spi_config
 
std::unique_ptr< SPI > rfid_reader::my_spi = nullptr
 
bool rfid_reader::reading_cards = true
 

Macro Definition Documentation

◆ REPEATING_FLAG_DELAY

#define REPEATING_FLAG_DELAY   500

Definition at line 11 of file rfid_reader.cpp.

◆ RFID_READ_INTERVAL

#define RFID_READ_INTERVAL   100000

Definition at line 12 of file rfid_reader.cpp.