Skip to content

Commit 3758afa

Browse files
graduateDesigngraduateDesign
authored andcommitted
stm32f103c8 device is ok
1 parent 6081a5a commit 3758afa

File tree

121 files changed

+12394
-45
lines changed

Some content is hidden

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

121 files changed

+12394
-45
lines changed

demo/stm32f103c8/Core/Inc/gpio.h

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/**
2+
******************************************************************************
3+
* @file gpio.h
4+
* @brief This file contains all the function prototypes for
5+
* the gpio.c file
6+
******************************************************************************
7+
* @attention
8+
*
9+
* <h2><center>&copy; Copyright (c) 2021 STMicroelectronics.
10+
* All rights reserved.</center></h2>
11+
*
12+
* This software component is licensed by ST under BSD 3-Clause license,
13+
* the "License"; You may not use this file except in compliance with the
14+
* License. You may obtain a copy of the License at:
15+
* opensource.org/licenses/BSD-3-Clause
16+
*
17+
******************************************************************************
18+
*/
19+
/* Define to prevent recursive inclusion -------------------------------------*/
20+
#ifndef __GPIO_H__
21+
#define __GPIO_H__
22+
23+
#ifdef __cplusplus
24+
extern "C" {
25+
#endif
26+
27+
/* Includes ------------------------------------------------------------------*/
28+
#include "main.h"
29+
30+
/* USER CODE BEGIN Includes */
31+
32+
/* USER CODE END Includes */
33+
34+
/* USER CODE BEGIN Private defines */
35+
36+
/* USER CODE END Private defines */
37+
38+
void MX_GPIO_Init(void);
39+
40+
/* USER CODE BEGIN Prototypes */
41+
42+
/* USER CODE END Prototypes */
43+
44+
#ifdef __cplusplus
45+
}
46+
#endif
47+
#endif /*__ GPIO_H__ */
48+
49+
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

demo/stm32f103c8/Core/Src/gpio.c

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/**
2+
******************************************************************************
3+
* @file gpio.c
4+
* @brief This file provides code for the configuration
5+
* of all used GPIO pins.
6+
******************************************************************************
7+
* @attention
8+
*
9+
* <h2><center>&copy; Copyright (c) 2021 STMicroelectronics.
10+
* All rights reserved.</center></h2>
11+
*
12+
* This software component is licensed by ST under BSD 3-Clause license,
13+
* the "License"; You may not use this file except in compliance with the
14+
* License. You may obtain a copy of the License at:
15+
* opensource.org/licenses/BSD-3-Clause
16+
*
17+
******************************************************************************
18+
*/
19+
20+
/* Includes ------------------------------------------------------------------*/
21+
#include "gpio.h"
22+
23+
/* USER CODE BEGIN 0 */
24+
25+
/* USER CODE END 0 */
26+
27+
/*----------------------------------------------------------------------------*/
28+
/* Configure GPIO */
29+
/*----------------------------------------------------------------------------*/
30+
/* USER CODE BEGIN 1 */
31+
32+
/* USER CODE END 1 */
33+
34+
/** Configure pins as
35+
* Analog
36+
* Input
37+
* Output
38+
* EVENT_OUT
39+
* EXTI
40+
*/
41+
void MX_GPIO_Init(void)
42+
{
43+
44+
/* GPIO Ports Clock Enable */
45+
__HAL_RCC_GPIOD_CLK_ENABLE();
46+
__HAL_RCC_GPIOA_CLK_ENABLE();
47+
48+
}
49+
50+
/* USER CODE BEGIN 2 */
51+
52+
/* USER CODE END 2 */
53+
54+
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

demo/stm32f103c8/Core/Src/main.c

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
/* USER CODE END Header */
2020
/* Includes ------------------------------------------------------------------*/
2121
#include "main.h"
22-
22+
#include "gpio.h"
23+
#include "pikascript.h"
2324
/* Private includes ----------------------------------------------------------*/
2425
/* USER CODE BEGIN Includes */
2526

@@ -47,7 +48,6 @@
4748

4849
/* Private function prototypes -----------------------------------------------*/
4950
void SystemClock_Config(void);
50-
static void MX_GPIO_Init(void);
5151
/* USER CODE BEGIN PFP */
5252

5353
/* USER CODE END PFP */
@@ -87,7 +87,7 @@ int main(void)
8787
MX_GPIO_Init();
8888
/* USER CODE BEGIN 2 */
8989
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_8, GPIO_PIN_RESET);
90-
90+
PikaObj *PikaMain = pikaScriptInit();
9191
/* USER CODE END 2 */
9292

9393
/* Infinite loop */
@@ -139,31 +139,6 @@ void SystemClock_Config(void)
139139
}
140140
}
141141

142-
/**
143-
* @brief GPIO Initialization Function
144-
* @param None
145-
* @retval None
146-
*/
147-
static void MX_GPIO_Init(void)
148-
{
149-
GPIO_InitTypeDef GPIO_InitStruct = {0};
150-
151-
/* GPIO Ports Clock Enable */
152-
__HAL_RCC_GPIOD_CLK_ENABLE();
153-
__HAL_RCC_GPIOA_CLK_ENABLE();
154-
155-
/*Configure GPIO pin Output Level */
156-
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_8, GPIO_PIN_RESET);
157-
158-
/*Configure GPIO pin : PA8 */
159-
GPIO_InitStruct.Pin = GPIO_PIN_8;
160-
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
161-
GPIO_InitStruct.Pull = GPIO_NOPULL;
162-
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
163-
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
164-
165-
}
166-
167142
/* USER CODE BEGIN 4 */
168143

169144
/* USER CODE END 4 */

demo/stm32f103c8/MDK-ARM/startup_stm32f103xb.s

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
3131
; </h>
3232

33-
Stack_Size EQU 0x400
33+
Stack_Size EQU 0x1000
3434

3535
AREA STACK, NOINIT, READWRITE, ALIGN=3
3636
Stack_Mem SPACE Stack_Size
@@ -41,7 +41,7 @@ __initial_sp
4141
; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
4242
; </h>
4343

44-
Heap_Size EQU 0x200
44+
Heap_Size EQU 0x3800
4545

4646
AREA HEAP, NOINIT, READWRITE, ALIGN=3
4747
__heap_base

0 commit comments

Comments
 (0)