Brian Silverman | f92396c | 2013-09-12 20:13:13 -0700 | [diff] [blame^] | 1 | // This isn't really a header file. It's designed to be #included directly into |
| 2 | // other code (possibly in a namespace or whatever), so it doesn't have include |
| 3 | // guards. |
| 4 | // In the gyro board code, fill_packet.h #includes this file. |
| 5 | // In the fitpc code, frc971/input/gyro_board_data.h #includes this file. |
| 6 | |
| 7 | #pragma pack(push, 1) |
| 8 | struct DATA_STRUCT_NAME { |
| 9 | int64_t gyro_angle; |
| 10 | |
| 11 | union { |
| 12 | struct { |
| 13 | // Which robot (+version) the gyro board is sending out data for. |
| 14 | // We should keep this in the same place for all gyro board software |
| 15 | // versions so that the fitpc can detect when it's reading from a gyro |
| 16 | // board set up for a different robot than it is. |
| 17 | // 0 = 2013 competition/practice robot |
| 18 | // 1 = 2013 3rd robot |
| 19 | uint8_t robot_id; |
| 20 | // This information should also be kept in the same place from year to |
| 21 | // year so that the fitpc code can record the dip switch values when it |
| 22 | // detects the wrong robot id to make debugging easier. |
| 23 | union { |
| 24 | struct { |
| 25 | uint8_t dip_switch0 : 1; |
| 26 | uint8_t dip_switch1 : 1; |
| 27 | uint8_t dip_switch2 : 1; |
| 28 | uint8_t dip_switch3 : 1; |
| 29 | }; |
| 30 | uint8_t dip_switches; |
| 31 | }; |
| 32 | }; |
| 33 | uint16_t header; |
| 34 | }; |
| 35 | |
| 36 | union { |
| 37 | struct { |
| 38 | union { |
| 39 | struct { |
| 40 | uint8_t wrist_hall_effect : 1; |
| 41 | uint8_t angle_adjust_bottom_hall_effect : 1; |
| 42 | uint8_t top_disc : 1; |
| 43 | uint8_t bottom_disc : 1; |
| 44 | }; |
| 45 | uint16_t booleans; |
| 46 | }; |
| 47 | int32_t left_drive; |
| 48 | int32_t right_drive; |
| 49 | int32_t shooter_angle; |
| 50 | int32_t shooter; |
| 51 | int32_t indexer; |
| 52 | int32_t wrist; |
| 53 | |
| 54 | int32_t capture_top_rise; |
| 55 | int32_t capture_top_fall; |
| 56 | int32_t capture_bottom_fall_delay; |
| 57 | int32_t capture_wrist_rise; |
| 58 | int32_t capture_shooter_angle_rise; |
| 59 | |
| 60 | int8_t top_rise_count; |
| 61 | |
| 62 | int8_t top_fall_count; |
| 63 | |
| 64 | int8_t bottom_rise_count; |
| 65 | |
| 66 | int8_t bottom_fall_delay_count; |
| 67 | int8_t bottom_fall_count; |
| 68 | |
| 69 | int8_t wrist_rise_count; |
| 70 | |
| 71 | int8_t shooter_angle_rise_count; |
| 72 | } main; |
| 73 | |
| 74 | struct { |
| 75 | union { |
| 76 | struct { |
| 77 | }; |
| 78 | uint16_t booleans; |
| 79 | }; |
| 80 | } bot3; |
| 81 | }; |
| 82 | }; |
| 83 | #pragma pack(pop) |