MIP_SDK  v3.0.0
MicroStrain Communications Library for embedded systems
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
mip::commands_3dm::GpioConfig Struct Reference

#include <commands_3dm.hpp>

Classes

struct  PinMode
 
struct  Response
 

Public Types

enum  Feature : uint8_t {
  Feature::UNUSED = 0, Feature::GPIO = 1, Feature::PPS = 2, Feature::ENCODER = 3,
  Feature::TIMESTAMP = 4, Feature::UART = 5
}
 
enum  Behavior : uint8_t {
  Behavior::UNUSED = 0, Behavior::GPIO_INPUT = 1, Behavior::GPIO_OUTPUT_LOW = 2, Behavior::GPIO_OUTPUT_HIGH = 3,
  Behavior::PPS_INPUT = 1, Behavior::PPS_OUTPUT = 2, Behavior::ENCODER_A = 1, Behavior::ENCODER_B = 2,
  Behavior::TIMESTAMP_RISING = 1, Behavior::TIMESTAMP_FALLING = 2, Behavior::TIMESTAMP_EITHER = 3, Behavior::UART_PORT2_TX = 33,
  Behavior::UART_PORT2_RX = 34, Behavior::UART_PORT3_TX = 49, Behavior::UART_PORT3_RX = 50
}
 

Public Member Functions

auto asTuple () const
 
auto asTuple ()
 
void insert (Serializer &serializer) const
 Serialization. More...
 
void extract (Serializer &serializer)
 

Static Public Member Functions

static GpioConfig create_sld_all (::mip::FunctionSelector function)
 

Public Attributes

FunctionSelector function = static_cast<FunctionSelector>(0)
 Parameters. More...
 
uint8_t pin = 0
 GPIO pin number counting from 1. For save, load, and default function selectors, this can be 0 to select all pins. More...
 
Feature feature = static_cast<Feature>(0)
 Determines how the pin will be used. More...
 
Behavior behavior = static_cast<Behavior>(0)
 Select an appropriate value from the enumeration based on the selected feature (e.g. for PPS, select one of the values prefixed with PPS_.) More...
 
PinMode pin_mode
 GPIO configuration. May be restricted depending on device, pin, feature, and behavior. See device user manual. More...
 

Static Public Attributes

static constexpr const uint8_t DESCRIPTOR_SET = ::mip::commands_3dm::DESCRIPTOR_SET
 Descriptors. More...
 
static constexpr const uint8_t FIELD_DESCRIPTOR = ::mip::commands_3dm::CMD_GPIO_CONFIG
 
static constexpr const CompositeDescriptor DESCRIPTOR = {DESCRIPTOR_SET, FIELD_DESCRIPTOR}
 
static constexpr const char * NAME = "GpioConfig"
 
static constexpr const char * DOC_NAME = "GPIO Configuration"
 
static constexpr const bool HAS_FUNCTION_SELECTOR = true
 

Member Enumeration Documentation

◆ Behavior

Enumerator
UNUSED 

Use 0 unless otherwise specified.

GPIO_INPUT 

Pin will be an input. This can be used to stream or poll the value and is the default setting.

GPIO_OUTPUT_LOW 

Pin is an output initially in the LOW state. This state will be restored during system startup if the configuration is saved.

GPIO_OUTPUT_HIGH 

Pin is an output initially in the HIGH state. This state will be restored during system startup if the configuration is saved.

PPS_INPUT 

Pin will receive the pulse-per-second signal. Only one pin can have this behavior. This will only work if the PPS Source command is configured to GPIO.

PPS_OUTPUT 

Pin will transmit the pulse-per-second signal from the device.

ENCODER_A 

Encoder "A" quadrature input. Only one pin can have this behavior. The last command to set this behavior will take precedence.

ENCODER_B 

Encoder "B" quadrature input. Only one pin can have this behavior. The last command to set this behavior will take precedence.

TIMESTAMP_RISING 

Rising edges will be timestamped.

TIMESTAMP_FALLING 

Falling edges will be timestamped.

TIMESTAMP_EITHER 

Both rising and falling edges will be timestamped.

UART_PORT2_TX 

(0x21) UART port 2 transmit.

UART_PORT2_RX 

(0x22) UART port 2 receive.

UART_PORT3_TX 

(0x31) UART port 3 transmit.

UART_PORT3_RX 

(0x32) UART port 3 receive.

◆ Feature

Enumerator
UNUSED 

The pin is not used. It may be technically possible to read the pin state in this mode, but this is not guaranteed to be true of all devices or pins.

GPIO 

General purpose input or output. Use this for direct control of pin output state or to stream the state of the pin.

PPS 

Pulse per second input or output.

ENCODER 

Motor encoder/odometer input.

TIMESTAMP 

Precision Timestamping. Use with Event Trigger Configuration (0x0C,0x2E).

UART 

UART data or control lines.

Member Function Documentation

◆ asTuple() [1/2]

auto mip::commands_3dm::GpioConfig::asTuple ( )
inline

◆ asTuple() [2/2]

auto mip::commands_3dm::GpioConfig::asTuple ( ) const
inline

◆ create_sld_all()

static GpioConfig mip::commands_3dm::GpioConfig::create_sld_all ( ::mip::FunctionSelector  function)
inlinestatic

◆ extract()

void mip::commands_3dm::GpioConfig::extract ( Serializer serializer)

◆ insert()

void mip::commands_3dm::GpioConfig::insert ( Serializer serializer) const

Serialization.

Member Data Documentation

◆ behavior

Behavior mip::commands_3dm::GpioConfig::behavior = static_cast<Behavior>(0)

Select an appropriate value from the enumeration based on the selected feature (e.g. for PPS, select one of the values prefixed with PPS_.)

◆ DESCRIPTOR

constexpr const CompositeDescriptor mip::commands_3dm::GpioConfig::DESCRIPTOR = {DESCRIPTOR_SET, FIELD_DESCRIPTOR}
staticconstexpr

◆ DESCRIPTOR_SET

constexpr const uint8_t mip::commands_3dm::GpioConfig::DESCRIPTOR_SET = ::mip::commands_3dm::DESCRIPTOR_SET
staticconstexpr

Descriptors.

◆ DOC_NAME

constexpr const char* mip::commands_3dm::GpioConfig::DOC_NAME = "GPIO Configuration"
staticconstexpr

◆ feature

Feature mip::commands_3dm::GpioConfig::feature = static_cast<Feature>(0)

Determines how the pin will be used.

◆ FIELD_DESCRIPTOR

constexpr const uint8_t mip::commands_3dm::GpioConfig::FIELD_DESCRIPTOR = ::mip::commands_3dm::CMD_GPIO_CONFIG
staticconstexpr

◆ function

FunctionSelector mip::commands_3dm::GpioConfig::function = static_cast<FunctionSelector>(0)

Parameters.

◆ HAS_FUNCTION_SELECTOR

constexpr const bool mip::commands_3dm::GpioConfig::HAS_FUNCTION_SELECTOR = true
staticconstexpr

◆ NAME

constexpr const char* mip::commands_3dm::GpioConfig::NAME = "GpioConfig"
staticconstexpr

◆ pin

uint8_t mip::commands_3dm::GpioConfig::pin = 0

GPIO pin number counting from 1. For save, load, and default function selectors, this can be 0 to select all pins.

◆ pin_mode

PinMode mip::commands_3dm::GpioConfig::pin_mode

GPIO configuration. May be restricted depending on device, pin, feature, and behavior. See device user manual.


The documentation for this struct was generated from the following files: