-
Notifications
You must be signed in to change notification settings - Fork 1
/
tools.h
39 lines (26 loc) · 1.51 KB
/
tools.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
#ifndef PARROT_ESP_TOOLS_H
#define PARROT_ESP_TOOLS_H
#include <Arduino.h>
#include "parrot_esp.h"
/*
* Some commodity tools needed here and there. Buffer byte formatting for now.
*
* TODO: incrementing the buffer from within the tool doesn't seem to work, it should be supressed.
*/
void tools_int16tToBuffer(int16_t value, uint8_t* buffer, bool incBuffer = false);
void tools_uint16tToBuffer(uint16_t value, uint8_t* buffer, bool incBuffer = false);
void tools_int32tToBuffer(int32_t value, uint8_t* buffer, bool incBuffer = false);
void tools_uint32tToBuffer(uint32_t value, uint8_t* buffer, bool incBuffer = false);
void tools_int64tToBuffer(int64_t value, uint8_t* buffer, bool incBuffer = false);
void tools_uint64tToBuffer(uint64_t value, uint8_t* buffer, bool incBuffer = false);
void tools_floatToBuffer(float value, uint8_t* buffer, bool incBuffer = false);
void tools_doubleToBuffer(double value, uint8_t* buffer, bool incBuffer = false);
int16_t tools_bufferToInt16t(uint8_t* buffer, bool incBuffer = false);
uint16_t tools_bufferToUint16t(uint8_t* buffer, bool incBuffer = false);
int32_t tools_bufferToInt32t(uint8_t* buffer, bool incBuffer = false);
uint32_t tools_bufferToUint32t(uint8_t* buffer, bool incBuffer = false);
int64_t tools_bufferToInt64t(uint8_t* buffer, bool incBuffer = false);
uint64_t tools_bufferToUint64t(uint8_t* buffer, bool incBuffer = false);
float tools_bufferToFloat(uint8_t* buffer, bool incBuffer = false);
double tools_bufferToDouble(uint8_t* buffer, bool incBuffer = false);
#endif