LispBM
buffer.h
Go to the documentation of this file.
1 /*
2  Copyright 2016 Benjamin Vedder benjamin@vedder.se
3 
4  This file is part of the VESC firmware.
5 
6  The VESC firmware is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  The VESC firmware is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef BUFFER_H_
21 #define BUFFER_H_
22 
23 #include <stdint.h>
24 
25 void buffer_append_int16(uint8_t* buffer, int16_t number, int32_t *index);
26 void buffer_append_uint16(uint8_t* buffer, uint16_t number, int32_t *index);
27 void buffer_append_int32(uint8_t* buffer, int32_t number, int32_t *index);
28 void buffer_append_uint32(uint8_t* buffer, uint32_t number, int32_t *index);
29 void buffer_append_int64(uint8_t* buffer, int64_t number, int32_t *index);
30 void buffer_append_uint64(uint8_t* buffer, uint64_t number, int32_t *index);
31 void buffer_append_float16(uint8_t* buffer, float number, float scale, int32_t *index);
32 void buffer_append_float32(uint8_t* buffer, float number, float scale, int32_t *index);
33 void buffer_append_double64(uint8_t* buffer, double number, double scale, int32_t *index);
34 void buffer_append_float32_auto(uint8_t* buffer, float number, int32_t *index);
35 void buffer_append_float64_auto(uint8_t* buffer, double number, int32_t *index);
36 
37 int16_t buffer_get_int16(const uint8_t *buffer, int32_t *index);
38 uint16_t buffer_get_uint16(const uint8_t *buffer, int32_t *index);
39 int32_t buffer_get_int32(const uint8_t *buffer, int32_t *index);
40 uint32_t buffer_get_uint32(const uint8_t *buffer, int32_t *index);
41 int64_t buffer_get_int64(const uint8_t *buffer, int32_t *index);
42 uint64_t buffer_get_uint64(const uint8_t *buffer, int32_t *index);
43 float buffer_get_float16(const uint8_t *buffer, float scale, int32_t *index);
44 float buffer_get_float32(const uint8_t *buffer, float scale, int32_t *index);
45 double buffer_get_double64(const uint8_t *buffer, double scale, int32_t *index);
46 float buffer_get_float32_auto(const uint8_t *buffer, int32_t *index);
47 double buffer_get_float64_auto(const uint8_t *buffer, int32_t *index);
48 
49 #endif /* BUFFER_H_ */
int16_t buffer_get_int16(const uint8_t *buffer, int32_t *index)
Definition: buffer.c:155
void buffer_append_int64(uint8_t *buffer, int64_t number, int32_t *index)
Definition: buffer.c:48
uint16_t buffer_get_uint16(const uint8_t *buffer, int32_t *index)
Definition: buffer.c:162
void buffer_append_int32(uint8_t *buffer, int32_t number, int32_t *index)
Definition: buffer.c:34
uint32_t buffer_get_uint32(const uint8_t *buffer, int32_t *index)
Definition: buffer.c:178
double buffer_get_double64(const uint8_t *buffer, double scale, int32_t *index)
Definition: buffer.c:221
int64_t buffer_get_int64(const uint8_t *buffer, int32_t *index)
Definition: buffer.c:187
float buffer_get_float32_auto(const uint8_t *buffer, int32_t *index)
Definition: buffer.c:225
void buffer_append_int16(uint8_t *buffer, int16_t number, int32_t *index)
Definition: buffer.c:24
float buffer_get_float16(const uint8_t *buffer, float scale, int32_t *index)
Definition: buffer.c:213
float buffer_get_float32(const uint8_t *buffer, float scale, int32_t *index)
Definition: buffer.c:217
void buffer_append_uint16(uint8_t *buffer, uint16_t number, int32_t *index)
Definition: buffer.c:29
void buffer_append_float32_auto(uint8_t *buffer, float number, int32_t *index)
Definition: buffer.c:123
void buffer_append_uint64(uint8_t *buffer, uint64_t number, int32_t *index)
Definition: buffer.c:59
void buffer_append_uint32(uint8_t *buffer, uint32_t number, int32_t *index)
Definition: buffer.c:41
uint64_t buffer_get_uint64(const uint8_t *buffer, int32_t *index)
Definition: buffer.c:200
void buffer_append_double64(uint8_t *buffer, double number, double scale, int32_t *index)
Definition: buffer.c:79
void buffer_append_float16(uint8_t *buffer, float number, float scale, int32_t *index)
Definition: buffer.c:71
void buffer_append_float32(uint8_t *buffer, float number, float scale, int32_t *index)
Definition: buffer.c:75
int32_t buffer_get_int32(const uint8_t *buffer, int32_t *index)
Definition: buffer.c:169
double buffer_get_float64_auto(const uint8_t *buffer, int32_t *index)
Definition: buffer.c:245
void buffer_append_float64_auto(uint8_t *buffer, double number, int32_t *index)
Definition: buffer.c:148