-
Notifications
You must be signed in to change notification settings - Fork 0
/
Lepton_Strings.h
103 lines (86 loc) · 2.35 KB
/
Lepton_Strings.h
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
/*
FLIR Lepton Camera API Code
Copyright (C) 2017 Kenth Johan Söderlind Åström
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
//size_t
#include <sys/types.h>
//uint16_t
#include <stdint.h>
//memset
#include <string.h>
//printf
#include <stdio.h>
#include <assert.h>
//Use this to print in base 2 or any base.
void Lepton_Strings_Base_Converter (int Value, char * Buffer, size_t Size, size_t Base)
{
assert (Base <= 36);
assert (Buffer != NULL);
memset (Buffer, '0', Size - 1);
char Hex [] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
size_t I = Size;
while (1)
{
if (Value == 0 || I == 0) {break;}
I = I - 1;
Buffer [I] = Hex [Value % Base];
Value = Value / Base;
}
}
char const * Lepton_Strings_Command (int Command)
{
switch (Command)
{
case Lepton_I2C_Command_AUX_Kelvin:
return "AUX_Kelvin";
case Lepton_I2C_Command_FPA_Kelvin:
return "FPA_Kelvin";
case Lepton_I2C_Command_Uptime:
return "Uptime";
case Lepton_I2C_Command_FFC_Mode_Get:
return "FFC_Mode_Get";
case Lepton_I2C_Command_FFC_Status:
return "FFC_Status";
default:
return "Unkown";
}
}
char const * Lepton_Strings_FFC_Profile (int Command)
{
switch (Command)
{
case Lepton_I2C_FFC_Profile_Manual:
return "FFC_Profile_Manual";
case Lepton_I2C_FFC_Profile_Auto:
return "FFC_Profile_Auto";
case Lepton_I2C_FFC_Profile_External:
return "FFC_Profile_External";
default:
return "Unkown";
}
}
char const * Lepton_Strings_FFC_Status (int Command)
{
switch (Command)
{
case Lepton_I2C_FFC_Ready:
return "FFC_Ready";
case Lepton_I2C_FFC_Busy:
return "FFC_Busy";
case Lepton_I2C_FFC_Average:
return "FFC_Average";
default:
return "Unkown";
}
}