Rev 1657 | Rev 1668 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1657 | Rev 1662 | ||
---|---|---|---|
Line 36... | Line 36... | ||
36 | } __attribute__((packed)) MixerTable_t; |
36 | } __attribute__((packed)) MixerTable_t; |
Line 37... | Line 37... | ||
37 | 37 | ||
38 | extern MixerTable_t Mixer; |
38 | extern MixerTable_t Mixer; |
Line 39... | Line -... | ||
39 | extern uint8_t RequiredMotors; |
- | |
40 | - | ||
41 | #define MASK_SET_PWM_SCALING 0x01 |
- | |
42 | #define MASK_SET_CURRENT_LIMIT 0x02 |
- | |
43 | #define MASK_SET_TEMP_LIMIT 0x04 |
- | |
44 | #define MASK_SET_CURRENT_SCALING 0x08 |
- | |
45 | #define MASK_SET_BITCONFIG 0x10 |
- | |
46 | #define MASK_RESET_CAPCOUNTER 0x20 |
- | |
47 | #define MASK_SET_DEFAULT_PARAMS 0x40 |
- | |
48 | #define MASK_SET_SAVE_EEPROM 0x80 |
- | |
49 | - | ||
50 | #define BITCONF_REVERSE_ROTATION 0x01 |
- | |
51 | #define BITCONF_RES1 0x02 |
- | |
52 | #define BITCONF_RES2 0x04 |
- | |
53 | #define BITCONF_RES3 0x08 |
- | |
54 | #define BITCONF_RES4 0x10 |
- | |
55 | #define BITCONF_RES5 0x20 |
- | |
56 | #define BITCONF_RES6 0x40 |
- | |
57 | #define BITCONF_RES7 0x80 |
- | |
58 | - | ||
59 | typedef struct |
- | |
60 | { |
- | |
61 | uint8_t Revision; // must be BL_REVISION |
- | |
62 | uint8_t SetMask; // settings mask |
- | |
63 | uint8_t PwmScaling; // maximum value of control pwm, acts like a thrust limit |
- | |
64 | uint8_t CurrentLimit; // current limit in A |
- | |
65 | uint8_t TempLimit; // in °C |
- | |
66 | uint8_t CurrentScaling; // scaling factor for current measurement |
- | |
67 | uint8_t BitConfig; // see defines above |
- | |
68 | uint8_t crc; // checksum |
- | |
69 | } __attribute__((packed)) BLConfig_t; |
- | |
70 | - | ||
71 | extern BLConfig_t BLConfig[MAX_MOTORS]; |
39 | extern uint8_t RequiredMotors; |
72 | 40 | ||
73 | #define CFG_HOEHENREGELUNG 0x01 |
41 | #define CFG_HOEHENREGELUNG 0x01 |
74 | #define CFG_HOEHEN_SCHALTER 0x02 |
42 | #define CFG_HOEHEN_SCHALTER 0x02 |
75 | #define CFG_HEADING_HOLD 0x04 |
43 | #define CFG_HEADING_HOLD 0x04 |
Line 126... | Line 94... | ||
126 | #define K_POTI8 11 |
94 | #define K_POTI8 11 |
Line 127... | Line 95... | ||
127 | 95 | ||
128 | 96 | ||
129 | #define EEPARAM_REVISION 82 // is count up, if paramater stucture has changed (compatibility) |
- | |
Line 130... | Line 97... | ||
130 | #define EEMIXER_REVISION 1 // is count up, if mixer stucture has changed (compatibility) |
97 | #define EEPARAM_REVISION 82 // is count up, if paramater stucture has changed (compatibility) |
131 | #define EEBLCONFIG_REVISON 35 // is count up, if blconfig stucture has changed (compatibility to BLs!) |
98 | #define EEMIXER_REVISION 1 // is count up, if mixer stucture has changed (compatibility) |
132 | 99 | ||
133 | // values above 247 representing poti1 to poti8 |
100 | // values above 247 representing poti1 to poti8 |
Line 255... | Line 222... | ||
255 | extern void SetActiveParamSet(uint8_t setnumber); |
222 | extern void SetActiveParamSet(uint8_t setnumber); |
Line 256... | Line 223... | ||
256 | 223 | ||
257 | extern uint8_t MixerTable_ReadFromEEProm(void); |
224 | extern uint8_t MixerTable_ReadFromEEProm(void); |
Line 258... | Line -... | ||
258 | extern uint8_t MixerTable_WriteToEEProm(void); |
- | |
259 | - | ||
260 | extern uint8_t BLConfig_ReadFromEEProm(uint8_t index); |
- | |
261 | extern uint8_t BLConfig_WriteToEEProm(uint8_t index); |
- | |
262 | extern void BLConfig_SetDefault(uint8_t index); |
225 | extern uint8_t MixerTable_WriteToEEProm(void); |
263 | 226 | ||
264 | extern uint8_t GetParamByte(uint16_t param_id); |
227 | extern uint8_t GetParamByte(uint16_t param_id); |
265 | extern void SetParamByte(uint16_t param_id, uint8_t value); |
228 | extern void SetParamByte(uint16_t param_id, uint8_t value); |