Coder Social home page Coder Social logo

taejin-seong / stm32f103xx-module-libraries Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 12.26 MB

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

CSS 2.87% C 89.85% C++ 0.01% Makefile 6.88% Assembly 0.40%
stm32 hal dfplayer-mini nrf24l01 1602-lcd dotmatrix

stm32f103xx-module-libraries's Introduction

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

stm32f103xx-module-libraries's People

Contributors

taejin-seong avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.