ST Expansion SW Team / X_NUCLEO_IKS01A2_SPI3W

Dependencies:   ST_INTERFACES X_NUCLEO_COMMON_SPI3W

Dependents:   sensor-node-ble

Fork of X_NUCLEO_IKS01A2 by Licio Mapelli

Embed: (wiki syntax)

« Back to documentation index

XNucleoIKS01A2 Class Reference

Class XNucleoIKS01A2 is intended to represent the MEMS Inertial & Environmental Nucleo Expansion Board with the same name. More...

#include <XNucleoIKS01A2.h>

Static Public Member Functions

static XNucleoIKS01A2instance (DevI2C *ext_i2c=NULL, PinName int1=IKS01A2_PIN_LSM6DSL_INT1, PinName int2=IKS01A2_PIN_LSM6DSL_INT2)
 Get singleton instance.
static XNucleoIKS01A2instance (PinName sda, PinName scl, PinName int1=IKS01A2_PIN_LSM6DSL_INT1, PinName int2=IKS01A2_PIN_LSM6DSL_INT2)
 Get singleton instance.

Protected Member Functions

 XNucleoIKS01A2 (DevI2C *ext_i2c, PinName int1, PinName int2)
 Constructor.

Detailed Description

Class XNucleoIKS01A2 is intended to represent the MEMS Inertial & Environmental Nucleo Expansion Board with the same name.

The expansion board is featuring basically four IPs:

  1. a HTS221 Relative Humidity and Temperature Sensor
  2. a LSM303AGR 3-Axis Magnetometer and 3D Acceleromenter
  3. a LPS22HB MEMS Pressure Sensor (and Temperature Sensor)
  4. and a LSM6DSL 3D Acceleromenter and 3D Gyroscope

The expansion board features also a DIL 24-pin socket which makes it possible to add further MEMS adapters and other sensors (e.g. UV index).

It is intentionally implemented as a singleton because only one X_NUCLEO_IKS01A2 at a time might be deployed in a HW component stack.
In order to get the singleton instance you have to call class method `Instance()`, e.g.:

 // Inertial & Environmental expansion board singleton instance
 static X_NUCLEO_IKS01A2 *<TODO>_expansion_board = X_NUCLEO_IKS01A2::Instance();

Definition at line 81 of file XNucleoIKS01A2.h.


Constructor & Destructor Documentation

XNucleoIKS01A2 ( DevI2C *  ext_i2c,
PinName  int1,
PinName  int2 
) [protected]

Constructor.

Definition at line 51 of file XNucleoIKS01A2.cpp.


Member Function Documentation

XNucleoIKS01A2 * instance ( DevI2C *  ext_i2c = NULL,
PinName  int1 = IKS01A2_PIN_LSM6DSL_INT1,
PinName  int2 = IKS01A2_PIN_LSM6DSL_INT2 
) [static]

Get singleton instance.

Returns:
a pointer to the initialized singleton instance of class XNucleoIKS01A2. A return value of NULL indicates an out of memory situation.
Parameters:
[in]ext_i2c(optional) pointer to an instance of DevI2C to be used for communication on the expansion board. Defaults to NULL. Taken into account only on the very first call of one of the 'Instance' functions. If not provided a new DevI2C will be created with standard configuration parameters. The used DevI2C object gets saved in instance variable dev_i2c.
[in]int1LSM6DSL INT1 pin. Taken into account only on the very first call of one of the 'Instance' functions. It maps the INT1 pin for LSM6DSL. Defaults to IKS01A2_PIN_LSM6DSL_INT1.
[in]int2LSM6DSL INT1 pin. Taken into account only on the very first call of one of the 'Instance' functions. It maps the INT2 pin for LSM6DSL. Defaults to IKS01A2_PIN_LSM6DSL_INT2.

Definition at line 83 of file XNucleoIKS01A2.cpp.

XNucleoIKS01A2 * instance ( PinName  sda,
PinName  scl,
PinName  int1 = IKS01A2_PIN_LSM6DSL_INT1,
PinName  int2 = IKS01A2_PIN_LSM6DSL_INT2 
) [static]

Get singleton instance.

Returns:
a pointer to the initialized singleton instance of class X_NUCLEO_IKS01A1. A return value of NULL indicates an out of memory situation.
Parameters:
[in]sdaI2C data line pin. Taken into account only on the very first call of one of the 'Instance' functions. A new DevI2C will be created based on parameters 'sda' and 'scl'. The used DevI2C object gets saved in instance variable dev_i2c.
[in]sclI2C clock line pin. Taken into account only on the very first call of one of the 'Instance' functions. A new DevI2C will be created based on parameters 'sda' and 'scl'. The used DevI2C object gets saved in instance variable dev_i2c.
[in]int1LSM6DSL INT1 pin. Taken into account only on the very first call of one of the 'Instance' functions. It maps the INT1 pin for LSM6DSL. Defaults to IKS01A2_PIN_LSM6DSL_INT1.
[in]int2LSM6DSL INT1 pin. Taken into account only on the very first call of one of the 'Instance' functions. It maps the INT2 pin for LSM6DSL. Defaults to IKS01A2_PIN_LSM6DSL_INT2.

Definition at line 114 of file XNucleoIKS01A2.cpp.