roverSTM  UM2 2013
Projet M1 Navarro Benjamin
 All Classes Files Functions Groups Pages
MyLib.h
1 /*
2  * MyLib.h
3  *
4  * Created on: 9 fŽvr. 2013
5  * Author: Benjamin Navrro
6  */
7 
8 #ifndef MYLIB_H_
9 #define MYLIB_H_
10 
11 typedef union ushortbytes {
12  uint16_t value;
13  uint8_t bytes[2];
14 } ushortbytes;
15 
16 typedef union ulongbytes {
17  uint32_t value;
18  uint8_t bytes[4];
19 } ulongbytes;
20 
21 typedef union floatbytes {
22  float value;
23  uint8_t bytes[4];
24 } floatbytes;
25 
26 typedef union doublebytes {
27  float value;
28  uint8_t bytes[8];
29 } doublebytes;
30 
31 typedef union shortbytes {
32  int16_t value;
33  uint8_t bytes[2];
34 } shortbytes;
35 
36 typedef union longbytes {
37  int32_t value;
38  uint8_t bytes[4];
39 } longbytes;
40 
41 typedef struct {
42  int16_t x;
43  int16_t y;
44  int16_t z;
45 } int16x3;
46 
47 typedef struct {
48  float x;
49  float y;
50  float z;
51 } floatx3;
52 
53 typedef struct {
54  float roll_r;
55  float pitch_r;
56  float roll_d;
57  float pitch_d;
58 } rollpitch;
59 
60 #include "I2CDevice.h"
61 #include "HMC5883L.h"
62 #include "ADXL345.h"
63 #include "UltrasonicSensor.h"
64 #include "DiscoveryLED.h"
65 
66 #endif /* MYLIB_H_ */