ArduSat API
 All Classes Files Functions Variables Enumerations Enumerator Macros Pages
I2C_Conv.h
Go to the documentation of this file.
1 //==================================================
2 // I2C_Conv.h
3 //
4 // break up and reconstitute Float into Bytes
5 // for sending over I2C
6 //
7 // writen by pplatzer & jcappaert 2012
8 // (c) nanosatisfi 2012
9 //
10 // v1.0 August 2012
11 //==================================================
12 
13 #ifndef I2C_Conv_h
14 #define I2C_Conv_h
15 
16 #include <Arduino.h>
17 
18 /* conversion for floats (uint32_t) */
19 int Float2Byte(float usrData, byte usrBytes[]);
20 int Byte2Float(float &resultValue, byte usrBytes[]);
21 
22 /* conversion for ints (uint_16_t) */
23 int Int2Byte(int usrData, byte usrBytes[]);
24 int Byte2Int(int &resultValue, byte usrBytes[]);
25 
26 /* conversion for longs (uint32_t) */
27 int Long2Byte(long usrData, byte usrBytes[]);
28 int Byte2Long(long &resultValue, byte usrBytes[]);
29 
30 /* Fletcher's checksum encode/decode */
31 //void fletcher_encode(byte buffer[], long count );
32 //long fletcher_decode(byte buffer[], long count );
33 
34 #endif
35