10 changed files with 205 additions and 34 deletions
-
2a8000_protocol
-
2sdk
-
25usrc/board.h
-
2usrc/configs/device_id_mgr.cpp
-
5usrc/gservice.hpp
-
2usrc/main.cpp
-
101usrc/subboards/subboard30_shake_module/subboard30_shake_module.cpp
-
9usrc/subboards/subboard30_shake_module/subboard30_shake_module.hpp
-
63usrc/subboards/subboard30_shake_module/subboard30_shake_module_board.c
-
28usrc/subboards/subboard30_shake_module/subboard30_shake_module_board.h
@ -1 +1 @@ |
|||
Subproject commit 1743a4bfa958a6c9ea286edd4c82a129891a5aea |
|||
Subproject commit 430dd705b44a5bb29df6958c6a6af927ca1acc7c |
@ -1 +1 @@ |
|||
Subproject commit 4fbd2bdf3a29557a93e7d1ae8d9ce6d14c5b970b |
|||
Subproject commit 77be6521422643010153ee3c51f9476c1387b7ad |
@ -1,25 +0,0 @@ |
|||
#pragma once |
|||
|
|||
#define TMC_MOTOR_SPI hspi1 |
|||
// JL_CSN |
|||
#define MOTOR1_CSN PA4 |
|||
#define MOTOR1_ENN PE3 |
|||
#define MOTOR1_SPI_MODE_SELECT PinNull |
|||
#define MOTOR1_REFL PD13 |
|||
#define MOTOR1_REFR PD14 |
|||
// SL_CSN |
|||
#define MOTOR2_CSN PA8 |
|||
#define MOTOR2_ENN PE6 |
|||
#define MOTOR2_SPI_MODE_SELECT PinNull |
|||
#define MOTOR2_REFL PD11 |
|||
#define MOTOR2_REFR PD12 |
|||
// CL_CSN |
|||
#define MOTOR3_CSN PA15 |
|||
#define MOTOR3_ENN PE7 |
|||
#define MOTOR3_SPI_MODE_SELECT PinNull |
|||
#define MOTOR3_REFL PD9 |
|||
#define MOTOR3_REFR PD10 |
|||
|
|||
#define MOTOR_CFG_FLASH_MARK "MOTOR_CFG_FLASH_MARK" |
|||
|
|||
#define BOARD_ID 6 |
@ -0,0 +1,63 @@ |
|||
#include "main.h" |
|||
|
|||
/* USER CODE BEGIN 0 */ |
|||
|
|||
/* USER CODE END 0 */ |
|||
SPI_HandleTypeDef hspi1; |
|||
|
|||
/* SPI1 init function */ |
|||
void MX_SPI1_Init(void) { |
|||
/* USER CODE BEGIN SPI1_Init 0 */ |
|||
|
|||
/* USER CODE END SPI1_Init 0 */ |
|||
|
|||
/* USER CODE BEGIN SPI1_Init 1 */ |
|||
|
|||
/* USER CODE END SPI1_Init 1 */ |
|||
hspi1.Instance = SPI1; |
|||
hspi1.Init.Mode = SPI_MODE_MASTER; |
|||
hspi1.Init.Direction = SPI_DIRECTION_2LINES; |
|||
hspi1.Init.DataSize = SPI_DATASIZE_8BIT; |
|||
hspi1.Init.CLKPolarity = SPI_POLARITY_LOW; |
|||
hspi1.Init.CLKPhase = SPI_PHASE_1EDGE; |
|||
hspi1.Init.NSS = SPI_NSS_SOFT; |
|||
hspi1.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_32; |
|||
hspi1.Init.FirstBit = SPI_FIRSTBIT_MSB; |
|||
hspi1.Init.TIMode = SPI_TIMODE_DISABLE; |
|||
hspi1.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE; |
|||
hspi1.Init.CRCPolynomial = 10; |
|||
if (HAL_SPI_Init(&hspi1) != HAL_OK) { |
|||
Error_Handler(); |
|||
} |
|||
/* USER CODE BEGIN SPI1_Init 2 */ |
|||
|
|||
/* USER CODE END SPI1_Init 2 */ |
|||
} |
|||
|
|||
void HAL_SPI_MspInit(SPI_HandleTypeDef* spiHandle) { |
|||
GPIO_InitTypeDef GPIO_InitStruct = {0}; |
|||
if (spiHandle->Instance == SPI1) { |
|||
/* USER CODE BEGIN SPI1_MspInit 0 */ |
|||
|
|||
/* USER CODE END SPI1_MspInit 0 */ |
|||
/* SPI1 clock enable */ |
|||
__HAL_RCC_SPI1_CLK_ENABLE(); |
|||
|
|||
__HAL_RCC_GPIOA_CLK_ENABLE(); |
|||
/**SPI1 GPIO Configuration |
|||
PA5 ------> SPI1_SCK |
|||
PA6 ------> SPI1_MISO |
|||
PA7 ------> SPI1_MOSI |
|||
*/ |
|||
GPIO_InitStruct.Pin = GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7; |
|||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; |
|||
GPIO_InitStruct.Pull = GPIO_NOPULL; |
|||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; |
|||
GPIO_InitStruct.Alternate = GPIO_AF5_SPI1; |
|||
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); |
|||
|
|||
/* USER CODE BEGIN SPI1_MspInit 1 */ |
|||
|
|||
/* USER CODE END SPI1_MspInit 1 */ |
|||
} |
|||
} |
@ -0,0 +1,28 @@ |
|||
#pragma once |
|||
#include "main.h" |
|||
#define TMC_MOTOR_SPI hspi1 |
|||
// JL_CSN |
|||
#define MOTOR1_CSN PA4 |
|||
#define MOTOR1_ENN PE3 |
|||
#define MOTOR1_SPI_MODE_SELECT PinNull |
|||
#define MOTOR1_REFL PD13 |
|||
#define MOTOR1_REFR PD14 |
|||
// SL_CSN |
|||
#define MOTOR2_CSN PA8 |
|||
#define MOTOR2_ENN PE6 |
|||
#define MOTOR2_SPI_MODE_SELECT PinNull |
|||
#define MOTOR2_REFL PD11 |
|||
#define MOTOR2_REFR PD12 |
|||
// CL_CSN |
|||
#define MOTOR3_CSN PA15 |
|||
#define MOTOR3_ENN PE7 |
|||
#define MOTOR3_SPI_MODE_SELECT PinNull |
|||
#define MOTOR3_REFL PD9 |
|||
#define MOTOR3_REFR PD10 |
|||
|
|||
#define MOTOR_CFG_FLASH_MARK "MOTOR_CFG_FLASH_MARK" |
|||
|
|||
#define BOARD_ID 6 |
|||
|
|||
extern SPI_HandleTypeDef hspi1; |
|||
void MX_SPI1_Init(void); |
Write
Preview
Loading…
Cancel
Save
Reference in new issue