-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathLeptonThread.h
More file actions
59 lines (47 loc) · 1.13 KB
/
LeptonThread.h
File metadata and controls
59 lines (47 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// Engineer: Thomas Reaney
// College: National University of Ireland Galway
// Date: 20/02/2017
#ifndef LEPTONTHREAD
#define LEPTONTHREAD
#include <stdint.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <getopt.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <linux/types.h>
#include <linux/spi/spidev.h>
#include <QThread>
#include <QDebug>
#include <QVector>
class LeptonThread : public QThread
{
Q_OBJECT
QVector<unsigned char> result;
QVector<unsigned short> rawData;
static const char *device;
static unsigned char mode, bits;
static unsigned int speed;
static unsigned short delay;
static QVector<unsigned char> tx;
int fd;
struct spi_ioc_transfer _tr;
bool initLepton();
int getPacket(int iRow, unsigned char *packetData);
public:
enum
{
FrameWidth = 80,
FrameHeight = 60,
RowPacketWords = FrameWidth + 2,
RowPacketBytes = 2*RowPacketWords,
FrameWords = FrameWidth*FrameHeight
};
LeptonThread();
~LeptonThread();
void run();
signals:
void updateImage(unsigned short *, int, int);
};
#endif