Alejandro Ungria Hirte / GA-Test_copy

Dependencies:   mbed-dev

Committer:
aungriah
Date:
Wed Dec 06 21:35:45 2017 +0000
Revision:
0:a3b83d366423
test

Who changed what in which revision?

UserRevisionLine numberNew contents of line
aungriah 0:a3b83d366423 1 // Lukas Bieri, Matthias, Manuel Meier & Noa Melchior
aungriah 0:a3b83d366423 2 // based on Work by Matthias Grob & Manuel Stalder
aungriah 0:a3b83d366423 3 // ETH 2017
aungriah 0:a3b83d366423 4
aungriah 0:a3b83d366423 5 #ifndef _FRAMES_H
aungriah 0:a3b83d366423 6 #define _FRAMES_H
aungriah 0:a3b83d366423 7
aungriah 0:a3b83d366423 8 //the packed attribute makes sure the types only use their respective size in memory (8 bit for uint8_t), otherwise they would always use 32 bit
aungriah 0:a3b83d366423 9 //IT IS A GCC SPECIFIC DIRECTIVE
aungriah 0:a3b83d366423 10 struct __attribute__((packed, aligned(1))) RangingFrame {
aungriah 0:a3b83d366423 11 uint8_t source;
aungriah 0:a3b83d366423 12 uint8_t destination;
aungriah 0:a3b83d366423 13 uint8_t type;
aungriah 0:a3b83d366423 14 };
aungriah 0:a3b83d366423 15
aungriah 0:a3b83d366423 16 struct __attribute__((packed, aligned(1))) ExtendedRangingFrame : RangingFrame{
aungriah 0:a3b83d366423 17 int signedTime;
aungriah 0:a3b83d366423 18 };
aungriah 0:a3b83d366423 19
aungriah 0:a3b83d366423 20 struct __attribute__((packed, aligned(1))) StreamFrame : RangingFrame{
aungriah 0:a3b83d366423 21 uint8_t anchor_adress;
aungriah 0:a3b83d366423 22 float distance;
aungriah 0:a3b83d366423 23 float signalStrength;
aungriah 0:a3b83d366423 24 float FPLevel;
aungriah 0:a3b83d366423 25 };
aungriah 0:a3b83d366423 26
aungriah 0:a3b83d366423 27 #endif /* _FRAMES_H */