Rev 2443 | Rev 2468 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2443 | Rev 2466 | ||
---|---|---|---|
Line 5... | Line 5... | ||
5 | #include <inttypes.h> |
5 | #include <inttypes.h> |
6 | 6 | ||
7 | #define TWI_STATE_MOTOR_TX 0 |
7 | #define TWI_STATE_MOTOR_TX 0 |
Line 8... | Line 8... | ||
8 | #define TWI_STATE_MOTOR_RX 5 |
8 | #define TWI_STATE_MOTOR_RX 5 |
9 | //#define TWI_STATE_GYRO_OFFSET_TX 18 |
9 | //#define TWI_STATE_GYRO_OFFSET_TX 18 |
10 | 10 | ||
11 | extern volatile uint8_t twi_state; |
11 | extern volatile uint8_t twi_state, ReadBlSize; |
12 | extern volatile uint8_t motor_write; |
12 | extern volatile uint8_t motor_write; |
13 | extern volatile uint8_t motor_read; |
13 | extern volatile uint8_t motor_read; |
Line 40... | Line 40... | ||
40 | uint8_t State; // 7 bit for I2C error counter, highest bit indicates if motor is present |
40 | uint8_t State; // 7 bit for I2C error counter, highest bit indicates if motor is present |
41 | uint8_t ReadMode; // select data to read |
41 | uint8_t ReadMode; // select data to read |
42 | // the following bytes must be exactly in that order! |
42 | // the following bytes must be exactly in that order! |
43 | uint8_t Current; // in 0.1 A steps, read back from BL |
43 | uint8_t Current; // in 0.1 A steps, read back from BL |
44 | uint8_t MaxPWM; // read back from BL -> is less than 255 if BL is in current limit, not running (250) or starting (40) |
44 | uint8_t MaxPWM; // read back from BL -> is less than 255 if BL is in current limit, not running (250) or starting (40) |
- | 45 | int8_t Temperature; // old BL-Ctrl will return a 255 here, the new version the temp. in °C |
|
- | 46 | int8_t reserved1; // voltage (BL3) or rpm (BL2) |
|
- | 47 | int8_t reserved2; // 0 (BL3) or mAh (BL2) |
|
- | 48 | int8_t Voltage; // in 0.1V (BL3 is limited to 255, BL2 is only low-byte) |
|
- | 49 | int8_t SlaveI2cError; // BL2 & BL3 |
|
- | 50 | int8_t VersionMajor; // BL2 & BL3 |
|
45 | int8_t Temperature; // old BL-Ctrl will return a 255 here, the new version the temp. in °C |
51 | int8_t VersionMinor; // BL2 & BL3 |
46 | uint8_t NotReadyCnt; // Counts up is the Motor is not ready during flight -> MotorRestart etc. |
52 | uint8_t NotReadyCnt; // Counts up is the Motor is not ready during flight -> MotorRestart etc. |
Line 47... | Line 53... | ||
47 | } __attribute__((packed)) MotorData_t; |
53 | } __attribute__((packed)) MotorData_t; |