|
MetaWear C++ API
0.20.0
C++ implementation of the MetaWear protocol
|
Interacts with the general purpose I/O pins on the board. More...
#include "sensor_common.h"Go to the source code of this file.
Classes | |
| struct | MblMwGpioAnalogReadParameters |
| Additional parameters required for an enhanced analog read. More... | |
Enumerations | |
| enum | MblMwGpioPullMode { MBL_MW_GPIO_PULL_MODE_UP = 0 , MBL_MW_GPIO_PULL_MODE_DOWN , MBL_MW_GPIO_PULL_MODE_NONE } |
| Pin configuration types. | |
| enum | MblMwGpioAnalogReadMode { MBL_MW_GPIO_ANALOG_READ_MODE_ABS_REF = 0 , MBL_MW_GPIO_ANALOG_READ_MODE_ADC } |
| Read modes for analog input. More... | |
| enum | MblMwGpioPinChangeType { MBL_MW_GPIO_PIN_CHANGE_TYPE_RISING = 1 , MBL_MW_GPIO_PIN_CHANGE_TYPE_FALLING , MBL_MW_GPIO_PIN_CHANGE_TYPE_ANY } |
| Pin change types. More... | |
Functions | |
| METAWEAR_API MblMwDataSignal * | mbl_mw_gpio_get_analog_input_data_signal (MblMwMetaWearBoard *board, uint8_t pin, MblMwGpioAnalogReadMode mode) |
| Retrieves a data signal representing analog data See MblMwGpioAnalogReadMode for allowed mode values and see MetaWear datasheet for allowed pin values. More... | |
| METAWEAR_API MblMwDataSignal * | mbl_mw_gpio_get_digital_input_data_signal (MblMwMetaWearBoard *board, uint8_t pin) |
| Retrieves a data signal representing digital data See MetaWear datasheet for allowed pin values. More... | |
| METAWEAR_API MblMwDataSignal * | mbl_mw_gpio_get_pin_monitor_data_signal (MblMwMetaWearBoard *board, uint8_t pin) |
| Retrieves a data signal representing changes in digital data The monitor provides a callback anytime the value changes See MetaWear datasheet for allowed pin values. More... | |
| METAWEAR_API void | mbl_mw_gpio_set_pull_mode (const MblMwMetaWearBoard *board, uint8_t pin, MblMwGpioPullMode mode) |
| Sets the pin pull mode A GPIO pin can be pulled up (to high voltage), pulled down (to 0V), or left floating. More... | |
| METAWEAR_API void | mbl_mw_gpio_set_digital_output (const MblMwMetaWearBoard *board, uint8_t pin) |
| Sets the digital output state The GPIO pin is set as an output pin and turned on (high voltage) See MetaWear datasheet for allowed pin values. More... | |
| METAWEAR_API void | mbl_mw_gpio_clear_digital_output (const MblMwMetaWearBoard *board, uint8_t pin) |
| Clears the digital output state The GPIO pin is set as an output pin and turned off (0 voltage) See MetaWear datasheet for allowed pin values. More... | |
| METAWEAR_API void | mbl_mw_gpio_set_pin_change_type (const MblMwMetaWearBoard *board, uint8_t pin, MblMwGpioPinChangeType type) |
| Sets the pin change type to monitor The monitor provides a callback anytime the value changes by MblMwGpioPinChangeType when pin monitoring is on See MblMwGpioPinChangeType for allowed type values and see MetaWear datasheet for allowed pin values. More... | |
| METAWEAR_API void | mbl_mw_gpio_start_pin_monitoring (const MblMwMetaWearBoard *board, uint8_t pin) |
| Start pin monitoring. More... | |
| METAWEAR_API void | mbl_mw_gpio_stop_pin_monitoring (const MblMwMetaWearBoard *board, uint8_t pin) |
| Stop pin monitoring. More... | |
Variables | |
| const uint8_t | MBL_MW_GPIO_UNUSED_PIN = 0xff |
| Pin value indicating the pin setting is not used. | |
Interacts with the general purpose I/O pins on the board.
| METAWEAR_API void mbl_mw_gpio_clear_digital_output | ( | const MblMwMetaWearBoard * | board, |
| uint8_t | pin | ||
| ) |
Clears the digital output state The GPIO pin is set as an output pin and turned off (0 voltage) See MetaWear datasheet for allowed pin values.
| board | Board the pin is on |
| pin | GPIO pin to clear |
| METAWEAR_API MblMwDataSignal* mbl_mw_gpio_get_analog_input_data_signal | ( | MblMwMetaWearBoard * | board, |
| uint8_t | pin, | ||
| MblMwGpioAnalogReadMode | mode | ||
| ) |
Retrieves a data signal representing analog data See MblMwGpioAnalogReadMode for allowed mode values and see MetaWear datasheet for allowed pin values.
| board | Board to receive data from |
| pin | GPIO pin to read |
| mode | Read mode to use UINT32 is return signal data type |
| METAWEAR_API MblMwDataSignal* mbl_mw_gpio_get_digital_input_data_signal | ( | MblMwMetaWearBoard * | board, |
| uint8_t | pin | ||
| ) |
Retrieves a data signal representing digital data See MetaWear datasheet for allowed pin values.
| board | Board to receive data from |
| pin | GPIO pin to read UINT32 is return signal data type |
| METAWEAR_API MblMwDataSignal* mbl_mw_gpio_get_pin_monitor_data_signal | ( | MblMwMetaWearBoard * | board, |
| uint8_t | pin | ||
| ) |
Retrieves a data signal representing changes in digital data The monitor provides a callback anytime the value changes See MetaWear datasheet for allowed pin values.
| board | Board to receive data from |
| pin | GPIO pin to monitor UINT32 is return signal data type |
| METAWEAR_API void mbl_mw_gpio_set_digital_output | ( | const MblMwMetaWearBoard * | board, |
| uint8_t | pin | ||
| ) |
Sets the digital output state The GPIO pin is set as an output pin and turned on (high voltage) See MetaWear datasheet for allowed pin values.
| board | Board the pin is on |
| pin | GPIO pin to set |
| METAWEAR_API void mbl_mw_gpio_set_pin_change_type | ( | const MblMwMetaWearBoard * | board, |
| uint8_t | pin, | ||
| MblMwGpioPinChangeType | type | ||
| ) |
Sets the pin change type to monitor The monitor provides a callback anytime the value changes by MblMwGpioPinChangeType when pin monitoring is on See MblMwGpioPinChangeType for allowed type values and see MetaWear datasheet for allowed pin values.
| board | Board the pin is on |
| pin | GPIO pin to set |
| type | Change type to monitor |
| METAWEAR_API void mbl_mw_gpio_set_pull_mode | ( | const MblMwMetaWearBoard * | board, |
| uint8_t | pin, | ||
| MblMwGpioPullMode | mode | ||
| ) |
Sets the pin pull mode A GPIO pin can be pulled up (to high voltage), pulled down (to 0V), or left floating.
See MblMwGpioPullMode for allowed mode values
| board | Board the pin is on |
| pin | GPIO pin to modify |
| mode | New pull mode |
| METAWEAR_API void mbl_mw_gpio_start_pin_monitoring | ( | const MblMwMetaWearBoard * | board, |
| uint8_t | pin | ||
| ) |
Start pin monitoring.
| board | Board the pin is on |
| pin | GPIO pin to monitor |
| METAWEAR_API void mbl_mw_gpio_stop_pin_monitoring | ( | const MblMwMetaWearBoard * | board, |
| uint8_t | pin | ||
| ) |
Stop pin monitoring.
| board | Board the pin is on |
| pin | GPIO pin to stop monitoring |