-
Notifications
You must be signed in to change notification settings - Fork 296
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6448722
commit 0453aca
Showing
24 changed files
with
3,211 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* ADC.h | ||
* | ||
* Created on: May 20, 2020 | ||
* Author: Alka | ||
*/ | ||
|
||
#include "main.h" | ||
#include "targets.h" | ||
|
||
|
||
#ifndef ADC_H_ | ||
#define ADC_H_ | ||
|
||
|
||
|
||
void ADC_DMA_Callback(); | ||
void enableADC_DMA(); | ||
void activateADC(); | ||
void ADC_Init(void); | ||
|
||
void Configure_DMA(); | ||
|
||
void Configure_ADC(); | ||
|
||
void Activate_ADC(); | ||
|
||
|
||
#endif /* ADC_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* IO.h | ||
* | ||
* Created on: Sep. 26, 2020 | ||
* Author: Alka | ||
*/ | ||
|
||
#ifndef IO_H_ | ||
#define IO_H_ | ||
|
||
#endif /* IO_H_ */ | ||
|
||
|
||
#include "main.h" | ||
|
||
void changeToOutput(); | ||
void changeToInput(); | ||
void receiveDshotDma(); | ||
void sendDshotDma(); | ||
void detectInput(); | ||
|
||
extern char inputSet; | ||
extern char dshot; | ||
extern char servoPwm; | ||
extern char send_telemetry; | ||
extern uint8_t degrees_celsius; | ||
|
||
extern uint16_t ADC_raw_volts; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* WS2812.h | ||
* | ||
* Created on: Sep 9, 2020 | ||
* Author: Alka | ||
*/ | ||
|
||
#ifndef INC_WS2812_H_ | ||
#define INC_WS2812_H_ | ||
|
||
#include "main.h" | ||
|
||
|
||
|
||
|
||
void send_LED_DMA(); | ||
void WS2812_Init(void); | ||
void send_LED_RGB(uint8_t red, uint8_t green, uint8_t blue); | ||
|
||
extern char dma_busy; | ||
|
||
|
||
#endif /* INC_WS2812_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* comparator.h | ||
* | ||
* Created on: Sep. 26, 2020 | ||
* Author: Alka | ||
*/ | ||
|
||
#ifndef COMPARATOR_H_ | ||
#define COMPARATOR_H_ | ||
|
||
|
||
|
||
#endif /* COMPARATOR_H_ */ | ||
|
||
#include "main.h" | ||
|
||
void maskPhaseInterrupts(); | ||
void changeCompInput(); | ||
void enableCompInterrupts(); | ||
|
||
extern char rising; | ||
extern char step; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
* bootloader.h | ||
* | ||
* Created on: Mar. 25, 2020 | ||
* Author: Alka | ||
*/ | ||
#include "main.h" | ||
#ifndef INC_EEPROM_H_ | ||
#define INC_EEPROM_H_ | ||
|
||
|
||
|
||
#endif /* INC_BOOTLOADER_H_ */ | ||
|
||
|
||
//void save_to_flash(uint8_t *data); | ||
//void read_flash(uint8_t* data, uint32_t address); | ||
//void save_to_flash_bin(uint8_t *data, int length, uint32_t add); | ||
void read_flash_bin(uint8_t* data , uint32_t add ,int out_buff_len); | ||
void save_flash_nolib(uint8_t *data, int length, uint32_t add); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
/* USER CODE BEGIN Header */ | ||
/** | ||
****************************************************************************** | ||
* @file : main.h | ||
* @brief : Header for main.c file. | ||
* This file contains the common defines of the application. | ||
****************************************************************************** | ||
* @attention | ||
* | ||
* <h2><center>© Copyright (c) 2020 STMicroelectronics. | ||
* All rights reserved.</center></h2> | ||
* | ||
* This software component is licensed by ST under BSD 3-Clause license, | ||
* the "License"; You may not use this file except in compliance with the | ||
* License. You may obtain a copy of the License at: | ||
* opensource.org/licenses/BSD-3-Clause | ||
* | ||
****************************************************************************** | ||
*/ | ||
/* USER CODE END Header */ | ||
|
||
/* Define to prevent recursive inclusion -------------------------------------*/ | ||
#ifndef __MAIN_H | ||
#define __MAIN_H | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/* Includes ------------------------------------------------------------------*/ | ||
#include "stm32g0xx_ll_adc.h" | ||
#include "stm32g0xx_ll_comp.h" | ||
#include "stm32g0xx_ll_exti.h" | ||
#include "stm32g0xx_ll_dma.h" | ||
#include "stm32g0xx_ll_iwdg.h" | ||
#include "stm32g0xx_ll_rcc.h" | ||
#include "stm32g0xx_ll_bus.h" | ||
#include "stm32g0xx_ll_system.h" | ||
#include "stm32g0xx_ll_cortex.h" | ||
#include "stm32g0xx_ll_utils.h" | ||
#include "stm32g0xx_ll_pwr.h" | ||
#include "stm32g0xx_ll_tim.h" | ||
#include "stm32g0xx_ll_gpio.h" | ||
#include "stm32g0xx_ll_usart.h" | ||
|
||
#if defined(USE_FULL_ASSERT) | ||
#include "stm32_assert.h" | ||
#endif /* USE_FULL_ASSERT */ | ||
|
||
/* Private includes ----------------------------------------------------------*/ | ||
/* USER CODE BEGIN Includes */ | ||
|
||
/* USER CODE END Includes */ | ||
|
||
/* Exported types ------------------------------------------------------------*/ | ||
/* USER CODE BEGIN ET */ | ||
|
||
/* USER CODE END ET */ | ||
|
||
/* Exported constants --------------------------------------------------------*/ | ||
/* USER CODE BEGIN EC */ | ||
|
||
/* USER CODE END EC */ | ||
|
||
/* Exported macro ------------------------------------------------------------*/ | ||
/* USER CODE BEGIN EM */ | ||
|
||
/* USER CODE END EM */ | ||
|
||
/* Exported functions prototypes ---------------------------------------------*/ | ||
void Error_Handler(void); | ||
|
||
/* USER CODE BEGIN EFP */ | ||
|
||
/* USER CODE END EFP */ | ||
|
||
/* Private defines -----------------------------------------------------------*/ | ||
/* USER CODE BEGIN Private defines */ | ||
|
||
/* USER CODE END Private defines */ | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* __MAIN_H */ | ||
|
||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* peripherals.h | ||
* | ||
* Created on: Sep. 26, 2020 | ||
* Author: Alka | ||
*/ | ||
|
||
#ifndef PERIPHERALS_H_ | ||
#define PERIPHERALS_H_ | ||
|
||
|
||
|
||
#endif /* PERIPHERALS_H_ */ | ||
|
||
#include "main.h" | ||
|
||
void initAfterJump(void); | ||
void initCorePeripherals(void); | ||
void SystemClock_Config(void); | ||
void MX_GPIO_Init(void); | ||
void MX_DMA_Init(void); | ||
void MX_ADC1_Init(void); | ||
void MX_COMP2_Init(void); | ||
void MX_COMP1_Init(void); | ||
void MX_TIM1_Init(void); | ||
void MX_TIM2_Init(void); | ||
void MX_TIM3_Init(void); | ||
void MX_TIM14_Init(void); | ||
void MX_TIM17_Init(void); | ||
void MX_TIM16_Init(void); | ||
void MX_IWDG_Init(void); | ||
void MX_TIM6_Init(void); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* serial_telemetry.h | ||
* | ||
* Created on: May 13, 2020 | ||
* Author: Alka | ||
*/ | ||
|
||
|
||
#include "main.h" | ||
|
||
#ifndef SERIAL_TELEMETRY_H_ | ||
#define SERIAL_TELEMETRY_H_ | ||
|
||
void makeTelemPackage(uint8_t temp, | ||
uint16_t voltage, | ||
uint16_t current, | ||
uint16_t consumption, | ||
uint16_t e_rpm); | ||
|
||
|
||
void telem_UART_Init(void); | ||
void send_telem_DMA(); | ||
|
||
#endif /* SERIAL_TELEMETRY_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/** | ||
****************************************************************************** | ||
* @file stm32_assert.h | ||
* @brief STM32 assert file. | ||
****************************************************************************** | ||
* @attention | ||
* | ||
* <h2><center>© Copyright (c) 2018 STMicroelectronics. | ||
* All rights reserved.</center></h2> | ||
* | ||
* This software component is licensed by ST under BSD 3-Clause license, | ||
* the "License"; You may not use this file except in compliance with the | ||
* License. You may obtain a copy of the License at: | ||
* opensource.org/licenses/BSD-3-Clause | ||
* | ||
****************************************************************************** | ||
*/ | ||
|
||
/* Define to prevent recursive inclusion -------------------------------------*/ | ||
#ifndef __STM32_ASSERT_H | ||
#define __STM32_ASSERT_H | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/* Exported types ------------------------------------------------------------*/ | ||
/* Exported constants --------------------------------------------------------*/ | ||
/* Includes ------------------------------------------------------------------*/ | ||
/* Exported macro ------------------------------------------------------------*/ | ||
#ifdef USE_FULL_ASSERT | ||
/** | ||
* @brief The assert_param macro is used for function's parameters check. | ||
* @param expr: If expr is false, it calls assert_failed function | ||
* which reports the name of the source file and the source | ||
* line number of the call that failed. | ||
* If expr is true, it returns no value. | ||
* @retval None | ||
*/ | ||
#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) | ||
/* Exported functions ------------------------------------------------------- */ | ||
void assert_failed(uint8_t* file, uint32_t line); | ||
#else | ||
#define assert_param(expr) ((void)0U) | ||
#endif /* USE_FULL_ASSERT */ | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* __STM32_ASSERT_H */ | ||
|
||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |
Oops, something went wrong.