Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rpm mode #108

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions Inc/common.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

extern uint8_t eepromBuffer[176];
extern uint8_t eepromBuffer[183];
extern uint16_t TIMER1_MAX_ARR;

extern uint32_t gcr[37];
Expand Down Expand Up @@ -50,5 +50,3 @@ typedef struct fastPID{
int32_t integral_limit;
int32_t output_limit;
}fastPID;


42 changes: 29 additions & 13 deletions Inc/targets.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,23 @@
#define DEAD_TIME 45
#define HARDWARE_GROUP_F0_B
#define USE_SERIAL_TELEMETRY
#define SERIAL_PIN_OPENDRAIN
//#define USE_RGB_LED
#endif

#ifdef HKMICRO_F051
#define FILE_NAME "HKMICRO_F051"
#define FIRMWARE_NAME "HK Micro "
#define DEAD_TIME 45
#define HARDWARE_GROUP_F0_B
#define MILLIVOLT_PER_AMP 20
#define CURRENT_OFFSET 0
#define TARGET_VOLTAGE_DIVIDER 110
#define USE_SERIAL_TELEMETRY
#define SERIAL_PIN_OPENDRAIN
#define USE_RGB_LED
#endif

#ifdef MP6531_F051
#define FILE_NAME "MP6531_F051"
#define FIRMWARE_NAME "Mp6531_Dev "
Expand Down Expand Up @@ -102,6 +116,20 @@
#define USE_SERIAL_TELEMETRY
#endif

#ifdef HGLRC35_F051
#define FILE_NAME "HGLRC35_F051"
#define FIRMWARE_NAME "HGLRC_35A "
#define DEAD_TIME 45
#define HARDWARE_GROUP_F0_A
#define USE_SERIAL_TELEMETRY
#define SERIAL_PIN_OPENDRAIN
#define PA6_VOLTAGE
#define TARGET_VOLTAGE_DIVIDER 210
#endif




#ifdef SISKIN_F051
#define FILE_NAME "SISKIN_F051"
#define FIRMWARE_NAME "SISKIN_PA2 "
Expand Down Expand Up @@ -420,7 +448,7 @@

#ifndef MILLIVOLT_PER_AMP
#define MILLIVOLT_PER_AMP 20
#endif
#endif

#ifndef CURRENT_OFFSET
#define CURRENT_OFFSET 0 // in millivolt measured at output of op-amp
Expand Down Expand Up @@ -1211,15 +1239,3 @@
#define VOLTAGE_ADC_PIN LL_GPIO_PIN_6
#endif
#endif












2 changes: 1 addition & 1 deletion Mcu/f051/Src/ADC.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ void ADC_Init(void)


GPIO_InitStruct.Pin = LL_GPIO_PIN_3;
GPIO_InitStruct.Mode = LL_GPIO_MODE_ANALOG;
GPIO_InitStruct.Mode = LL_GPIO_MODE_ANALOG;
GPIO_InitStruct.Pull = LL_GPIO_PULL_NO;
LL_GPIO_Init(GPIOA, &GPIO_InitStruct);

Expand Down
5 changes: 1 addition & 4 deletions Mcu/f051/Src/peripherals.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ void initCorePeripherals(void){
MX_COMP1_Init();
MX_TIM14_Init();
MX_TIM6_Init();
MX_TIM17_Init();
MX_TIM17_Init();
UN_TIM_Init();
#ifdef USE_SERIAL_TELEMETRY
telem_UART_Init();
Expand Down Expand Up @@ -485,6 +485,3 @@ void LED_GPIO_init(){
}

#endif



5 changes: 4 additions & 1 deletion Mcu/f051/Src/serial_telemetry.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,11 @@ void telem_UART_Init(void)
GPIO_InitStruct.Pin = LL_GPIO_PIN_6;
GPIO_InitStruct.Mode = LL_GPIO_MODE_ALTERNATE;
GPIO_InitStruct.Speed = LL_GPIO_SPEED_FREQ_HIGH;
#ifdef SERIAL_PIN_OPENDRAIN
GPIO_InitStruct.OutputType = LL_GPIO_OUTPUT_OPENDRAIN;
#else
GPIO_InitStruct.OutputType = LL_GPIO_OUTPUT_PUSHPULL;
#endif
GPIO_InitStruct.Pull = LL_GPIO_PULL_UP;
GPIO_InitStruct.Alternate = LL_GPIO_AF_0;
LL_GPIO_Init(GPIOB, &GPIO_InitStruct);
Expand Down Expand Up @@ -202,4 +206,3 @@ void makeTelemPackage(uint8_t temp, uint16_t voltage, uint16_t current, uint16_t

aTxBuffer[9] = get_crc8(aTxBuffer,9);
}

Loading