Component: Gyroscope 3 Axis SPI (L3GD20) (Sensors)

From Flowcode Help
Jump to navigationJump to search


Author Matrix TSL
Version 2.0 (Release)
Category Sensors


Image Gyroscope 3_Axis SPI (L3GD20) component

Allows access to a three axis digital gyroscope via an SPI interface. Useful for gaming, VR, motion control, navitagion and robotics.

Examples

No additional examples


Downloadable macro reference

SampleDevice

Collects the gyro readings from the device.

Parameters

This macro has no parameters


Return value

This call does not return a value


GetGyroReading

Collects one of the gyroscope readings from the last sample.

Parameters

BYTE Axis
0=X, 1=Y, 2=Z


Return value

INT


ReadRegister

Reads a single register from the gyroscope and returns the value as a byte.

Parameters

BYTE Address


Return value

BYTE


WriteRegister

Writes a single register on the gyroscope.

Parameters

BYTE Address
BYTE Data


Return value

This call does not return a value


Initialise

Initialises the SPI bus ready to communicate with the sensor.

Parameters

This macro has no parameters


Return value

This call does not return a value


Simulation macro reference

This component does not contain any simulation macros


Property reference

Data Rate

This property is of type Fixed list of ints and can be referenced with the variable name DataRate.

Rate that the gyroscope is internally sampled and registers updated.

Bandwidth Selection

This property is of type Fixed list of ints and can be referenced with the variable name Bandwidth.

Linked with data rate, See device datasheet table 21.

Full Scale Selection

This property is of type Fixed list of ints and can be referenced with the variable name FSS.

No additional information


Filter Enable

This property is of type True or false and can be referenced with the variable name FiltEn.

No additional information


Channel

This property is of type Fixed list of ints and can be referenced with the variable name group1::cal_spi1::CHANNEL.

SPI Channel selector

Prescale

This property is of type Fixed list of ints and can be referenced with the variable name group1::cal_spi1::PR_SCALE.

Prescale option selector

MOSI

This property is of type Single digital pin and can be referenced with the variable name group1::cal_spi1::MOSI.

SPI Data Out Pin SDO - Also Known as Master Out Slave In (MOSI) when used in Master mode.

MISO

This property is of type Single digital pin and can be referenced with the variable name group1::cal_spi1::MISO.

SPI Data In Pin SDI - Also Known as Master In Slave Out (MISO) when used in Master mode.

CLK

This property is of type Single digital pin and can be referenced with the variable name group1::cal_spi1::CLK.

SPI Clock Pin CLK - The Clock signal is driven by the SPI master.

CS / SS

This property is of type Single digital pin and can be referenced with the variable name group1::cal_spi1::SS.

Chip Select / Slave Select Pin

Master Mode: General purpose output pin used to select the remote SPI device.

Slave Mode: Hardware chip select pin input used to select the SPI device.

Scope Traces

This property is of type True or false and can be referenced with the variable name group1::cal_spi1::ScopeTraces.

Selects if the scope traces are automatically generated or not

Console Data

This property is of type True or false and can be referenced with the variable name group1::cal_spi1::ConsoleData.

Selects if the console data is automatically generated or not

Injector

This property is of type Fixed list of ints and can be referenced with the variable name group1::cal_spi1::Injector.

No additional information