List of all members.
Constructor & Destructor Documentation
DigitalModule::DigitalModule |
( |
UINT8 |
moduleNumber | ) |
[explicit, protected] |
Create a new instance of an digital module. Create an instance of the digital module object. Initialize all the parameters to reasonable values on start. Setting a global value on an digital module can be done only once unless subsequent values are set the previously set value. Digital modules are a singleton, so the constructor is never called outside of this class.
- Parameters:
-
moduleNumber | The digital module to create (1 or 2). |
Member Function Documentation
bool DigitalModule::AllocateDIO |
( |
UINT32 |
channel, |
|
|
bool |
input |
|
) |
| |
Allocate Digital I/O channels. Allocate channels so that they are not accidently reused. Also the direction is set at the time of the allocation.
- Parameters:
-
channel | The Digital I/O channel |
input | If true open as input; if false open as output |
- Returns:
- Was successfully allocated
UINT32 DigitalModule::AllocateDO_PWM |
( |
| ) |
|
Allocate a DO PWM Generator. Allocate PWM generators so that they are not accidently reused.
- Returns:
- PWM Generator refnum
void DigitalModule::FreeDIO |
( |
UINT32 |
channel | ) |
|
Free the resource associated with a digital I/O channel.
- Parameters:
-
channel | The Digital I/O channel to free |
void DigitalModule::FreeDO_PWM |
( |
UINT32 |
pwmGenerator | ) |
|
Free the resource associated with a DO PWM generator.
- Parameters:
-
bool DigitalModule::GetDIO |
( |
UINT32 |
channel | ) |
|
Read a digital I/O bit from the FPGA. Get a single value from a digital I/O channel.
- Parameters:
-
channel | The digital I/O channel |
- Returns:
- The state of the specified channel
UINT16 DigitalModule::GetDIO |
( |
| ) |
|
Read the state of all the Digital I/O lines from the FPGA These are not remapped to logical order. They are still in hardware order.
UINT16 DigitalModule::GetDIODirection |
( |
| ) |
|
Read the direction of all the Digital I/O lines from the FPGA A 1 bit means output and a 0 bit means input. These are not remapped to logical order. They are still in hardware order.
bool DigitalModule::GetDIODirection |
( |
UINT32 |
channel | ) |
|
Read the direction of a the Digital I/O lines A 1 bit means output and a 0 bit means input.
- Parameters:
-
channel | The digital I/O channel |
- Returns:
- The direction of the specified channel
I2C * DigitalModule::GetI2C |
( |
UINT32 |
address | ) |
|
Return a pointer to an I2C object for this digital module The caller is responsible for deleting the pointer.
- Parameters:
-
address | The address of the device on the I2C bus |
- Returns:
- A pointer to an I2C object to talk to the device at address
DigitalModule * DigitalModule::GetInstance |
( |
UINT8 |
moduleNumber | ) |
[static] |
Get an instance of an Digital Module. Singleton digital module creation where a module is allocated on the first use and the same module is returned on subsequent uses.
- Parameters:
-
moduleNumber | The digital module to get (1 or 2). |
UINT8 DigitalModule::GetPWM |
( |
UINT32 |
channel | ) |
|
Get a value from a PWM channel. The values range from 0 to 255.
- Parameters:
-
channel | The PWM channel to read from. |
- Returns:
- The raw PWM value.
bool DigitalModule::GetRelayForward |
( |
UINT32 |
channel | ) |
|
Get the current state of the forward relay channel
UINT8 DigitalModule::GetRelayForward |
( |
| ) |
|
Get the current state of all of the forward relay channels on this module.
UINT8 DigitalModule::GetRelayReverse |
( |
| ) |
|
Get the current state of all of the reverse relay channels on this module.
bool DigitalModule::GetRelayReverse |
( |
UINT32 |
channel | ) |
|
Get the current state of the reverse relay channel
bool DigitalModule::IsPulsing |
( |
| ) |
|
Check if any DIO line is currently generating a pulse.
- Returns:
- A pulse on some line is in progress
bool DigitalModule::IsPulsing |
( |
UINT32 |
channel | ) |
|
Check a DIO line to see if it is currently generating a pulse.
- Returns:
- A pulse is in progress
void DigitalModule::Pulse |
( |
UINT32 |
channel, |
|
|
float |
pulseLength |
|
) |
| |
Generate a single pulse. Write a pulse to the specified digital output channel. There can only be a single pulse going at any time.
- Parameters:
-
channel | The Digital Output channel that the pulse should be output on |
pulseLength | The active length of the pulse (in seconds) |
void DigitalModule::SetDIO |
( |
UINT32 |
channel, |
|
|
short |
value |
|
) |
| |
Write a digital I/O bit to the FPGA. Set a single value on a digital I/O channel.
- Parameters:
-
channel | The Digital I/O channel |
value | The state to set the digital channel (if it is configured as an output) |
void DigitalModule::SetDO_PWMDutyCycle |
( |
UINT32 |
pwmGenerator, |
|
|
float |
dutyCycle |
|
) |
| |
Configure the duty-cycle of the PWM generator
- Parameters:
-
pwmGenerator | The generator index reserved by AllocateDO_PWM() |
dutyCycle | The percent duty cycle to output [0..1]. |
void DigitalModule::SetDO_PWMOutputChannel |
( |
UINT32 |
pwmGenerator, |
|
|
UINT32 |
channel |
|
) |
| |
Configure which DO channel the PWM siganl is output on
- Parameters:
-
pwmGenerator | The generator index reserved by AllocateDO_PWM() |
channel | The Digital Output channel to output on |
void DigitalModule::SetDO_PWMRate |
( |
float |
rate | ) |
|
Change the frequency of the DO PWM generator.
The valid range is from 0.6 Hz to 19 kHz. The frequency resolution is logarithmic.
- Parameters:
-
rate | The frequency to output all digital output PWM signals on this module. |
void DigitalModule::SetPWM |
( |
UINT32 |
channel, |
|
|
UINT8 |
value |
|
) |
| |
Set a PWM channel to the desired value. The values range from 0 to 255 and the period is controlled by the PWM Period and MinHigh registers.
- Parameters:
-
channel | The PWM channel to set. |
value | The PWM value to set. |
void DigitalModule::SetPWMPeriodScale |
( |
UINT32 |
channel, |
|
|
UINT32 |
squelchMask |
|
) |
| |
Set how how often the PWM signal is squelched, thus scaling the period.
- Parameters:
-
channel | The PWM channel to configure. |
squelchMask | The 2-bit mask of outputs to squelch. |
void DigitalModule::SetRelayForward |
( |
UINT32 |
channel, |
|
|
bool |
on |
|
) |
| |
Set the state of a relay. Set the state of a relay output to be forward. Relays have two outputs and each is independently set to 0v or 12v.
void DigitalModule::SetRelayReverse |
( |
UINT32 |
channel, |
|
|
bool |
on |
|
) |
| |
Set the state of a relay. Set the state of a relay output to be reverse. Relays have two outputs and each is independently set to 0v or 12v.
The documentation for this class was generated from the following files: