{"id":15579935,"url":"https://github.com/neutree/stm32f103driverlib","last_synced_at":"2025-03-21T08:31:28.375Z","repository":{"id":100552710,"uuid":"63389602","full_name":"Neutree/STM32f103DriverLib","owner":"Neutree","description":"easier way to program on STM32 in C++","archived":false,"fork":false,"pushed_at":"2018-08-26T15:18:26.000Z","size":334,"stargazers_count":48,"open_issues_count":1,"forks_count":23,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-01T04:31:44.463Z","etag":null,"topics":["cpp","lib","sdk","stm32"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Neutree.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-07-15T03:44:04.000Z","updated_at":"2024-10-09T10:58:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"7092d51f-bc9d-4265-97e1-22fb3e3e275e","html_url":"https://github.com/Neutree/STM32f103DriverLib","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Neutree%2FSTM32f103DriverLib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Neutree%2FSTM32f103DriverLib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Neutree%2FSTM32f103DriverLib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Neutree%2FSTM32f103DriverLib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Neutree","download_url":"https://codeload.github.com/Neutree/STM32f103DriverLib/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244124187,"owners_count":20401685,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","lib","sdk","stm32"],"created_at":"2024-10-02T19:21:50.842Z","updated_at":"2025-03-21T08:31:28.364Z","avatar_url":"https://github.com/Neutree.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"[STM32f103 Peripherals Driver Lib](https://github.com/Neutree/STM32f103DriverLib)\r\n======\r\n\r\nTo make program on STM32 more easier, we packet every peripheral and module as a C++ class, mask operation steps instead of function-oriented interface.\r\n\r\n**e.g. How to use USART to send data**\r\n\r\n```cpp\r\n# include \"USART.h\"\r\nUSART com(1,115200);\r\nvoid main()\r\n{\r\n    com\u003c\u003c\"test string\\r\\n\";\r\n}\r\n```\r\n\r\n\r\n**e.g. Use temperature and humidity sensor**\r\n\r\n```cpp\r\n#include \"I2C.h\"\r\n#include \"Si7021.h\"\r\n#include \"USART.h\"\r\n#include \"TaskManager.h\"\r\n\r\nUSART log(1,115200);\r\nI2C i2c1(1);\r\nSi7021 tempHumi;\r\n\r\nint main()\r\n{\r\n  tempHumi.Init(\u0026i2c1);\r\n  while(1)\r\n  {\r\n    tempHumi.Update();\r\n\r\n    log\u003c\u003c\"temperature:\"\u003c\u003ctempHumi.GetTemperature()\u003c\u003c\"\\n\";\r\n    log\u003c\u003c\"humidity:\"\u003c\u003ctempHumi.GetHumidity()\u003c\u003c\"\\n\";\r\n\r\n    TaskManager::DelayMs(100);\r\n  }\r\n}\r\n```\r\n\r\n---------------------\r\n# How to use\r\n\r\n1. Install keil MDK 5 on windows\r\n2. clone or download this project to your PC\r\n```\r\ngit clone https://github.com/Neutree/STM32f103DriverLib.git\r\n```\r\n3. open example project in `example` folder with MDK5, compile and download to your board and run\r\n4. There's three files you should pay attention: `Main.cpp`,`Configuration.h`,`UserInterrupt.cpp`, code your code and config configuration.\r\n  * Uncomment what you need in `Configuration.h`\r\n  * And every one driver have one folder, you should see the header file before you start code, there's some attention and doc in the header file.\r\n\r\n# Convention\r\n\r\n## File encode format\r\n\r\nselect **UTF-8 without signature** before you start code\r\n\r\n\u003e keil-\u003eedit-\u003econfiguration-\u003eeditor-\u003eencoding\r\n \r\n## Folders\r\n\r\n`lib`：driver lib\r\n\u003e `lib/math/`: math lib\r\n\r\n\u003e `lib/onchip/`: driver releated to stm32\r\n\u003e\u003e `lib/onchip/driverName`: driver source code folder\r\n\r\n\r\n\u003e `lib/offchip/`: module driver not belong to stm32\r\n\r\n\u003e\u003e `lib/offchip/driverName`: driver source code folder\r\n\r\n`example`: driver demo\r\n\u003e `example/onchip/driverName`：example related to stm32\r\n\r\n\u003e `example/offchip/driverName`：module example not belong to stm32\r\n\r\n`template`：project template\r\n\r\n`tool`: tools\r\n\r\n# Driver Brief\r\n\r\n## On chip\r\n* **Interrupt**：片上外设中断管理，所有的中断相关的逻辑都在这里\r\n* **GPIO**：通用IO驱动，包括基本IO配置与设置引脚和读取引脚状态\r\n* **USART**：串口驱动，包括了串口1到串口4的驱动，发送可使用DMA，接收使用中断方式，每个串口使用单独的FIFO\r\n* **ADC**：ADC驱动\r\n* **I2C**：I2C驱动，包含了中断方式和DMA方式\r\n* **PWM**：PWM驱动\r\n* **Timer**：定时器驱动\r\n* **TaskManager**：使用systick作为时基，可用来获取系统时间戳、延时（包含软件延时）和定时调用函数\r\n* **Capture**：输入捕获，包括了定时器捕获和外部中断捕获\r\n* **Flash**：STM32内部Flash相关操作，包括对Flash的读写\r\n* **CAN**\r\n* **SPI**\r\n* **IWDG**\r\n\r\n\r\n## Module Driver\r\n* **LED**：基于GPIO和PWM对LED的相关操作，包括开、关、闪烁等\r\n* **esp8266**：esp8266是串口WIFI模块，基于USART对esp8266的相关操作，其中包括了驱动文件（esp8266.cpp）和应用层文件(SockeEsp8266.cpp),应用层文件是使用socket的接口进行通信的实现\r\n* **GPS**：使用USART对GPS模块的驱动\r\n* **HMC5883L**：磁力计，基于I2C通信的HMC5883L的驱动\r\n* **StepMotor**：步进电机驱动，基于GPIO进行控制\r\n* **MPU6050**：6轴惯导驱动，包括了角速度、加速度的读取\r\n* **RemoteControl**:RC遥控器驱动，包含了PWM输入捕获和PPM输入捕获，包括了中断方式和定时器输入捕获方式\r\n* **~~Ultrasonic~~** ~~：超声波驱动，包括了systick版本和定时器版本~~\r\n* **HMI**\r\n* **Si7021**: Temperature and humidity sensor\r\n* **PN53x**: RFID/NFC reader\r\n* **Relay**\r\n* **SPI Flash**\r\n* **Ethernet**: W5500 ethernet communication\r\n* **GNSS**: GNSS NMEA parser (GPS)\r\n* **ZPH01**\r\n* **SHARP_1014_PM2.5**\r\n* **MFRC522**\r\n* **MG996R**\r\n* **MZH14**\r\n* **yishan_PM2.5**\r\n* **Door**: Reed Switch\r\n* **HCHO**\r\n* **Joystick**\r\n\r\n\r\n\r\n## Code Style\r\nRefer [Here](https://github.com/neutree/simple-code-conventions)\r\n\r\n# Contributors\r\n\r\n[AllenWang](https://github.com/afshare)\r\n\r\nDanyuanhong\r\n\r\n[infiniteYuan](https://github.com/InfiniteYuan1)\r\n\r\n[lissettecarlr](https://github.com/lissettecarlr)\r\n\r\n[neucrack](http://neucrack.com)\r\n\r\n[xz1996](http://git.oschina.net/xz1996)\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneutree%2Fstm32f103driverlib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneutree%2Fstm32f103driverlib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneutree%2Fstm32f103driverlib/lists"}