Skip to content

Commit

Permalink
Add new targets pa2 input for f415
Browse files Browse the repository at this point in the history
  • Loading branch information
AlkaMotors committed Nov 9, 2024
1 parent d8320de commit 0a9e7fc
Show file tree
Hide file tree
Showing 37 changed files with 11,357 additions and 1,572 deletions.
96 changes: 89 additions & 7 deletions Inc/targets.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,14 @@
#define USE_SERIAL_TELEMETRY
#endif

#ifdef SKYSTARS_SL40_E230
#define FIRMWARE_NAME "SL40 E230"
#define FILE_NAME "SKYSTARS_SL40_E230"
#define DEAD_TIME 40
#define HARDWARE_GROUP_GD_A
#define USE_SERIAL_TELEMETRY
#endif

/*********************************************************************AT32F421
* targets*********************************************/

Expand Down Expand Up @@ -614,6 +622,17 @@
#define USE_SERIAL_TELEMETRY
#endif

#ifdef AIKON_AT_04_F421
#define FIRMWARE_NAME "AIKON F421 "
#define FILE_NAME "AIKON_AT_04_F421"
#define DEAD_TIME 80
#define HARDWARE_GROUP_AT_B
#define HARDWARE_GROUP_AT_045
#define USE_SERIAL_TELEMETRY
#define MILLIVOLT_PER_AMP 34
#define CURRENT_OFFSET 400 // millivolts
#endif

#ifdef AT32DEV_F415
#define FIRMWARE_NAME "AT32F415"
#define FILE_NAME "AT32DEV_F415"
Expand All @@ -640,6 +659,19 @@
#define USE_SERIAL_TELEMETRY
#endif

#ifdef TBS_CAN_F415
#define FIRMWARE_NAME "TBS_CAN_F415"
#define FILE_NAME "TBS_CAN_F415"
#define DEAD_TIME 120
#define HARDWARE_GROUP_AT_H
#define HARDWARE_GROUP_AT_045
#define TARGET_VOLTAGE_DIVIDER 210
#define MILLIVOLT_PER_AMP 25
#define RAMP_SPEED_LOW_RPM 1
#define RAMP_SPEED_HIGH_RPM 1
#define USE_SERIAL_TELEMETRY
#endif

#ifdef SPEEDYBEE_F421
#define FIRMWARE_NAME "SpeedyBee F4"
#define FILE_NAME "SPEEDYBEE_F421"
Expand Down Expand Up @@ -1228,15 +1260,27 @@
#endif


//#ifdef GEN_64K_G071
//#define FILE_NAME "GEN_64K_G071"
//#define FIRMWARE_NAME "G071 64kESC "
//#define DEAD_TIME 60
//#define MILLIVOLT_PER_AMP 20
//#define CURRENT_OFFSET 0
//#define HARDWARE_GROUP_G0_A
//#define USE_SERIAL_TELEMETRY
//#define SIXTY_FOUR_KB_MEMORY
//#endif

#ifdef GEN_64K_G071
#define FILE_NAME "GEN_64K_G071"
#define FIRMWARE_NAME "G071 64kESC "
#define DEAD_TIME 60
#define DEAD_TIME 80
#define MILLIVOLT_PER_AMP 20
#define CURRENT_OFFSET 0
#define HARDWARE_GROUP_G0_A
#define USE_SERIAL_TELEMETRY
#define SIXTY_FOUR_KB_MEMORY
#define MIN_BEMF_COUNTS 5
#endif

#ifdef ST_G0_03_N_G071
Expand Down Expand Up @@ -1587,6 +1631,18 @@
#define SIXTY_FOUR_KB_MEMORY
#endif

#ifdef ST_G0_06_N_G071
#define FILE_NAME "ST_G0_06_N_G071"
#define FIRMWARE_NAME "G0_06_N_G071"
#define DEAD_TIME 50
#define MILLIVOLT_PER_AMP 15
#define CURRENT_OFFSET 0
#define TARGET_VOLTAGE_DIVIDER 110
#define HARDWARE_GROUP_G0_G
#define USE_SERIAL_TELEMETRY
#define SIXTY_FOUR_KB_MEMORY
#endif

/********************************** F031 Targets
* ***********************************/

Expand Down Expand Up @@ -2797,13 +2853,39 @@
#define PHASE_C_PIN_SOURCE_HIGH GPIO_PIN_SOURCE8
#define PHASE_C_GPIO_PORT_HIGH GPIOA

// #define PHASE_A_COMP COMP_INMInput_IN3 // pa0
// #define PHASE_B_COMP COMP_INMInput_IN1 // pa4
// #define PHASE_C_COMP COMP_INMInput_IN2 // pa5
#endif

#ifdef HARDWARE_GROUP_AT_H

#define MCU_AT415
#define USE_TIMER_2_CHANNEL_3
#define INPUT_PIN GPIO_PINS_2
#define INPUT_PIN_PORT GPIOA
#define IC_TIMER_CHANNEL TMR_SELECT_CHANNEL_3
#define IC_TIMER_REGISTER TMR2
#define INPUT_DMA_CHANNEL DMA1_CHANNEL6
#define IC_DMA_IRQ_NAME DMA1_Channel6_IRQn

//#define PHASE_A_COMP 0x400000E1 // works for polling mode
//#define PHASE_B_COMP 0x400000C1
//#define PHASE_C_COMP 0x400000D1
#define PHASE_A_GPIO_LOW GPIO_PINS_1
#define PHASE_A_PIN_SOURCE_LOW GPIO_PIN_SOURCE1
#define PHASE_A_GPIO_PORT_LOW GPIOB
#define PHASE_A_GPIO_HIGH GPIO_PINS_10
#define PHASE_A_PIN_SOURCE_HIGH GPIO_PIN_SOURCE10
#define PHASE_A_GPIO_PORT_HIGH GPIOA

#define PHASE_B_GPIO_LOW GPIO_PINS_0
#define PHASE_B_PIN_SOURCE_LOW GPIO_PIN_SOURCE0
#define PHASE_B_GPIO_PORT_LOW GPIOB
#define PHASE_B_GPIO_HIGH GPIO_PINS_9
#define PHASE_B_PIN_SOURCE_HIGH GPIO_PIN_SOURCE9
#define PHASE_B_GPIO_PORT_HIGH GPIOA

#define PHASE_C_GPIO_LOW GPIO_PINS_7
#define PHASE_C_PIN_SOURCE_LOW GPIO_PIN_SOURCE7
#define PHASE_C_GPIO_PORT_LOW GPIOA
#define PHASE_C_GPIO_HIGH GPIO_PINS_8
#define PHASE_C_PIN_SOURCE_HIGH GPIO_PIN_SOURCE8
#define PHASE_C_GPIO_PORT_HIGH GPIOA

#endif

Expand Down
10 changes: 9 additions & 1 deletion Keil_Projects/AM32_MultiProject.uvmpw
Original file line number Diff line number Diff line change
Expand Up @@ -9,36 +9,44 @@

<project>
<PathAndName>.\Am32e230.uvprojx</PathAndName>
<NodeIsCheckedInBatchBuild>1</NodeIsCheckedInBatchBuild>
</project>

<project>
<PathAndName>.\Am32F031.uvprojx</PathAndName>
<NodeIsCheckedInBatchBuild>1</NodeIsCheckedInBatchBuild>
</project>

<project>
<PathAndName>.\Am32F051.uvprojx</PathAndName>
<NodeIsCheckedInBatchBuild>1</NodeIsCheckedInBatchBuild>
</project>

<project>
<PathAndName>.\Am32F415.uvprojx</PathAndName>
<NodeIsCheckedInBatchBuild>1</NodeIsCheckedInBatchBuild>
</project>

<project>
<PathAndName>.\Am32F421.uvprojx</PathAndName>
<NodeIsActive>1</NodeIsActive>
<NodeIsExpanded>1</NodeIsExpanded>
<NodeIsCheckedInBatchBuild>1</NodeIsCheckedInBatchBuild>
</project>

<project>
<PathAndName>.\Am32G071.uvprojx</PathAndName>
<NodeIsExpanded>1</NodeIsExpanded>
<NodeIsCheckedInBatchBuild>1</NodeIsCheckedInBatchBuild>
</project>

<project>
<PathAndName>.\Am32G431.uvprojx</PathAndName>
<NodeIsCheckedInBatchBuild>1</NodeIsCheckedInBatchBuild>
</project>

<project>
<PathAndName>.\Am32l431.uvprojx</PathAndName>
<NodeIsCheckedInBatchBuild>1</NodeIsCheckedInBatchBuild>
</project>

</ProjectWorkspace>
Loading

0 comments on commit 0a9e7fc

Please sign in to comment.