FIX&ENH: rotary driver works!
ADD: three pins for current strength values FIX: ADC1->ADC2 ENH: prepare for UART FIX&ADD: add USART print, add extra_script to print floats to COM port #2 ADD: some func #2 Rebuild project structure ADD: .clang-format file ENG: use flag ADD: USART1 FIX: .ioc FIX: .ioc ADD: debug script to angle value ADD: gitlab-ci ADD: gitlab CI ADD: gitlab-ci FIX: gitlab-ci ADD&FIX: all sensors work! (or not?)
This commit is contained in:
parent
d1b0ed0858
commit
8157b41ea9
23 changed files with 673 additions and 339 deletions
15
Src/gpio.c
15
Src/gpio.c
|
@ -106,5 +106,20 @@ void MX_GPIO_Init(void)
|
|||
}
|
||||
|
||||
/* USER CODE BEGIN 2 */
|
||||
void AS5045_CS_Init(void) {
|
||||
GPIO_InitTypeDef GPIO_InitStruct = {0};
|
||||
|
||||
// Enable the GPIO clocks for CS pin
|
||||
__HAL_RCC_GPIOB_CLK_ENABLE();
|
||||
|
||||
// Configure the GPIO pin for the CS as output
|
||||
GPIO_InitStruct.Pin = AS5045_CS_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
HAL_GPIO_Init(AS5045_CS_GPIO_Port, &GPIO_InitStruct);
|
||||
|
||||
// Set the CS pin high initially
|
||||
HAL_GPIO_WritePin(AS5045_CS_GPIO_Port, AS5045_CS_Pin, GPIO_PIN_SET);
|
||||
}
|
||||
/* USER CODE END 2 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue