Skip to content

Ultra-low power high performance 3-axis magnetometer library written in C for 32-bit ST Microcontrollers

License

Notifications You must be signed in to change notification settings

talhaSr/lis3mdl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LIS3MDL 3-Axis Magnetometer

Licence

Author: Talha Sarı

Description

The LIS3MDL is an ultra-low-power highperformance three-axis magnetic sensor. The LIS3MDL has user-selectable full scales of ±4/±8/±12/±16 gauss. The self-test capability allows the user to check the functioning of the sensor in the final application. The device may be configured to generate interrupt signals for magnetic field detection. The LIS3MDL includes an I2C serial bus interface that supports standard and fast mode (100 kHz and 400 kHz) and SPI serial standard interface. For more check datasheet: /doc/LIS3MDL_Datasheet.pdf

Features

  • Wide supply voltage, 1.9 V to 3.6 V
  • Independent IO supply (1.8 V)
  • ±4/±8/±12/±16 gauss selectable magnetic full scales
  • Continuous and single-conversion modes
  • 16-bit data output
  • Interrupt generator
  • Self-test
  • I2C/SPI digital output interface
  • Power-down mode / low-power mode
  • ECOPACK®, RoHS and “Green” compliant

Pin Description

LIS3MDL

Pin # Name Function
1 SCL I2C serial clock
2 Reserved Connect to GND
3 GND Connect to GND
4 C1 Capacitor connection (C1=100 nF)
5 VDD Power supply
6 VDD_IO Power supply for I/O pins
7 INT Interrupt
8 DRDY Data Ready
9 SA1 I2C less significant bit of the device address
10 CS I2C/SPI mode selection
11 SDA I2C serial data
12 Reserved Connect to GND

Note: Device's I2C address can be changed due to SA1 pin state;

  • Ox1C when SA1 grounded.
  • Ox1E when SA1 pulled to VDD.

About

This library is created for STM32 development environment and can be used only with STM32F series microcontrollers for now. Example project: /example

Note: This library requires HAL!

License

GNU General Public License v3.0