MetaWear C++ API  0.20.0
C++ implementation of the MetaWear protocol
Enumerations | Functions
multichanneltemperature.h File Reference

Interacts with various temperature sources. More...

#include "sensor_common.h"

Go to the source code of this file.

Enumerations

enum  MblMwTemperatureSource {
  MBL_MW_TEMPERATURE_SOURCE_INVALID = -1 , MBL_MW_TEMPERATURE_SOURCE_NRF_DIE = 0 , MBL_MW_TEMPERATURE_SOURCE_EXT_THERM , MBL_MW_TEMPERATURE_SOURCE_BMP280 ,
  MBL_MW_TEMPERATURE_SOURCE_PRESET_THERM
}
 Enumeration of the available temperature sourcs. More...
 
enum  MblMwMetaWearRChannel { MBL_MW_METAWEAR_R_CHANNEL_ON_DIE = 0 , MBL_MW_METAWEAR_R_CHANNEL_EXT_THERMISTOR }
 Channel IDs for the temperature sources on the MetaWear R board. More...
 
enum  MblMwMetaWearRProChannel { MBL_MW_METAWEAR_RPRO_CHANNEL_ON_DIE = 0 , MBL_MW_METAWEAR_RPRO_CHANNEL_ON_BOARD_THERMISTOR , MBL_MW_METAWEAR_RPRO_CHANNEL_EXT_THERMISTOR , MBL_MW_METAWEAR_RPRO_CHANNEL_BMP280 }
 CHannel IDs for the temperature sources on the MetaWear RPro board. More...
 

Functions

METAWEAR_API MblMwDataSignalmbl_mw_multi_chnl_temp_get_temperature_data_signal (const MblMwMetaWearBoard *board, uint8_t channel)
 Retrieves the data signal representing a temperature source The temperature is in C by default The temperature sensor can by the selected; it can be the on die sensor that is built in to the MCU, the on board thermistor, an external thermistor added to the GPIOs of the board or the BMP280. More...
 
METAWEAR_API void mbl_mw_multi_chnl_temp_configure_ext_thermistor (const MblMwMetaWearBoard *board, uint8_t channel, uint8_t data_pin, uint8_t pulldown_pin, uint8_t active_high)
 Configure the external thermistor If a thermistor is added to the GPIOs of the MetaWear, this function will enable the configuration. More...
 
METAWEAR_API MblMwTemperatureSource mbl_mw_multi_chnl_temp_get_source (const MblMwMetaWearBoard *board, uint8_t channel)
 Retrieve the temperature source type corresponding to a channel ID. More...
 
METAWEAR_API uint8_t mbl_mw_multi_chnl_temp_get_num_channels (const MblMwMetaWearBoard *board)
 Retrieve the number of available channels. More...
 

Detailed Description

Interacts with various temperature sources.

The functions in the file only work for boards running firmware v1.0.4 or higher

Enumeration Type Documentation

◆ MblMwMetaWearRChannel

Channel IDs for the temperature sources on the MetaWear R board.

Enumerator
MBL_MW_METAWEAR_R_CHANNEL_ON_DIE 

Temperature from the nRF chip.

MBL_MW_METAWEAR_R_CHANNEL_EXT_THERMISTOR 

Temperature from an external thermistor.

◆ MblMwMetaWearRProChannel

CHannel IDs for the temperature sources on the MetaWear RPro board.

Enumerator
MBL_MW_METAWEAR_RPRO_CHANNEL_ON_DIE 

Temperature from the nRF chip.

MBL_MW_METAWEAR_RPRO_CHANNEL_ON_BOARD_THERMISTOR 

Temperature from the on board thermistor.

MBL_MW_METAWEAR_RPRO_CHANNEL_EXT_THERMISTOR 

Temperature from an external thermistor.

MBL_MW_METAWEAR_RPRO_CHANNEL_BMP280 

Temperature from the BMP280 sensor.

◆ MblMwTemperatureSource

Enumeration of the available temperature sourcs.

Note that not all sources are present on all boards

Enumerator
MBL_MW_TEMPERATURE_SOURCE_INVALID 

Invalid temperature source.

MBL_MW_TEMPERATURE_SOURCE_NRF_DIE 

Temperature from the nRF chip.

MBL_MW_TEMPERATURE_SOURCE_EXT_THERM 

Tempertaure from an external thermistor.

MBL_MW_TEMPERATURE_SOURCE_BMP280 

Temperature from the BMP280 sensor.

MBL_MW_TEMPERATURE_SOURCE_PRESET_THERM 

Temperature from an internal thremistor.

Function Documentation

◆ mbl_mw_multi_chnl_temp_configure_ext_thermistor()

METAWEAR_API void mbl_mw_multi_chnl_temp_configure_ext_thermistor ( const MblMwMetaWearBoard board,
uint8_t  channel,
uint8_t  data_pin,
uint8_t  pulldown_pin,
uint8_t  active_high 
)

Configure the external thermistor If a thermistor is added to the GPIOs of the MetaWear, this function will enable the configuration.

Parameters
boardBoard the external thermistor is attached to
channelChannel ID of the external thermistor
data_pinGPIO pin reading the data
pulldown_pinGPIO pin the pulldown resistor is connected to
active_highZero if the pulldown pin is not active high, non-zero if active high

◆ mbl_mw_multi_chnl_temp_get_num_channels()

METAWEAR_API uint8_t mbl_mw_multi_chnl_temp_get_num_channels ( const MblMwMetaWearBoard board)

Retrieve the number of available channels.

Returns
Number of channel IDs

◆ mbl_mw_multi_chnl_temp_get_source()

METAWEAR_API MblMwTemperatureSource mbl_mw_multi_chnl_temp_get_source ( const MblMwMetaWearBoard board,
uint8_t  channel 
)

Retrieve the temperature source type corresponding to a channel ID.

Parameters
boardBoard to lookup the temperature source on
channelChannel ID to lookup
Returns
Source type of the channel ID, MBL_MW_TEMP_SOURCE_INVALID if channel ID is out of range

◆ mbl_mw_multi_chnl_temp_get_temperature_data_signal()

METAWEAR_API MblMwDataSignal* mbl_mw_multi_chnl_temp_get_temperature_data_signal ( const MblMwMetaWearBoard board,
uint8_t  channel 
)

Retrieves the data signal representing a temperature source The temperature is in C by default The temperature sensor can by the selected; it can be the on die sensor that is built in to the MCU, the on board thermistor, an external thermistor added to the GPIOs of the board or the BMP280.

Each board comes with a different configuration of temperature sensors, refer to the datasheet of your MetaWear.

Parameters
boardBoard to retrieve the signal from
channelChannel ID of the temperature source INT32 is return signal data type