MWLib is an awesome library for STM32F4 series developed with Keil MDK, based on C/C++ and STM32F4 Standard Peripheral Libraries. It provides developers for quick use of electronic modules, featuring easy configuration and simple access. Though the library is yet crude, it is planned to cover a bunch of sensors and common I/O devices.
This library is based on STM32F4 Standard Peripheral Libraries and follows its code style. The file mwlib.uvprojx is MDK project file. Source code under the folder user is in paired form of xxx.h and xxx.c, where xxx refers to model name of the device. There are code from STM32F4 Standard Peripheral Libraries under the folder fwlib and some tool functions in utils.c. The library covers several devices as listed:
- DRV8825 - Stepper motor driver carrier
- E18-D80NK - Infrared photoelectric sensor
- HC-SR04 - Ultrasonic distance sensor
- TB6612FNG - Motor drive module
- GP2Y0E03 - Distance sensor module
- OLED - I2C 12864 SSD1306 oled module
- MPU6050 - 3 axis accelerometer gyroscope sensor
- MPU9250 - 9 axis accelerometer gyroscope magnetometer sensor
- EC11 - 360 degree rotary encoder
- BMP280 - Absolute barometric pressure and temperature sensor
- SD/TF Card - Secure digital card(SD Card) and TransFlash(Micro SD/TF card)
- NRF24L01+ - 2.4GHz wireless RF transceiver module
- Servo - Analog servo (e.g., ES08A, MG90, MG995, etc)
- SI7021 - Humidity and temperature sensor module
- PMS7003 - Laser particle concentration sensor based on scattered light
- DHT11 - Basic & ultra low-cost digital temperature and humidity sensor
- XKCY25V - Intelligent non-contact liquid level sensor
- MQ7 - Carbon monoxide gas sensor
- GP2Y1010 - House dust, cigarette smoke sensor
- HCSR501 - PIR motion sensor
Software requirements:
- Windows 7 / 8 / 8.1 / 10
- Keil MDK uVersion5 or later
- STM32F4xx_DFP Pack v 2.13 or later
Of most devices in this library, you can simply use them as follows:
#include "xxx.h"
void fun()
{
//Initialize the device.
XXX_Init();
//Your code.
...
...
...
}If you want to help the MWLib project, here are some guidlines:
- Respect my coding style.
- Avoid to commit several features in one commit.
- Make your modification compact - don't reformat source code in your request.
Source code in the following files is released under GPLv3 license for non-commercial projects only. Contact me for commercial use. See license for details.
./user/drv8825.c
./user/drv8825.h
./user/e18d80nk.c
./user/e18d80nk.h
./user/gp2y0e03.c
./user/gp2y0e03.h
./user/hallencoder.c
./user/hallencoder.h
./user/hcsr04.c
./user/hcsr04.h
./user/key.c
./user/key.h
./user/led.c
./user/led.h
./user/tb6612fng.c
./user/tb6612fng.h
./user/oled/oled.c
./user/oled/oled.h
./user/mpu9250/mpu9250.c
./user/mpu9250/mpu9250.h
./user/mpu6050/mpu6050.c
./user/mpu6050/mpu6050.h
./user/ec11.c
./user/ec11.h
./user/bmp280.c
./user/bmp280.h
./user/nrf24l01.c
./user/nrf24l01.h
./user/servo.c
./user/servo.h
./user/si7021.c
./user/si7021.h
./user/pms7003.c
./user/pms7003.h
./user/beep.c
./user/beep.h
./user/hcsr501.c
./user/hcsr501.h
./user/mq7.c
./user/mq7.h
./user/xkcy25v.c
./user/skcy25v.h
- Embdefire
- Alientek
- Anyone who make contributions