Rev 1650 | Rev 1657 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1650 | Rev 1651 | ||
---|---|---|---|
Line 67... | Line 67... | ||
67 | extern MotorData_t Motor[MAX_MOTORS]; |
67 | extern MotorData_t Motor[MAX_MOTORS]; |
Line 68... | Line 68... | ||
68 | 68 | ||
69 | typedef struct |
69 | typedef struct |
70 | { |
70 | { |
71 | unsigned char SetMask; // settings mask |
71 | unsigned char SetMask; // settings mask |
72 | unsigned char PwmScaling; // maximum value of control pwm, acts like a thrust limit |
72 | unsigned char PwmScaling; // maximum value of control pwm, acts like a thrust limit |
73 | unsigned char CurrentLimit; // current limit in A |
73 | unsigned char CurrentLimit; // current limit in A |
74 | unsigned char TempLimit; // in °C |
74 | unsigned char TempLimit; // in °C |
75 | unsigned char CurrentScaling; // scaling factor for current measurement |
75 | unsigned char CurrentScaling; // scaling factor for current measurement |
76 | unsigned char BitConfig; // see defines below |
76 | unsigned char BitConfig; // see defines below |
Line 77... | Line 77... | ||
77 | } __attribute__((packed)) BLConfig_t; |
77 | } __attribute__((packed)) BLConfig_t; |
Line 78... | Line 78... | ||
78 | 78 | ||
79 | extern BLConfig_t BLConfig[MAX_MOTORS]; |
79 | extern BLConfig_t BLConfig[MAX_MOTORS]; |
80 | 80 | ||
81 | void i2c_reset(void); |
81 | void i2c_reset(void); |
82 | extern void i2c_init (void); // I2C initialisieren |
82 | extern void i2c_init (void); // I2C initialisieren |
Line 83... | Line 83... | ||
83 | extern void i2c_write_byte (char byte); // 1 Byte schreiben |
83 | extern void i2c_write_byte (char byte); // 1 Byte schreiben |
84 | extern void i2c_reset(void); |
84 | extern void i2c_reset(void); |
85 | extern void I2C_SendBLConfig(void); |
85 | extern void I2C_SendBLConfig(void); |
86 | 86 | ||
87 | #define I2C_Start() {TWCR = (1<<TWSTA) | (1<<TWEN) | (1<<TWINT) | (1<<TWIE);} |
87 | #define I2C_Start() {BLFlags &= ~BLFLAG_TX_COMPLETE; TWCR = (1<<TWSTA) | (1<<TWEN) | (1<<TWINT) | (1<<TWIE);} |