Skip to content

Commit

Permalink
cubemx
Browse files Browse the repository at this point in the history
  • Loading branch information
pranay-o committed Jan 21, 2025
1 parent 6d1d0a8 commit a144995
Show file tree
Hide file tree
Showing 9 changed files with 90 additions and 29 deletions.
2 changes: 2 additions & 0 deletions can_bus/quintuna/RSM/RSM_tx.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@
}
}
}


}
2 changes: 1 addition & 1 deletion firmware/quintuna/RSM/src/app/app_mainState.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ void mainStateRunOnTick100Hz(void)

const bool brake_light_on = false; // app_canRx_FSM_BrakeActuated_get();
io_led_enable(&brake_light, brake_light_on);
//app_canTx_RSM_BrakeLight_set(brake_light_on);
// app_canTx_RSM_BrakeLight_set(brake_light_on);

// const bool hv_on = app_canRx_BMS_State_get() == BMS_DRIVE_STATE;
// io_fan_set(&rad_fan, hv_on);
Expand Down
8 changes: 8 additions & 0 deletions firmware/quintuna/RSM/src/cubemx/Inc/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@ extern "C"
/* Private defines -----------------------------------------------------------*/
#define LED_Pin GPIO_PIN_13
#define LED_GPIO_Port GPIOC
#define SUSP_TRAVEL_RL_3V3_Pin GPIO_PIN_3
#define SUSP_TRAVEL_RL_3V3_GPIO_Port GPIOC
#define SUSP_TRAVEL_RR_3V3_Pin GPIO_PIN_4
#define SUSP_TRAVEL_RR_3V3_GPIO_Port GPIOC
#define BPS_R_3V3_Pin GPIO_PIN_5
#define BPS_R_3V3_GPIO_Port GPIOC
#define LC3_OUT_Pin GPIO_PIN_1
#define LC3_OUT_GPIO_Port GPIOB
#define BRAKE_LIGHT_EN_3V3_Pin GPIO_PIN_9
#define BRAKE_LIGHT_EN_3V3_GPIO_Port GPIOA
#define RAD_FAN_EN_Pin GPIO_PIN_5
Expand Down
33 changes: 22 additions & 11 deletions firmware/quintuna/RSM/src/cubemx/RSM.ioc
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,38 @@
CAD.formats=
CAD.pinconfig=
CAD.provider=
CAN1.CalculateBaudRate=333333
CAN1.CalculateTimeBit=3000
CAN1.CalculateTimeQuantum=1000.0
CAN1.IPParameters=CalculateTimeQuantum,CalculateTimeBit,CalculateBaudRate
FREERTOS.IPParameters=Tasks01
FREERTOS.Tasks01=defaultTask,24,128,StartDefaultTask,Default,NULL,Dynamic,NULL,NULL
File.Version=6
GPIO.groupedBy=
GPIO.groupedBy=Show All
KeepUserPlacement=false
Mcu.CPN=STM32F412RGT6
Mcu.Family=STM32F4
Mcu.IP0=FREERTOS
Mcu.IP1=NVIC
Mcu.IP2=RCC
Mcu.IP3=SYS
Mcu.IPNb=4
Mcu.IP0=CAN1
Mcu.IP1=FREERTOS
Mcu.IP2=NVIC
Mcu.IP3=RCC
Mcu.IP4=SYS
Mcu.IPNb=5
Mcu.Name=STM32F412R(E-G)Tx
Mcu.Package=LQFP64
Mcu.Pin0=PC13
Mcu.Pin1=PC3
Mcu.Pin10=VP_FREERTOS_VS_CMSIS_V2
Mcu.Pin11=VP_SYS_VS_Systick
Mcu.Pin2=PC4
Mcu.Pin3=PC5
Mcu.Pin4=PB1
Mcu.Pin5=PA9
Mcu.Pin6=PB5
Mcu.Pin7=PB6
Mcu.Pin8=VP_FREERTOS_VS_CMSIS_V2
Mcu.Pin9=VP_SYS_VS_Systick
Mcu.PinsNb=10
Mcu.Pin6=PA11
Mcu.Pin7=PA12
Mcu.Pin8=PB5
Mcu.Pin9=PB6
Mcu.PinsNb=12
Mcu.ThirdPartyNb=0
Mcu.UserConstants=
Mcu.UserName=STM32F412RGTx
Expand All @@ -46,6 +53,10 @@ NVIC.SavedSvcallIrqHandlerGenerated=true
NVIC.SavedSystickIrqHandlerGenerated=true
NVIC.SysTick_IRQn=true\:15\:0\:false\:false\:true\:true\:false\:true\:false
NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false
PA11.Mode=CAN_Activate
PA11.Signal=CAN1_RX
PA12.Mode=CAN_Activate
PA12.Signal=CAN1_TX
PA9.GPIOParameters=GPIO_Speed,GPIO_Label
PA9.GPIO_Label=BRAKE_LIGHT_EN_3V3
PA9.GPIO_Speed=GPIO_SPEED_FREQ_LOW
Expand Down
2 changes: 1 addition & 1 deletion firmware/quintuna/RSM/src/cubemx/RSM.ioc.md5
Original file line number Diff line number Diff line change
@@ -1 +1 @@
f8d1cf3528e1e442c42a4b116d4a7e9d
088ca957ebb3d43e6bdf590d485cd2b9
26 changes: 13 additions & 13 deletions firmware/quintuna/RSM/src/cubemx/Src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,38 +198,38 @@ static void MX_GPIO_Init(void)

/* GPIO Ports Clock Enable */
__HAL_RCC_GPIOC_CLK_ENABLE();
__HAL_RCC_GPIOA_CLK_ENABLE();
__HAL_RCC_GPIOB_CLK_ENABLE();
__HAL_RCC_GPIOA_CLK_ENABLE();

/*Configure GPIO pin Output Level */
HAL_GPIO_WritePin(LED_GPIO_Port, LED_Pin, GPIO_PIN_RESET);
HAL_GPIO_WritePin(GPIOC, LED_Pin | SUSP_TRAVEL_RL_3V3_Pin | SUSP_TRAVEL_RR_3V3_Pin | BPS_R_3V3_Pin, GPIO_PIN_RESET);

/*Configure GPIO pin Output Level */
HAL_GPIO_WritePin(BRAKE_LIGHT_EN_3V3_GPIO_Port, BRAKE_LIGHT_EN_3V3_Pin, GPIO_PIN_RESET);
HAL_GPIO_WritePin(GPIOB, LC3_OUT_Pin | RAD_FAN_EN_Pin | FR_STBY_Pin, GPIO_PIN_RESET);

/*Configure GPIO pin Output Level */
HAL_GPIO_WritePin(GPIOB, RAD_FAN_EN_Pin | FR_STBY_Pin, GPIO_PIN_RESET);
HAL_GPIO_WritePin(BRAKE_LIGHT_EN_3V3_GPIO_Port, BRAKE_LIGHT_EN_3V3_Pin, GPIO_PIN_RESET);

/*Configure GPIO pin : LED_Pin */
GPIO_InitStruct.Pin = LED_Pin;
/*Configure GPIO pins : LED_Pin SUSP_TRAVEL_RL_3V3_Pin SUSP_TRAVEL_RR_3V3_Pin BPS_R_3V3_Pin */
GPIO_InitStruct.Pin = LED_Pin | SUSP_TRAVEL_RL_3V3_Pin | SUSP_TRAVEL_RR_3V3_Pin | BPS_R_3V3_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(LED_GPIO_Port, &GPIO_InitStruct);
HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);

/*Configure GPIO pin : BRAKE_LIGHT_EN_3V3_Pin */
GPIO_InitStruct.Pin = BRAKE_LIGHT_EN_3V3_Pin;
/*Configure GPIO pins : LC3_OUT_Pin RAD_FAN_EN_Pin FR_STBY_Pin */
GPIO_InitStruct.Pin = LC3_OUT_Pin | RAD_FAN_EN_Pin | FR_STBY_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(BRAKE_LIGHT_EN_3V3_GPIO_Port, &GPIO_InitStruct);
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);

/*Configure GPIO pins : RAD_FAN_EN_Pin FR_STBY_Pin */
GPIO_InitStruct.Pin = RAD_FAN_EN_Pin | FR_STBY_Pin;
/*Configure GPIO pin : BRAKE_LIGHT_EN_3V3_Pin */
GPIO_InitStruct.Pin = BRAKE_LIGHT_EN_3V3_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
HAL_GPIO_Init(BRAKE_LIGHT_EN_3V3_GPIO_Port, &GPIO_InitStruct);

/* USER CODE BEGIN MX_GPIO_Init_2 */
/* USER CODE END MX_GPIO_Init_2 */
Expand Down
2 changes: 1 addition & 1 deletion firmware/quintuna/RSM/src/hw/hw_pwms.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "hw_pwms.h"
#include "main.h"

const PwmInputFreqOnly coolant_config{ &htim3, TIMx_FREQUENCY / TIM12_PRESCALER, TIM_CHANNEL_1, TIM12_AUTO_RELOAD_REG,
const PwmInputFreqOnly coolant_config{ &htim3, TIMx2_FREQUENCY / TIM12_PRESCALER, TIM_CHANNEL_1, TIM12_AUTO_RELOAD_REG,
HAL_TIM_ACTIVE_CHANNEL_1 };
4 changes: 2 additions & 2 deletions firmware/quintuna/RSM/src/io/io_suspension.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
#define MIN_SUSPENSION_VOLTAGE (0.2f)
#define MAX_SUSPENSION_VOLTAGE (3.5f)

const Suspension right = { .src = &susp_travel_rr_3v3};
const Suspension left = { .src = &susp_travel_rl_3v3};
const Suspension right = { .src = &susp_travel_rr_3v3 };
const Suspension left = { .src = &susp_travel_rl_3v3 };

float travelFromVoltage(float voltage)
{
Expand Down
40 changes: 40 additions & 0 deletions software/tracksight/frontend/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,46 @@
resolved "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.1.1.tgz"
integrity sha512-yDjSFKQKTIjyT7cFv+DqQfW5jsD+tVxXTckSe1KIouKk75t1qZmj/mV3wzdmFb0XHVGtyRjDMulfVG8uCKemOQ==

"@next/[email protected]":
version "14.1.1"
resolved "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-14.1.1.tgz"
integrity sha512-KCQmBL0CmFmN8D64FHIZVD9I4ugQsDBBEJKiblXGgwn7wBCSe8N4Dx47sdzl4JAg39IkSN5NNrr8AniXLMb3aw==

"@next/[email protected]":
version "14.1.1"
resolved "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.1.1.tgz"
integrity sha512-YDQfbWyW0JMKhJf/T4eyFr4b3tceTorQ5w2n7I0mNVTFOvu6CGEzfwT3RSAQGTi/FFMTFcuspPec/7dFHuP7Eg==

"@next/[email protected]":
version "14.1.1"
resolved "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.1.1.tgz"
integrity sha512-fiuN/OG6sNGRN/bRFxRvV5LyzLB8gaL8cbDH5o3mEiVwfcMzyE5T//ilMmaTrnA8HLMS6hoz4cHOu6Qcp9vxgQ==

"@next/[email protected]":
version "14.1.1"
resolved "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.1.1.tgz"
integrity sha512-rv6AAdEXoezjbdfp3ouMuVqeLjE1Bin0AuE6qxE6V9g3Giz5/R3xpocHoAi7CufRR+lnkuUjRBn05SYJ83oKNQ==

"@next/[email protected]":
version "14.1.1"
resolved "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.1.1.tgz"
integrity sha512-YAZLGsaNeChSrpz/G7MxO3TIBLaMN8QWMr3X8bt6rCvKovwU7GqQlDu99WdvF33kI8ZahvcdbFsy4jAFzFX7og==

"@next/[email protected]":
version "14.1.1"
resolved "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.1.1.tgz"
integrity sha512-1L4mUYPBMvVDMZg1inUYyPvFSduot0g73hgfD9CODgbr4xiTYe0VOMTZzaRqYJYBA9mana0x4eaAaypmWo1r5A==

"@next/[email protected]":
version "14.1.1"
resolved "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.1.1.tgz"
integrity sha512-jvIE9tsuj9vpbbXlR5YxrghRfMuG0Qm/nZ/1KDHc+y6FpnZ/apsgh+G6t15vefU0zp3WSpTMIdXRUsNl/7RSuw==

"@next/[email protected]":
version "14.1.1"
resolved "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.1.1.tgz"
integrity sha512-S6K6EHDU5+1KrBDLko7/c1MNy/Ya73pIAmvKeFwsF4RmBFJSO7/7YeD4FnZ4iBdzE69PpQ4sOMU9ORKeNuxe8A==

"@nodelib/[email protected]":
version "2.1.5"
resolved "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz"
Expand Down

0 comments on commit a144995

Please sign in to comment.