Signal Class

class SignalClass : public Acroname::BrainStem::EntityClass

SignalClass is the interface to digital pins configured to produce square wave signals.

This class is designed to allow for square waves at various frequencies and duty cycles. Control is defined by specifying the wave period as (T3Time) and the active portion of the cycle as (T2Time). See the entity overview section of the reference for more detail regarding the timiing.

Public Functions

void init(Module *pModule, const uint8_t index)

Initialize the class.

Parameters
  • pModule: The module.
  • index: The index.

aErr setEnable(const uint8_t enable)

Enable/Disable the signal output.

Return
Returns common entity return values
Parameters
  • enable: True to enable, false to disable

aErr getEnable(uint8_t *enable)

Get the Enable/Disable of the signal.

Return
Returns common entity return values
Parameters
  • enable: True to enable, false to disable

aErr setInvert(const uint8_t invert)

Invert the signal output.

Normal mode is High on t0 then low at t2. Inverted mode is Low at t0 on period start and high at t2.

Return
Returns common entity return values
Parameters
  • True: to invert, false for normal mode.

aErr getInvert(uint8_t *invert)

Get the invert status the signal output.

Normal mode is High on t0 then low at t2. Inverted mode is Low at t0 on period start and high at t2.

Return
Returns common entity return values
Parameters
  • True: to invert, false for normal mode.

aErr setT3Time(const uint32_t t3_nsec)

Set the signal period or T3 in nanoseconds.

Return
Returns common entity return values
Parameters
  • t3_nsec: Integer not larger than unsigned 32 bit max value representing the wave period in nanoseconds.

aErr getT3Time(uint32_t *t3_nsec)

Get the signal period or T3 in nanoseconds.

Return
Returns common entity return values
Parameters
  • t3_nsec: Integer not larger than unsigned 32 bit max value representing the wave period in nanoseconds.

aErr setT2Time(const uint32_t t2_nsec)

Set the signal active period or T2 in nanoseconds.

Return
Returns common entity return values
Parameters
  • t2_nsec: Integer not larger than unsigned 32 bit max value representing the wave active period in nanoseconds.

aErr getT2Time(uint32_t *t2_nsec)

Get the signal active period or T2 in nanoseconds.

Return
Returns common entity return values
Parameters
  • t2_nsec: Integer not larger than unsigned 32 bit max value representing the wave active period in nanoseconds.