Skip to content

Commit 29a67a9

Browse files
Moddingearfpistm
authored andcommitted
chore: update Phoque1 variant
Signed-off-by: Gabriel Zerbib <moddingear@gmail.com>
1 parent 3910fbd commit 29a67a9

1 file changed

Lines changed: 43 additions & 40 deletions

File tree

‎variants/STM32G4xx/G431V(6-8-B)T_G441VBT/variant_PHOQUE1.h‎

Lines changed: 43 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -149,76 +149,79 @@
149149

150150

151151
/* 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
158158

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
161161
#define PIN_I2C_GD_SCL PC8 //I2C3 connected to Gate driver
162162
#define PIN_I2C_GD_SDA PC9 //I2C3 connected to Gate driver
163163

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
165165
#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
168168
#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
170170
#define BRAKE_COMP_PLUS COMP_INPUT_PLUS_IO2
171171
#define BRAKE_COMP_MINUS COMP_INPUT_MINUS_DAC1_CH1
172172

173173
#define VBUS_MUL_FACTOR 23 //Multiply the adc voltage read by this value to get the supply voltage
174174

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
176176

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
180181

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
184186

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
188191

189192
#define A_POTENTIOMETER PC0
190-
#define A_TEMPERATURE PC5
193+
#define A_TEMPERATURE PC5
191194

192195
#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)
194197
#endif
195198
#ifndef NTC_T0
196-
#define NTC_T0 (273.15f+25)//Kelvin
199+
#define NTC_T0 (273.15f+25)//Kelvin
197200
#endif
198201
#ifndef NTC_DIVIDER_BALANCE
199202
#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)
200203
#endif
201204

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
205208

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
208211

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
211214

212-
#define USART_TX PB6
213-
#define USART_RX PB7
215+
#define USART_TX PB6
216+
#define USART_RX PB7
214217

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
218221

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
222225

223226

224227
// On-board LED pin number

0 commit comments

Comments
 (0)