M5Unit-EXTIO 0.0.1 git rev:3b9c5bf
Loading...
Searching...
No Matches
m5::unit::UnitExtIO2 Class Reference

Extend I/O Unit2. More...

#include <unit_ExtIO2.hpp>

Inheritance diagram for m5::unit::UnitExtIO2:

Classes

struct  config_t
 Settings for begin. More...
 

Public Member Functions

 UnitExtIO2 (const uint8_t addr=DEFAULT_ADDRESS)
 
virtual bool begin () override
 
Settings for begin
config_t config ()
 Gets the configration.
 
void config (const config_t &cfg)
 Set the configration.
 
Firmware version
uint8_t firmwareVersion () const
 Gets the inner firmware version.
 
bool readFirmwareVersion (uint8_t &version)
 Read the firmware version.
 
Mode
extio2::Mode mode (const uint8_t pin)
 Gets the inner mode.
 
bool readMode (extio2::Mode &mode, const uint8_t pin)
 Read the mode of the specified pin.
 
bool readAllMode (extio2::Mode mode[NUMBER_OF_PINS])
 Read the mode of all pins.
 
bool writeMode (const uint8_t pin, const extio2::Mode mode)
 Write the mode of the specified pin.
 
bool writePinBitsMode (const uint8_t pin_bits, const extio2::Mode mode)
 Write the mode of the specified pin bits.
 
bool writeAllMode (const extio2::Mode mode)
 Write the mode of all pins.
 
bool writeAllMode (const extio2::Mode mode[NUMBER_OF_PINS])
 Write the mode of all pins.
 
Digiat input
bool readDigitalInput (bool &high, const uint8_t pin)
 Read the digital input from the specified pin.
 
bool readPinBitsDigitalInput (uint8_t &high_bits, const uint8_t pin_bits)
 Read the digital input from the specified pin bits.
 
bool readAllDigitalInput (uint8_t &high_bits)
 Read the digital input from all pins.
 
Digital output
bool writeDigitalOutput (const uint8_t pin, const bool high)
 Write the digital output to the specified pin.
 
bool writeDigitalOutputHigh (const uint8_t pin)
 Write the digital output HIGH to the specified pin.
 
bool writeDigitalOutputLow (const uint8_t pin)
 Write the digital output LOW to the specified pin.
 
template<typename T , typename std::enable_if< std::is_same< T, bool >::value, std::nullptr_t >::type = nullptr>
bool writePinBitsDigitalOutput (const uint8_t pin_bits, const T high)
 Write the digital output to the specified pin bits.
 
template<typename T , typename std::enable_if<!std::is_same< T, bool >::value &&std::is_integral< T >::value, std::nullptr_t >::type = nullptr>
bool writePinBitsDigitalOutput (const uint8_t pin_bits, const T high_bits)
 Write the digital output to the specified pin bits.
 
bool writePinBitsDigitalOutputHigh (const uint8_t pin_bits)
 Write the digital output HIGH to the specified pin bits.
 
bool writePinBitsDigitalOutputLow (const uint8_t pin_bits)
 Write the digital output LOW to the specified pin bits.
 
bool writeAllDigitalOutput (const bool high)
 Write the digital output to all pins.
 
bool writeAllDigitalOutputHigh ()
 Write the digital output HIGH to all pins.
 
bool writeAllDigitalOutputLow ()
 Write the digital output LOW to all pins.
 
Analog input
Note
Analog 8 bits range 0 - 255
Analog 12 bits range 0 - 4095
bool readAnalogInput (uint16_t &value, const uint8_t pin, const extio2::AnalogMode amode)
 Read the analog input from the specified pin.
 
bool readAnalogInput8 (uint16_t &value, const uint8_t pin)
 Read the analog input 8 bits from the specified pin.
 
bool readAnalogInput12 (uint16_t &value, const uint8_t pin)
 Read the analog input 12 bits from the specified pin.
 
bool readPinBitsAnalogInput (uint16_t values[NUMBER_OF_PINS], const uint8_t pin_bits, const extio2::AnalogMode amode)
 Read the analog input from the specified pin bits.
 
bool readPinBitsAnalogInput8 (uint16_t values[NUMBER_OF_PINS], const uint8_t pin_bits)
 Read the analog input 8 bits from the specified pin bits.
 
bool readPinBitsAnalogInput12 (uint16_t values[NUMBER_OF_PINS], const uint8_t pin_bits)
 Read the analog input 12 bits from the specified pin bits.
 
bool readAllAnalogInput (uint16_t values[NUMBER_OF_PINS], const extio2::AnalogMode amode)
 Read the analog input from all pins.
 
bool readAllAnalogInput8 (uint16_t values[NUMBER_OF_PINS])
 Read the analog input 8 bits from all pins.
 
bool readAllAnalogInput12 (uint16_t values[NUMBER_OF_PINS])
 Read the analog input 12 bits from all pins.
 
Servo control
Note
Valid angle degree range 0 - 180
Valid pulse range 500 - 2500
bool readServoAngle (uint8_t &degree, const uint8_t pin)
 Read the servo angle from the specified pin.
 
bool readPinBitsServoAngle (uint8_t degrees[NUMBER_OF_PINS], const uint8_t pin_bits)
 Read the servo angle from the specified pin.
 
bool readAllServoAngle (uint8_t degrees[NUMBER_OF_PINS])
 Read the servo angle from all pins.
 
bool writeServoAngle (const uint8_t pin, const uint8_t degree)
 Write the servo angle to the specified pin.
 
bool writePinBitsServoAngle (const uint8_t pin_bits, const uint8_t degree)
 Write the servo angle to the specified pin bits.
 
bool writeAllServoAngle (const uint8_t degree)
 Write the servo angle to all pins.
 
bool readServoPulse (uint16_t &pulse, const uint8_t pin)
 Read the servo pulse from the specified pin.
 
bool readPinBitsServoPulse (uint16_t pulses[NUMBER_OF_PINS], const uint8_t pin_bits)
 Read the servo pulse from the specified pin.
 
bool readAllServoPulse (uint16_t pulses[NUMBER_OF_PINS])
 Read the servo pulse from all pins.
 
bool writeServoPulse (const uint8_t pin, const uint16_t pulse)
 Write the servo pulse to the specified pin.
 
bool writePinBitsServoPulse (const uint8_t pin_bits, const uint16_t pulse)
 Write the servo pulse to the specified pin bits.
 
bool writeAllServoPulse (const uint16_t pulse)
 Write the servo pulse to all pins.
 
LED control
bool readLEDColor (uint32_t &rgb888, const uint8_t pin)
 Read the LED RGB888 from the specified pin.
 
bool readPinBitsLEDColor (uint32_t rgb888[NUMBER_OF_PINS], const uint8_t pin_bits)
 Read the LED RGB888 from the specified pin.
 
bool readAllLEDColor (uint32_t rgb888[NUMBER_OF_PINS])
 Read the LED RGB888 from all pins.
 
bool writeLEDColor (const uint8_t pin, const uint32_t rgb888)
 Write the LED RGB888 to the specified pin.
 
bool writeLEDColor (const uint8_t pin, const uint8_t r, const uint8_t g, const uint8_t b)
 Write the LED RGB888 to the specified pin.
 
bool writePinBitsLEDColor (const uint8_t pin_bits, const uint32_t rgb888)
 Write the LED RGB888 to the specified pin bits.
 
bool writePinBitsLEDColor (const uint8_t pin_bits, const uint8_t r, const uint8_t g, const uint8_t b)
 Write the LED RGB888 to the specified pin.
 
bool writeAllLEDColor (const uint32_t rgb888)
 Write the LED RGB888 to all pins.
 
bool writeAllLEDColor (const uint8_t r, const uint8_t g, const uint8_t b)
 Write the LED RGB888 to all pins.
 
I2C Address
Warning
Handling warning
Repeated writing may cause partition damage
bool changeI2CAddress (const uint8_t i2c_address)
 Change device I2C address.
 
bool readI2CAddress (uint8_t &i2c_address)
 Read device I2C address.
 

Static Public Attributes

static constexpr uint8_t NUMBER_OF_PINS {8}
 The number of pins.
 
Valid range
static constexpr uint8_t MIN_ANALOG_8 {0}
 Minimum input of analog 8 bits mode.
 
static constexpr uint8_t MAX_ANALOG_8 {255}
 Maximum input of analog 8 bits mode.
 
static constexpr uint16_t MIN_ANALOG_12 {0}
 Minimum input of analog 12 bits mode.
 
static constexpr uint16_t MAX_ANALOG_12 {4095}
 Maximum input of analog 12 bits mode.
 
static constexpr uint8_t MIN_SERVO_ANGLE {0}
 Minimum servo angle (degree)
 
static constexpr uint8_t MAX_SERVO_ANGLE {180}
 Maximum servo angle (degree)
 
static constexpr uint16_t MIN_SERVO_PULSE {500}
 Minimum servo pulse.
 
static constexpr uint16_t MAX_SERVO_PULSE {2500}
 Maximum servo pulse.
 

Protected Member Functions

bool write_pin_bits_digital_output (const uint8_t pin_bits, const bool high)
 
bool write_pin_bits_digital_output (const uint8_t pin_bits, const uint8_t high_bits)
 
bool canPWMControl () const
 

Static Protected Attributes

static constexpr uint8_t FIRMWARE_VERSION_CAN_PWM_CONTROL {0x03}
 

Detailed Description

Extend I/O Unit2.

Member Function Documentation

◆ changeI2CAddress()

bool m5::unit::UnitExtIO2::changeI2CAddress ( const uint8_t i2c_address)

Change device I2C address.

Parameters
i2c_addressI2C address
Returns
True if successful
Warning
Do not changee the I2C address configuration repeatedly at high frequency

◆ firmwareVersion()

uint8_t m5::unit::UnitExtIO2::firmwareVersion ( ) const
inline

Gets the inner firmware version.

Returns
Version
Warning
begin Cannot obtain a valid value until after success

◆ mode()

extio2::Mode m5::unit::UnitExtIO2::mode ( const uint8_t pin)
inline

Gets the inner mode.

Parameters
pinPin number
Returns
Mode

◆ readAllAnalogInput()

bool m5::unit::UnitExtIO2::readAllAnalogInput ( uint16_t values[NUMBER_OF_PINS],
const extio2::AnalogMode amode )
inline

Read the analog input from all pins.

Parameters
[out]valuesValue array
amodeData width
Returns
True if successful
Precondition
The mode of all pins must be Mode::ADCInput

◆ readAllDigitalInput()

bool m5::unit::UnitExtIO2::readAllDigitalInput ( uint8_t & high_bits)

Read the digital input from all pins.

Parameters
[out]high_bitsPin status 0-7 as bits of uint8_t
Returns
True if successful
Precondition
The mode of all pins must be Mode::DigitalInput

◆ readAllLEDColor()

bool m5::unit::UnitExtIO2::readAllLEDColor ( uint32_t rgb888[NUMBER_OF_PINS])
inline

Read the LED RGB888 from all pins.

Parameters
[out]rgb888RGB888 array
Returns
True if successful
Precondition
The mode of all pins must be Mode::LEDControl

◆ readAllMode()

bool m5::unit::UnitExtIO2::readAllMode ( extio2::Mode mode[NUMBER_OF_PINS])

Read the mode of all pins.

Parameters
[out]modeMode array
pinPin number
Returns
True if successful

◆ readAllServoAngle()

bool m5::unit::UnitExtIO2::readAllServoAngle ( uint8_t degrees[NUMBER_OF_PINS])
inline

Read the servo angle from all pins.

Parameters
[out]degreeAngle
pinPin number
Returns
True if successful
Precondition
The mode of all pin must be Mode::ServoControl

◆ readAllServoPulse()

bool m5::unit::UnitExtIO2::readAllServoPulse ( uint16_t pulses[NUMBER_OF_PINS])
inline

Read the servo pulse from all pins.

Parameters
[out]pulsesPulse array
Returns
True if successful
Precondition
The mode of all pin must be Mode::ServoControl

◆ readAnalogInput()

bool m5::unit::UnitExtIO2::readAnalogInput ( uint16_t & value,
const uint8_t pin,
const extio2::AnalogMode amode )

Read the analog input from the specified pin.

Parameters
[out]valueValue
pinPin number
amodeData width
Returns
True if successful
Precondition
The mode of the specified pin must be Mode::ADCInput

◆ readDigitalInput()

bool m5::unit::UnitExtIO2::readDigitalInput ( bool & high,
const uint8_t pin )

Read the digital input from the specified pin.

Parameters
[out]highTrue if HIGH
pinPin number
Returns
True if successful
Precondition
The mode of the specified pin must be Mode::DigitalInput

◆ readFirmwareVersion()

bool m5::unit::UnitExtIO2::readFirmwareVersion ( uint8_t & version)

Read the firmware version.

Parameters
[out]versionVersion
Returns
True if successful

◆ readI2CAddress()

bool m5::unit::UnitExtIO2::readI2CAddress ( uint8_t & i2c_address)

Read device I2C address.

Parameters
[out]i2c_addressI2C address
Returns
True if successful

◆ readLEDColor()

bool m5::unit::UnitExtIO2::readLEDColor ( uint32_t & rgb888,
const uint8_t pin )

Read the LED RGB888 from the specified pin.

Parameters
[out]rgb888RGB888
pinPin number
Returns
True if successful
Precondition
The mode of the specified pin must be Mode::LEDControl

◆ readMode()

bool m5::unit::UnitExtIO2::readMode ( extio2::Mode & mode,
const uint8_t pin )

Read the mode of the specified pin.

Parameters
[out]modeMode
pinPin number
Returns
True if successful

◆ readPinBitsAnalogInput()

bool m5::unit::UnitExtIO2::readPinBitsAnalogInput ( uint16_t values[NUMBER_OF_PINS],
const uint8_t pin_bits,
const extio2::AnalogMode amode )

Read the analog input from the specified pin bits.

Parameters
[out]valuesValue array
pin_bitsBits of the target pin
amodeData width
Returns
True if successful
Precondition
The mode of the specified pin must be Mode::ADCInput
Warning
values values for unspecified pins are undefined

◆ readPinBitsDigitalInput()

bool m5::unit::UnitExtIO2::readPinBitsDigitalInput ( uint8_t & high_bits,
const uint8_t pin_bits )

Read the digital input from the specified pin bits.

Parameters
[out]high_bitsPin status 0-7 as bits of uint8_t
pin_bitsBits of the target pin
Returns
True if successful
Precondition
The mode of the specified pin must be Mode::DigitalInput
Warning
high_bits values for unspecified pins are undefined

◆ readPinBitsLEDColor()

bool m5::unit::UnitExtIO2::readPinBitsLEDColor ( uint32_t rgb888[NUMBER_OF_PINS],
const uint8_t pin_bits )

Read the LED RGB888 from the specified pin.

Parameters
[out]rgb888RGB888 array
pin_bitsBits of the target pin
Returns
True if successful
Precondition
The mode of the specified pin must be Mode::LEDControl
Warning
rgb888 values for unspecified pins are undefined

◆ readPinBitsServoAngle()

bool m5::unit::UnitExtIO2::readPinBitsServoAngle ( uint8_t degrees[NUMBER_OF_PINS],
const uint8_t pin_bits )

Read the servo angle from the specified pin.

Parameters
[out]degreeAngle
pinPin number
Returns
True if successful
Precondition
The mode of the specified pin must be Mode::ServoControl
Warning
degrees values for unspecified pins are undefined

◆ readPinBitsServoPulse()

bool m5::unit::UnitExtIO2::readPinBitsServoPulse ( uint16_t pulses[NUMBER_OF_PINS],
const uint8_t pin_bits )

Read the servo pulse from the specified pin.

Parameters
[out]pulsesPulse array
pin_bitsBits of the target pin
Returns
True if successful
Precondition
The mode of the specified pin must be Mode::ServoControl
Warning
pulses values for unspecified pins are undefined

◆ readServoAngle()

bool m5::unit::UnitExtIO2::readServoAngle ( uint8_t & degree,
const uint8_t pin )

Read the servo angle from the specified pin.

Parameters
[out]degreeAngle
pinPin number
Returns
True if successful
Precondition
The mode of the specified pin must be Mode::ServoControl

◆ readServoPulse()

bool m5::unit::UnitExtIO2::readServoPulse ( uint16_t & pulse,
const uint8_t pin )

Read the servo pulse from the specified pin.

Parameters
[out]pulsePulse (us)
pinPin number
Returns
True if successful
Precondition
The mode of the specified pin must be Mode::ServoControl

◆ writeAllDigitalOutput()

bool m5::unit::UnitExtIO2::writeAllDigitalOutput ( const bool high)
inline

Write the digital output to all pins.

Parameters
highHIGH if true, LOW if false
Returns
True if successful
Precondition
The mode of all pins must be Mode::DigitalOutput

◆ writeAllDigitalOutputHigh()

bool m5::unit::UnitExtIO2::writeAllDigitalOutputHigh ( )
inline

Write the digital output HIGH to all pins.

Parameters
highHIGH if true, LOW if false
Returns
True if successful
Precondition
The mode of all pins must be Mode::DigitalOutput

◆ writeAllDigitalOutputLow()

bool m5::unit::UnitExtIO2::writeAllDigitalOutputLow ( )
inline

Write the digital output LOW to all pins.

Parameters
highHIGH if true, LOW if false
Returns
True if successful
Precondition
The mode of all pins must be Mode::DigitalOutput

◆ writeAllLEDColor() [1/2]

bool m5::unit::UnitExtIO2::writeAllLEDColor ( const uint32_t rgb888)
inline

Write the LED RGB888 to all pins.

Parameters
rgb888RGB888
Returns
True if successful
Precondition
The mode of all pins must be Mode::LEDControl

◆ writeAllLEDColor() [2/2]

bool m5::unit::UnitExtIO2::writeAllLEDColor ( const uint8_t r,
const uint8_t g,
const uint8_t b )
inline

Write the LED RGB888 to all pins.

Parameters
rRed
gGreen
bBlue
Returns
True if successful
Precondition
The mode of all pins must be Mode::LEDControl

◆ writeAllMode() [1/2]

bool m5::unit::UnitExtIO2::writeAllMode ( const extio2::Mode mode)

Write the mode of all pins.

Parameters
modeMode
Returns
True if successful
Note
Apply mode to all pins

◆ writeAllMode() [2/2]

bool m5::unit::UnitExtIO2::writeAllMode ( const extio2::Mode mode[NUMBER_OF_PINS])

Write the mode of all pins.

Parameters
modeMode array
Returns
True if successful
Note
Set Mode array

◆ writeAllServoAngle()

bool m5::unit::UnitExtIO2::writeAllServoAngle ( const uint8_t degree)
inline

Write the servo angle to all pins.

Parameters
degreeAngle
Returns
True if successful
Precondition
The mode of all pins must be Mode::ServoControl

◆ writeAllServoPulse()

bool m5::unit::UnitExtIO2::writeAllServoPulse ( const uint16_t pulse)
inline

Write the servo pulse to all pins.

Parameters
pulsePulse
Returns
True if successful
Precondition
The mode of all pins must be Mode::ServoControl

◆ writeDigitalOutput()

bool m5::unit::UnitExtIO2::writeDigitalOutput ( const uint8_t pin,
const bool high )

Write the digital output to the specified pin.

Parameters
pinPin number
highHIGH if true, LOW if false
Returns
True if successful
Precondition
The mode of the specified pin must be Mode::DigitalOutput

◆ writeDigitalOutputHigh()

bool m5::unit::UnitExtIO2::writeDigitalOutputHigh ( const uint8_t pin)
inline

Write the digital output HIGH to the specified pin.

Parameters
pinPin number
Returns
True if successful
Precondition
The mode of the specified pin must be Mode::DigitalOutput

◆ writeDigitalOutputLow()

bool m5::unit::UnitExtIO2::writeDigitalOutputLow ( const uint8_t pin)
inline

Write the digital output LOW to the specified pin.

Parameters
pinPin number
Returns
True if successful
Precondition
The mode of the specified pin must be Mode::DigitalOutput

◆ writeLEDColor() [1/2]

bool m5::unit::UnitExtIO2::writeLEDColor ( const uint8_t pin,
const uint32_t rgb888 )
inline

Write the LED RGB888 to the specified pin.

Parameters
pinPin number
rgb888RGB888
Returns
True if successful
Precondition
The mode of the specified pin must be Mode::LEDControl

◆ writeLEDColor() [2/2]

bool m5::unit::UnitExtIO2::writeLEDColor ( const uint8_t pin,
const uint8_t r,
const uint8_t g,
const uint8_t b )

Write the LED RGB888 to the specified pin.

Parameters
pinPin number
rRed
gGreen
bBlue
Returns
True if successful
Precondition
The mode of the specified pin must be Mode::LEDControl

◆ writeMode()

bool m5::unit::UnitExtIO2::writeMode ( const uint8_t pin,
const extio2::Mode mode )

Write the mode of the specified pin.

Parameters
pinPin number
modeMode
Returns
True if successful

◆ writePinBitsDigitalOutput() [1/2]

template<typename T , typename std::enable_if< std::is_same< T, bool >::value, std::nullptr_t >::type = nullptr>
bool m5::unit::UnitExtIO2::writePinBitsDigitalOutput ( const uint8_t pin_bits,
const T high )
inline

Write the digital output to the specified pin bits.

Parameters
pin_bitsBits of the target pin
highHIGH if true, LOW if false
Returns
True if successful
Precondition
The mode of the specified pin must be Mode::DigitalOutput

◆ writePinBitsDigitalOutput() [2/2]

template<typename T , typename std::enable_if<!std::is_same< T, bool >::value &&std::is_integral< T >::value, std::nullptr_t >::type = nullptr>
bool m5::unit::UnitExtIO2::writePinBitsDigitalOutput ( const uint8_t pin_bits,
const T high_bits )
inline

Write the digital output to the specified pin bits.

Parameters
pin_bitsBits of the target pin
high_bitsPin bits to be set HIGH
Returns
True if successful
Precondition
The mode of the specified pin must be Mode::DigitalOutput
Note
The value of high_bits for unspecified pin bits is ignored

◆ writePinBitsDigitalOutputHigh()

bool m5::unit::UnitExtIO2::writePinBitsDigitalOutputHigh ( const uint8_t pin_bits)
inline

Write the digital output HIGH to the specified pin bits.

Parameters
pin_bitsBits of the target pin
Returns
True if successful
Precondition
The mode of the specified pin must be Mode::DigitalOutput

◆ writePinBitsDigitalOutputLow()

bool m5::unit::UnitExtIO2::writePinBitsDigitalOutputLow ( const uint8_t pin_bits)
inline

Write the digital output LOW to the specified pin bits.

Parameters
pin_bitsBits of the target pin
Returns
True if successful
Precondition
The mode of the specified pin must be Mode::DigitalOutput

◆ writePinBitsLEDColor() [1/2]

bool m5::unit::UnitExtIO2::writePinBitsLEDColor ( const uint8_t pin_bits,
const uint32_t rgb888 )
inline

Write the LED RGB888 to the specified pin bits.

Parameters
pin_bitsBits of the target pin
rgb888RGB888
Returns
True if successful
Precondition
The mode of the specified pin must be Mode::LEDControl

◆ writePinBitsLEDColor() [2/2]

bool m5::unit::UnitExtIO2::writePinBitsLEDColor ( const uint8_t pin_bits,
const uint8_t r,
const uint8_t g,
const uint8_t b )

Write the LED RGB888 to the specified pin.

Parameters
pin_bitsBits of the target pin
rRed
gGreen
bBlue
Returns
True if successful
Precondition
The mode of the specified pin must be Mode::LEDControl

◆ writePinBitsMode()

bool m5::unit::UnitExtIO2::writePinBitsMode ( const uint8_t pin_bits,
const extio2::Mode mode )

Write the mode of the specified pin bits.

Parameters
pin_bitsBits of the target pin
modeMode
Returns
True if successful

◆ writePinBitsServoAngle()

bool m5::unit::UnitExtIO2::writePinBitsServoAngle ( const uint8_t pin_bits,
const uint8_t degree )

Write the servo angle to the specified pin bits.

Parameters
pin_bitsBits of the target pin
degreeAngle
Returns
True if successful
Precondition
The mode of the specified pin must be Mode::ServoControl

◆ writePinBitsServoPulse()

bool m5::unit::UnitExtIO2::writePinBitsServoPulse ( const uint8_t pin_bits,
const uint16_t pulse )

Write the servo pulse to the specified pin bits.

Parameters
pin_bitsBits of the target pin
pulsePulse
Returns
True if successful
Precondition
The mode of the specified pin must be Mode::ServoControl

◆ writeServoAngle()

bool m5::unit::UnitExtIO2::writeServoAngle ( const uint8_t pin,
const uint8_t degree )

Write the servo angle to the specified pin.

Parameters
pinPin number
degreeAngle
Returns
True if successful
Precondition
The mode of the specified pin must be Mode::ServoControl

◆ writeServoPulse()

bool m5::unit::UnitExtIO2::writeServoPulse ( const uint8_t pin,
const uint16_t pulse )

Write the servo pulse to the specified pin.

Parameters
pinPin number
pulsePulse
Returns
True if successful
Precondition
The mode of the specified pin must be Mode::ServoControl