Skip to content

taejin-seong/STM32F103XX-Module-Libraries

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

34 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Dev environment

IDE

  • STM32CubeIDE 1.6.0
  • STM32CubeMX

Development Board

  • STM32F103C8T6 (Black Pill Board)

Component

Part Name Image Link Implementation
DFplayer Mini πŸ“Œ βœ“
NRF24L01 πŸ“Œ βœ“
1602 CLCD With I2C πŸ“Œ βœ“
8*8 Dot Matrix With MAX7219 πŸ“Œ βœ“

Where's the file?

πŸ“‚
DFplayer Mini

- Β  stm32f103_fw_module β†’ src β†’ common β†’ hw β†’ include β†’ dfplayer.h
- Β  stm32f103_fw_module β†’ src β†’ hw β†’ driver β†’ dfplayer.c
- Β  stm32f103_fw_module β†’ src β†’ ap β†’ ap.c β†’ void apDFPlayerTest(void){...}

NRF24L01

- Β  stm32f103_fw_module β†’ src β†’ common β†’ hw β†’ include β†’ nrf24l01.h
- Β  stm32f103_fw_module β†’ src β†’ hw β†’ driver β†’ nrf24l01.c
- Β  stm32f103_fw_module β†’ src β†’ ap β†’ ap.c β†’ void apNRF24L01TxTest(void){...}
- Β  stm32f103_fw_module β†’ src β†’ ap β†’ ap.c β†’ void apNRF24L01RxTest(void){...}

1602 CLCD With I2C

- Β  stm32f103_fw_module β†’ src β†’ common β†’ hw β†’ include β†’ clcd.h
- Β  stm32f103_fw_module β†’ src β†’ hw β†’ driver β†’ clcd.c
- Β  stm32f103_fw_module β†’ src β†’ ap β†’ ap.c β†’ void apCLCDTest(void){...}

8*8 Dot Matrix With MAX7219

- Β  stm32f103_fw_module β†’ src β†’ common β†’ hw β†’ include β†’ max7219.h
- Β  stm32f103_fw_module β†’ src β†’ common β†’ hw β†’ include β†’ max7219_dotmatrix.h
- Β  stm32f103_fw_module β†’ src β†’ hw β†’ driver β†’ max7219.c
- Β  stm32f103_fw_module β†’ src β†’ hw β†’ driver β†’ max7219_dotmatrix.c
- Β  stm32f103_fw_module β†’ src β†’ ap β†’ ap.c β†’ void apDotMatrixTest(void){...}

Port Allocation Table

πŸ“Œ




Cube MX Setting

Clock Configuration

πŸ“Œ
β€’ Using HSE (High Speed External)





Pinout

πŸ“Œ




Peripheral & Core Configuration

1. UART1 & UART2

πŸ“Œ
β€’ The parameters of uart1 & uart2 are the same
β€’ You can change parameter settings in uart.c



2. SPI1 & SPI2

πŸ“Œ
β€’ You can change parameter settings in spi.c

SPI1



SPI2



3. I2C1

πŸ“Œ
β€’ You can change parameter settings in i2c.c



4. GPIO

πŸ“Œ


5. DMA

πŸ“Œ
β€’ USART1,USART2 DMA Request Setting
Β Β Β Β Β -Β [USART1_RX, USART2_RX]Β :Β Β Mode β†’ Circular
Β Β Β Β Β -Β [USART1_TX, USART2_TX]Β :Β Β Mode β†’ Normal (All Default)



6. NVIC

πŸ“Œ



How to use

ν…ŒμŠ€νŠΈλ₯Ό ν•˜κΈ° μœ„ν•΄μ„œλŠ” stm32f103_fw_module β†’ src β†’ main.c μ—μ„œ 주석을 ν•΄μ œ λ˜λŠ” μ„€μ •ν•΄μ•Ό ν•©λ‹ˆλ‹€.

#include "main.h"

int main(void)
{
	hwInit();
	apInit();

/* Choose  Test Function */

  	apBoardTest();
//	apUartTest();
//	apGpioTest();
//      apDFPlayerTest();
//	apNRF24L01RxTest();
//	apNRF24L01TxTest();
//      apCLCDTest();
//      apDotMatrixTest();

    return 0;
}

Note

1.

clcd.h와 max7219.h의 #defineμ—μ„œ 0x00~0x0f 뢀뢄이 μ€‘λ³΅λ˜μ–΄ 였λ₯˜κ°€ λ°œμƒν•©λ‹ˆλ‹€. λ”°λΌμ„œ clcd와 dot matrixλŠ” λ™μ‹œμ— ν…ŒμŠ€νŠΈν•  수 μ—†μŠ΅λ‹ˆλ‹€. μ–‘μͺ½(clcd & dot matrix)을 λ™μ‹œμ— ν…ŒμŠ€νŠΈν•˜λ €λ©΄ max7219.h의 #define 0x00 ~0x0f 뢀뢄을 static constν•˜κ²Œ μ„ μ–Έν•˜μ—¬ μ‚¬μš©ν•΄μ•Όν•©λ‹ˆλ‹€.

An error occurs due to overlapping parts 0x00~0x0f in #define of clcd.h and max7219.h. Therefore, clcld and dot matrix cannot be tested at the same time. To test both simultaneously (clcd & dot matrix), you must use the static const declaration of #define 0x00 ~ 0x0f (max7219.h).

2.

ν”„λ‘œμ νŠΈλ₯Ό λΉŒλ“œν•  λ•ŒλŠ” λ‹€μŒ κ²½λ‘œμ— μžˆλŠ” 폴더λ₯Ό λΉŒλ“œ 및 디버그 ν•­λͺ©μ—μ„œ μ œμ™Έν•΄μ•Ό ν•©λ‹ˆλ‹€.
When you build a project, you must exclude folders in the following paths from the build and debug entries:

  • stm32f411ceu6_fw_module β†’ src β†’ lib β†’ Core

How to exclude

πŸ“Œ
β€’ Click Core folder and proceed with the following steps.

γ€€γ€€γ€€



β€’ The results are as follows.





Test Pic

🚩
DFplayer Mini


NRF24L01


1602 CLCD With I2C


8*8 Dot Matrix With MAX7219


Refer to

8x8 Dot Matrix : https://github.com/eziya/STM32_HAL_MAX7219_8x8_MATRIX

About

Implement various module drivers based on STM32F130C8T6 (Balk fill dev board)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published