brians | 0ab60bb | 2013-01-31 02:21:51 +0000 | [diff] [blame] | 1 | #ifndef __ANALOG_H__ |
| 2 | #define __ANALOG_H__ |
| 3 | |
Austin Schuh | 63d0e9b | 2013-03-27 04:43:14 +0000 | [diff] [blame] | 4 | extern int64_t gyro_angle; |
| 5 | struct DataStruct{ |
| 6 | int64_t gyro_angle; |
| 7 | |
| 8 | int32_t right_drive; |
| 9 | int32_t left_drive; |
| 10 | int32_t shooter_angle; |
| 11 | int32_t shooter; |
| 12 | int32_t indexer; |
| 13 | int32_t wrist; |
| 14 | |
| 15 | int32_t capture_top_rise; |
| 16 | int32_t capture_top_fall; |
| 17 | int32_t capture_bottom_fall_delay; |
| 18 | int32_t capture_wrist_rise; |
| 19 | int32_t capture_shooter_angle_rise; |
| 20 | |
| 21 | int8_t top_rise_count; |
| 22 | |
| 23 | int8_t top_fall_count; |
| 24 | |
| 25 | int8_t bottom_rise_count; |
| 26 | |
| 27 | int8_t bottom_fall_delay_count; |
| 28 | int8_t bottom_fall_count; |
| 29 | |
| 30 | int8_t wrist_rise_count; |
| 31 | |
| 32 | int8_t shooter_angle_rise_count; |
| 33 | }__attribute__((__packed__)); |
| 34 | void fillSensorPacket(struct DataStruct *packet); |
| 35 | |
| 36 | |
brians | 0ab60bb | 2013-01-31 02:21:51 +0000 | [diff] [blame] | 37 | void analog_init (void); |
| 38 | int analog(int chan); |
| 39 | int digital(int chan); |
| 40 | int encoder_bits(int chan); |
| 41 | void encoder_init(void); |
| 42 | int32_t encoder_val(int chan); |
| 43 | int dip(int chan); |
| 44 | #endif // __ANALOG_H__ |