|
149 | 149 |
|
150 | 150 |
|
151 | 151 | /* Alias */ |
152 | | -#define A_PHASE_UL PE8 |
153 | | -#define A_PHASE_UH PE9 |
154 | | -#define A_PHASE_VL PE10 |
155 | | -#define A_PHASE_VH PE11 |
156 | | -#define A_PHASE_WL PE12 |
157 | | -#define A_PHASE_WH PE13 |
| 152 | +#define A_PHASE_UL PE8 |
| 153 | +#define A_PHASE_UH PE9 |
| 154 | +#define A_PHASE_VL PE10 |
| 155 | +#define A_PHASE_VH PE11 |
| 156 | +#define A_PHASE_WL PE12 |
| 157 | +#define A_PHASE_WH PE13 |
158 | 158 |
|
159 | | -#define PIN_READY PE14 //Gate driver ready pin |
160 | | -#define PIN_NFAULT PE15 //Gate driver fault pin |
| 159 | +#define PIN_READY PE14 //Gate driver ready pin |
| 160 | +#define PIN_NFAULT PE15 //Gate driver fault pin |
161 | 161 | #define PIN_I2C_GD_SCL PC8 //I2C3 connected to Gate driver |
162 | 162 | #define PIN_I2C_GD_SDA PC9 //I2C3 connected to Gate driver |
163 | 163 |
|
164 | | -#define A_VBUS PC1 //Pin to sense supply voltage. Also input of COMP3 |
| 164 | +#define A_VBUS PC1 //Pin to sense supply voltage. Also input of COMP3 |
165 | 165 | #define BRAKE_RESISTOR PC2 //Brake resistor. Also output of COMP3 |
166 | | -#define BRAKE_AF 3 //Alternate function 3 |
167 | | -#define BRAKE_DAC DAC1 //DAC 1 or 3 |
| 166 | +#define BRAKE_AF 3 //Alternate function 3 |
| 167 | +#define BRAKE_DAC DAC1 //DAC 1 or 3 |
168 | 168 | #define BRAKE_DAC_CHAN DAC_CHANNEL_1 //DAC Channel 1 |
169 | | -#define BRAKE_COMP COMP3 //Use comparator 3 |
| 169 | +#define BRAKE_COMP COMP3 //Use comparator 3 |
170 | 170 | #define BRAKE_COMP_PLUS COMP_INPUT_PLUS_IO2 |
171 | 171 | #define BRAKE_COMP_MINUS COMP_INPUT_MINUS_DAC1_CH1 |
172 | 172 |
|
173 | 173 | #define VBUS_MUL_FACTOR 23 //Multiply the adc voltage read by this value to get the supply voltage |
174 | 174 |
|
175 | | -#define A_GPIO_BEMF PA10 //Pin to pull Back-emf high or low |
| 175 | +#define A_GPIO_BEMF PA10 //Pin to pull Back-emf high or low |
176 | 176 |
|
177 | | -#define A_CURRW_H PA1 //phase W and opamp 1 |
178 | | -#define A_CURRW_L PA3 |
179 | | -#define A_BEMFW PA2 |
| 177 | +#define A_CURRW_H PA1 //phase W and opamp 1 |
| 178 | +#define A_CURRW_L PA3 |
| 179 | +#define A_CURRW PA2 |
| 180 | +#define A_BEMFW PA4 |
180 | 181 |
|
181 | | -#define A_CURRU_H PA7 //phase U and opamp 2 |
182 | | -#define A_CURRU_L PA5 |
183 | | -#define A_BEMFU PA0 |
| 182 | +#define A_CURRU_H PA7 //phase U and opamp 2 |
| 183 | +#define A_CURRU_L PA5 |
| 184 | +#define A_CURRU PA6 |
| 185 | +#define A_BEMFU PA0 |
184 | 186 |
|
185 | | -#define A_CURRV_H PB0 //phase V and opamp 3 |
186 | | -#define A_CURRV_L PB2 |
187 | | -#define A_BEMFV PC4 |
| 187 | +#define A_CURRV_H PB0 //phase V and opamp 3 |
| 188 | +#define A_CURRV_L PB2 |
| 189 | +#define A_CURRV PB1 |
| 190 | +#define A_BEMFV PC4 |
188 | 191 |
|
189 | 192 | #define A_POTENTIOMETER PC0 |
190 | | -#define A_TEMPERATURE PC5 |
| 193 | +#define A_TEMPERATURE PC5 |
191 | 194 |
|
192 | 195 | #ifndef NTC_B_CONSTANT |
193 | | - #define NTC_B_CONSTANT 4250 //B = ln(R/R0)/(1/T-1/T0) |
| 196 | + #define NTC_B_CONSTANT 4250 //B = ln(R/R0)/(1/T-1/T0) |
194 | 197 | #endif |
195 | 198 | #ifndef NTC_T0 |
196 | | - #define NTC_T0 (273.15f+25)//Kelvin |
| 199 | + #define NTC_T0 (273.15f+25)//Kelvin |
197 | 200 | #endif |
198 | 201 | #ifndef NTC_DIVIDER_BALANCE |
199 | 202 | #define NTC_DIVIDER_BALANCE (22.f/100.f) //R1 (value of the other resistance in the voltage divider) over R0 (resistance of NTC at T0) |
200 | 203 | #endif |
201 | 204 |
|
202 | | -#define CAN_RX PB8 |
203 | | -#define CAN_TX PB9 |
204 | | -#define CAN_PWR PC13 //Take pin high to power on CAN transceiver |
| 205 | +#define CAN_RX PB8 |
| 206 | +#define CAN_TX PB9 |
| 207 | +#define CAN_PWR PC13 //Take pin high to power on CAN transceiver |
205 | 208 |
|
206 | | -#define SWDIO PA13 //Serial wire debug I/O |
207 | | -#define SWCLK PA14 //Serial wire debug clock |
| 209 | +#define SWDIO PA13 //Serial wire debug I/O |
| 210 | +#define SWCLK PA14 //Serial wire debug clock |
208 | 211 |
|
209 | | -#define I2C2_SCL PA9 //I2C clock on the QWIIC connector |
210 | | -#define I2C2_SDA PA8 //I2C data on the QWIIC connector |
| 212 | +#define I2C2_SCL PA9 //I2C clock on the QWIIC connector |
| 213 | +#define I2C2_SDA PA8 //I2C data on the QWIIC connector |
211 | 214 |
|
212 | | -#define USART_TX PB6 |
213 | | -#define USART_RX PB7 |
| 215 | +#define USART_TX PB6 |
| 216 | +#define USART_RX PB7 |
214 | 217 |
|
215 | | -#define ENCODER_A PA6 |
216 | | -#define ENCODER_B PA4 |
217 | | -#define ENCODER_Z PC3 |
| 218 | +#define ENCODER_A PB5 //Shared with SPI |
| 219 | +#define ENCODER_B PB4 //Shared with SPI |
| 220 | +#define ENCODER_Z PB3 //Shared with SPI |
218 | 221 |
|
219 | | -#define HALL1 ENCODER_A |
220 | | -#define HALL2 ENCODER_B |
221 | | -#define HALL3 ENCODER_Z |
| 222 | +#define HALL1 PC14 //Spare on J5 |
| 223 | +#define HALL2 PC15 //Spare on J5 |
| 224 | +#define HALL3 PC3 //Spare on J5 |
222 | 225 |
|
223 | 226 |
|
224 | 227 | // On-board LED pin number |
|
0 commit comments