Skip to content

Commit 8b1340d

Browse files
committed
Add v1.0 firmware
1 parent 378698a commit 8b1340d

File tree

109 files changed

+164146
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+164146
-0
lines changed

Firmware/.cproject

+266
Large diffs are not rendered by default.

Firmware/.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Debug
2+
Release/*
3+
!Release/*.hex
4+
5+
.vscode
6+
.settings

Firmware/.mxproject

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
[PreviousLibFiles]
2+
LibFiles=Drivers\STM32C0xx_HAL_Driver\Inc\stm32c0xx_ll_gpio.h;Drivers\STM32C0xx_HAL_Driver\Inc\stm32c0xx_ll_exti.h;Drivers\STM32C0xx_HAL_Driver\Inc\stm32c0xx_ll_system.h;Drivers\STM32C0xx_HAL_Driver\Inc\stm32c0xx_ll_adc.h;Drivers\STM32C0xx_HAL_Driver\Inc\stm32c0xx_ll_dma.h;Drivers\STM32C0xx_HAL_Driver\Inc\stm32c0xx_ll_dmamux.h;Drivers\STM32C0xx_HAL_Driver\Inc\stm32c0xx_ll_bus.h;Drivers\STM32C0xx_HAL_Driver\Inc\stm32c0xx_ll_cortex.h;Drivers\STM32C0xx_HAL_Driver\Inc\stm32c0xx_ll_rcc.h;Drivers\STM32C0xx_HAL_Driver\Inc\stm32c0xx_ll_utils.h;Drivers\STM32C0xx_HAL_Driver\Inc\stm32c0xx_ll_pwr.h;Drivers\STM32C0xx_HAL_Driver\Inc\stm32c0xx_ll_i2c.h;Drivers\STM32C0xx_HAL_Driver\Inc\stm32c0xx_ll_spi.h;Drivers\STM32C0xx_HAL_Driver\Src\stm32c0xx_ll_gpio.c;Drivers\STM32C0xx_HAL_Driver\Src\stm32c0xx_ll_exti.c;Drivers\STM32C0xx_HAL_Driver\Src\stm32c0xx_ll_adc.c;Drivers\STM32C0xx_HAL_Driver\Src\stm32c0xx_ll_dma.c;Drivers\STM32C0xx_HAL_Driver\Src\stm32c0xx_ll_rcc.c;Drivers\STM32C0xx_HAL_Driver\Src\stm32c0xx_ll_utils.c;Drivers\STM32C0xx_HAL_Driver\Src\stm32c0xx_ll_i2c.c;Drivers\STM32C0xx_HAL_Driver\Src\stm32c0xx_ll_spi.c;Drivers\STM32C0xx_HAL_Driver\Src\stm32c0xx_ll_pwr.c;Drivers\STM32C0xx_HAL_Driver\Inc\stm32c0xx_ll_gpio.h;Drivers\STM32C0xx_HAL_Driver\Inc\stm32c0xx_ll_exti.h;Drivers\STM32C0xx_HAL_Driver\Inc\stm32c0xx_ll_system.h;Drivers\STM32C0xx_HAL_Driver\Inc\stm32c0xx_ll_adc.h;Drivers\STM32C0xx_HAL_Driver\Inc\stm32c0xx_ll_dma.h;Drivers\STM32C0xx_HAL_Driver\Inc\stm32c0xx_ll_dmamux.h;Drivers\STM32C0xx_HAL_Driver\Inc\stm32c0xx_ll_bus.h;Drivers\STM32C0xx_HAL_Driver\Inc\stm32c0xx_ll_cortex.h;Drivers\STM32C0xx_HAL_Driver\Inc\stm32c0xx_ll_rcc.h;Drivers\STM32C0xx_HAL_Driver\Inc\stm32c0xx_ll_utils.h;Drivers\STM32C0xx_HAL_Driver\Inc\stm32c0xx_ll_pwr.h;Drivers\STM32C0xx_HAL_Driver\Inc\stm32c0xx_ll_i2c.h;Drivers\STM32C0xx_HAL_Driver\Inc\stm32c0xx_ll_spi.h;Drivers\CMSIS\Device\ST\STM32C0xx\Include\stm32c011xx.h;Drivers\CMSIS\Device\ST\STM32C0xx\Include\stm32c0xx.h;Drivers\CMSIS\Device\ST\STM32C0xx\Include\system_stm32c0xx.h;Drivers\CMSIS\Device\ST\STM32C0xx\Source\Templates\system_stm32c0xx.c;Drivers\CMSIS\Include\cachel1_armv7.h;Drivers\CMSIS\Include\cmsis_armcc.h;Drivers\CMSIS\Include\cmsis_armclang.h;Drivers\CMSIS\Include\cmsis_armclang_ltm.h;Drivers\CMSIS\Include\cmsis_compiler.h;Drivers\CMSIS\Include\cmsis_gcc.h;Drivers\CMSIS\Include\cmsis_iccarm.h;Drivers\CMSIS\Include\cmsis_version.h;Drivers\CMSIS\Include\core_armv81mml.h;Drivers\CMSIS\Include\core_armv8mbl.h;Drivers\CMSIS\Include\core_armv8mml.h;Drivers\CMSIS\Include\core_cm0.h;Drivers\CMSIS\Include\core_cm0plus.h;Drivers\CMSIS\Include\core_cm1.h;Drivers\CMSIS\Include\core_cm23.h;Drivers\CMSIS\Include\core_cm3.h;Drivers\CMSIS\Include\core_cm33.h;Drivers\CMSIS\Include\core_cm35p.h;Drivers\CMSIS\Include\core_cm4.h;Drivers\CMSIS\Include\core_cm55.h;Drivers\CMSIS\Include\core_cm7.h;Drivers\CMSIS\Include\core_cm85.h;Drivers\CMSIS\Include\core_sc000.h;Drivers\CMSIS\Include\core_sc300.h;Drivers\CMSIS\Include\core_starmc1.h;Drivers\CMSIS\Include\mpu_armv7.h;Drivers\CMSIS\Include\mpu_armv8.h;Drivers\CMSIS\Include\pac_armv81.h;Drivers\CMSIS\Include\pmu_armv8.h;Drivers\CMSIS\Include\tz_context.h;
3+
4+
[PreviousUsedCubeIDEFiles]
5+
SourceFiles=Core\Src\main.c;Core\Src\stm32c0xx_it.c;Drivers\STM32C0xx_HAL_Driver\Src\stm32c0xx_ll_gpio.c;Drivers\STM32C0xx_HAL_Driver\Src\stm32c0xx_ll_exti.c;Drivers\STM32C0xx_HAL_Driver\Src\stm32c0xx_ll_adc.c;Drivers\STM32C0xx_HAL_Driver\Src\stm32c0xx_ll_dma.c;Drivers\STM32C0xx_HAL_Driver\Src\stm32c0xx_ll_rcc.c;Drivers\STM32C0xx_HAL_Driver\Src\stm32c0xx_ll_utils.c;Drivers\STM32C0xx_HAL_Driver\Src\stm32c0xx_ll_i2c.c;Drivers\STM32C0xx_HAL_Driver\Src\stm32c0xx_ll_spi.c;Drivers\STM32C0xx_HAL_Driver\Src\stm32c0xx_ll_pwr.c;Drivers\CMSIS\Device\ST\STM32C0xx\Source\Templates\system_stm32c0xx.c;Core\Src\system_stm32c0xx.c;Drivers\STM32C0xx_HAL_Driver\Src\stm32c0xx_ll_gpio.c;Drivers\STM32C0xx_HAL_Driver\Src\stm32c0xx_ll_exti.c;Drivers\STM32C0xx_HAL_Driver\Src\stm32c0xx_ll_adc.c;Drivers\STM32C0xx_HAL_Driver\Src\stm32c0xx_ll_dma.c;Drivers\STM32C0xx_HAL_Driver\Src\stm32c0xx_ll_rcc.c;Drivers\STM32C0xx_HAL_Driver\Src\stm32c0xx_ll_utils.c;Drivers\STM32C0xx_HAL_Driver\Src\stm32c0xx_ll_i2c.c;Drivers\STM32C0xx_HAL_Driver\Src\stm32c0xx_ll_spi.c;Drivers\STM32C0xx_HAL_Driver\Src\stm32c0xx_ll_pwr.c;Drivers\CMSIS\Device\ST\STM32C0xx\Source\Templates\system_stm32c0xx.c;Core\Src\system_stm32c0xx.c;;;
6+
HeaderPath=Drivers\STM32C0xx_HAL_Driver\Inc;Drivers\CMSIS\Device\ST\STM32C0xx\Include;Drivers\CMSIS\Include;Core\Inc;
7+
CDefines=USE_FULL_LL_DRIVER;HSE_VALUE:8000000;HSE_STARTUP_TIMEOUT:100;LSE_STARTUP_TIMEOUT:5000;LSE_VALUE:32768;EXTERNAL_CLOCK_VALUE:12288000;HSI_VALUE:48000000;LSI_VALUE:32000;VDD_VALUE:3300;PREFETCH_ENABLE:0;INSTRUCTION_CACHE_ENABLE:1;DATA_CACHE_ENABLE:1;STM32C011xx;USE_FULL_LL_DRIVER;HSE_VALUE:8000000;HSE_STARTUP_TIMEOUT:100;LSE_STARTUP_TIMEOUT:5000;LSE_VALUE:32768;EXTERNAL_CLOCK_VALUE:12288000;HSI_VALUE:48000000;LSI_VALUE:32000;VDD_VALUE:3300;PREFETCH_ENABLE:0;INSTRUCTION_CACHE_ENABLE:1;DATA_CACHE_ENABLE:1;
8+
9+
[PreviousGenFiles]
10+
AdvancedFolderStructure=true
11+
HeaderFileListSize=3
12+
HeaderFiles#0=..\Core\Inc\stm32c0xx_it.h
13+
HeaderFiles#1=..\Core\Inc\stm32_assert.h
14+
HeaderFiles#2=..\Core\Inc\main.h
15+
HeaderFolderListSize=1
16+
HeaderPath#0=..\Core\Inc
17+
HeaderFiles=;
18+
SourceFileListSize=2
19+
SourceFiles#0=..\Core\Src\stm32c0xx_it.c
20+
SourceFiles#1=..\Core\Src\main.c
21+
SourceFolderListSize=1
22+
SourcePath#0=..\Core\Src
23+
SourceFiles=;
24+

Firmware/.project

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>SparkFun_OTOS_Firmware</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
10+
<triggers>clean,full,incremental,</triggers>
11+
<arguments>
12+
</arguments>
13+
</buildCommand>
14+
<buildCommand>
15+
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
16+
<triggers>full,incremental,</triggers>
17+
<arguments>
18+
</arguments>
19+
</buildCommand>
20+
</buildSpec>
21+
<natures>
22+
<nature>com.st.stm32cube.ide.mcu.MCUProjectNature</nature>
23+
<nature>com.st.stm32cube.ide.mcu.MCUCubeProjectNature</nature>
24+
<nature>org.eclipse.cdt.core.cnature</nature>
25+
<nature>org.eclipse.cdt.core.ccnature</nature>
26+
<nature>com.st.stm32cube.ide.mcu.MCUCubeIdeServicesRevAev2ProjectNature</nature>
27+
<nature>com.st.stm32cube.ide.mcu.MCUAdvancedStructureProjectNature</nature>
28+
<nature>com.st.stm32cube.ide.mcu.MCUSingleCpuProjectNature</nature>
29+
<nature>com.st.stm32cube.ide.mcu.MCURootProjectNature</nature>
30+
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
31+
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
32+
</natures>
33+
</projectDescription>

Firmware/Core/Inc/main.h

+132
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
/* USER CODE BEGIN Header */
2+
/**
3+
* In USER CODE sections, the following license applies:
4+
*
5+
* SPDX-License-Identifier: MIT
6+
*
7+
* Copyright (c) 2024 SparkFun Electronics
8+
*
9+
* Otherwise, the following license applies:
10+
11+
******************************************************************************
12+
* @file : main.h
13+
* @brief : Header for main.c file.
14+
* This file contains the common defines of the application.
15+
******************************************************************************
16+
* @attention
17+
*
18+
* Copyright (c) 2024 STMicroelectronics.
19+
* All rights reserved.
20+
*
21+
* This software is licensed under terms that can be found in the LICENSE file
22+
* in the root directory of this software component.
23+
* If no LICENSE file comes with this software, it is provided AS-IS.
24+
*
25+
******************************************************************************
26+
*/
27+
/* USER CODE END Header */
28+
29+
/* Define to prevent recursive inclusion -------------------------------------*/
30+
#ifndef __MAIN_H
31+
#define __MAIN_H
32+
33+
#ifdef __cplusplus
34+
extern "C" {
35+
#endif
36+
37+
/* Includes ------------------------------------------------------------------*/
38+
#include "stm32c0xx_ll_adc.h"
39+
#include "stm32c0xx_ll_i2c.h"
40+
#include "stm32c0xx_ll_rcc.h"
41+
#include "stm32c0xx_ll_bus.h"
42+
#include "stm32c0xx_ll_system.h"
43+
#include "stm32c0xx_ll_exti.h"
44+
#include "stm32c0xx_ll_cortex.h"
45+
#include "stm32c0xx_ll_utils.h"
46+
#include "stm32c0xx_ll_pwr.h"
47+
#include "stm32c0xx_ll_dma.h"
48+
#include "stm32c0xx_ll_spi.h"
49+
#include "stm32c0xx_ll_gpio.h"
50+
51+
#if defined(USE_FULL_ASSERT)
52+
#include "stm32_assert.h"
53+
#endif /* USE_FULL_ASSERT */
54+
55+
/* Private includes ----------------------------------------------------------*/
56+
/* USER CODE BEGIN Includes */
57+
58+
// Inlcude standard libraries here so we don't need to include everwhere else
59+
#include <stdint.h>
60+
#include <stdbool.h>
61+
#include <string.h>
62+
#include <stdio.h>
63+
#include <math.h>
64+
65+
/* USER CODE END Includes */
66+
67+
/* Exported types ------------------------------------------------------------*/
68+
/* USER CODE BEGIN ET */
69+
70+
/* USER CODE END ET */
71+
72+
/* Exported constants --------------------------------------------------------*/
73+
/* USER CODE BEGIN EC */
74+
75+
/* USER CODE END EC */
76+
77+
/* Exported macro ------------------------------------------------------------*/
78+
/* USER CODE BEGIN EM */
79+
80+
/* USER CODE END EM */
81+
82+
/* Exported functions prototypes ---------------------------------------------*/
83+
void Error_Handler(void);
84+
85+
/* USER CODE BEGIN EFP */
86+
87+
// Arduino style setup() and loop() functions
88+
void setup();
89+
void loop();
90+
91+
/* USER CODE END EFP */
92+
93+
/* Private defines -----------------------------------------------------------*/
94+
#define VCSEL_POW_Pin LL_GPIO_PIN_15
95+
#define VCSEL_POW_GPIO_Port GPIOC
96+
#define MEAS_1V8_Pin LL_GPIO_PIN_0
97+
#define MEAS_1V8_GPIO_Port GPIOA
98+
#define LSM_INT_Pin LL_GPIO_PIN_3
99+
#define LSM_INT_GPIO_Port GPIOA
100+
#define LSM_INT_EXTI_IRQn EXTI2_3_IRQn
101+
#define PAA_RST_Pin LL_GPIO_PIN_4
102+
#define PAA_RST_GPIO_Port GPIOA
103+
#define PAA_CS_Pin LL_GPIO_PIN_5
104+
#define PAA_CS_GPIO_Port GPIOA
105+
#define PAA_MOTION_Pin LL_GPIO_PIN_7
106+
#define PAA_MOTION_GPIO_Port GPIOA
107+
#define LSM_CS_Pin LL_GPIO_PIN_8
108+
#define LSM_CS_GPIO_Port GPIOA
109+
#define PAA_POW_Pin LL_GPIO_PIN_14
110+
#define PAA_POW_GPIO_Port GPIOC
111+
#ifndef NVIC_PRIORITYGROUP_0
112+
#define NVIC_PRIORITYGROUP_0 ((uint32_t)0x00000007) /*!< 0 bit for pre-emption priority,
113+
4 bits for subpriority */
114+
#define NVIC_PRIORITYGROUP_1 ((uint32_t)0x00000006) /*!< 1 bit for pre-emption priority,
115+
3 bits for subpriority */
116+
#define NVIC_PRIORITYGROUP_2 ((uint32_t)0x00000005) /*!< 2 bits for pre-emption priority,
117+
2 bits for subpriority */
118+
#define NVIC_PRIORITYGROUP_3 ((uint32_t)0x00000004) /*!< 3 bits for pre-emption priority,
119+
1 bit for subpriority */
120+
#define NVIC_PRIORITYGROUP_4 ((uint32_t)0x00000003) /*!< 4 bits for pre-emption priority,
121+
0 bit for subpriority */
122+
#endif
123+
124+
/* USER CODE BEGIN Private defines */
125+
126+
/* USER CODE END Private defines */
127+
128+
#ifdef __cplusplus
129+
}
130+
#endif
131+
132+
#endif /* __MAIN_H */

Firmware/Core/Inc/stm32_assert.h

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/* USER CODE BEGIN Header */
2+
/**
3+
******************************************************************************
4+
* @file stm32_assert.h
5+
* @brief STM32 assert file.
6+
******************************************************************************
7+
* @attention
8+
*
9+
* Copyright (c) 2018 STMicroelectronics.
10+
* All rights reserved.
11+
*
12+
* This software is licensed under terms that can be found in the LICENSE file
13+
* in the root directory of this software component.
14+
* If no LICENSE file comes with this software, it is provided AS-IS.
15+
*
16+
******************************************************************************
17+
*/
18+
/* USER CODE END Header */
19+
20+
/* Define to prevent recursive inclusion -------------------------------------*/
21+
#ifndef __STM32_ASSERT_H
22+
#define __STM32_ASSERT_H
23+
24+
#ifdef __cplusplus
25+
extern "C" {
26+
#endif
27+
28+
/* Exported types ------------------------------------------------------------*/
29+
/* Exported constants --------------------------------------------------------*/
30+
/* Includes ------------------------------------------------------------------*/
31+
/* Exported macro ------------------------------------------------------------*/
32+
#ifdef USE_FULL_ASSERT
33+
/**
34+
* @brief The assert_param macro is used for function's parameters check.
35+
* @param expr: If expr is false, it calls assert_failed function
36+
* which reports the name of the source file and the source
37+
* line number of the call that failed.
38+
* If expr is true, it returns no value.
39+
* @retval None
40+
*/
41+
#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
42+
/* Exported functions ------------------------------------------------------- */
43+
void assert_failed(uint8_t* file, uint32_t line);
44+
#else
45+
#define assert_param(expr) ((void)0U)
46+
#endif /* USE_FULL_ASSERT */
47+
48+
#ifdef __cplusplus
49+
}
50+
#endif
51+
52+
#endif /* __STM32_ASSERT_H */
53+

Firmware/Core/Inc/stm32c0xx_it.h

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
/* USER CODE BEGIN Header */
2+
/**
3+
******************************************************************************
4+
* @file stm32c0xx_it.h
5+
* @brief This file contains the headers of the interrupt handlers.
6+
******************************************************************************
7+
* @attention
8+
*
9+
* Copyright (c) 2024 STMicroelectronics.
10+
* All rights reserved.
11+
*
12+
* This software is licensed under terms that can be found in the LICENSE file
13+
* in the root directory of this software component.
14+
* If no LICENSE file comes with this software, it is provided AS-IS.
15+
*
16+
******************************************************************************
17+
*/
18+
/* USER CODE END Header */
19+
20+
/* Define to prevent recursive inclusion -------------------------------------*/
21+
#ifndef __STM32C0xx_IT_H
22+
#define __STM32C0xx_IT_H
23+
24+
#ifdef __cplusplus
25+
extern "C" {
26+
#endif
27+
28+
/* Private includes ----------------------------------------------------------*/
29+
/* USER CODE BEGIN Includes */
30+
31+
/* USER CODE END Includes */
32+
33+
/* Exported types ------------------------------------------------------------*/
34+
/* USER CODE BEGIN ET */
35+
36+
/* USER CODE END ET */
37+
38+
/* Exported constants --------------------------------------------------------*/
39+
/* USER CODE BEGIN EC */
40+
41+
/* USER CODE END EC */
42+
43+
/* Exported macro ------------------------------------------------------------*/
44+
/* USER CODE BEGIN EM */
45+
46+
/* USER CODE END EM */
47+
48+
/* Exported functions prototypes ---------------------------------------------*/
49+
void NMI_Handler(void);
50+
void HardFault_Handler(void);
51+
void SVC_Handler(void);
52+
void PendSV_Handler(void);
53+
void SysTick_Handler(void);
54+
void EXTI2_3_IRQHandler(void);
55+
void I2C1_IRQHandler(void);
56+
/* USER CODE BEGIN EFP */
57+
58+
/* USER CODE END EFP */
59+
60+
#ifdef __cplusplus
61+
}
62+
#endif
63+
64+
#endif /* __STM32C0xx_IT_H */

0 commit comments

Comments
 (0)