#include <Pwm.h>
◆ tcPwm()
tcPwm::tcPwm |
( |
uint32_t |
anAddress, |
|
|
double |
anRefClkMhz, |
|
|
std::string |
acUioName = std::string() |
|
) |
| |
tcPwm::tcPwm Class Constructor.
- Parameters
-
anAddress | the phyiscal base address of the control core. |
anRefClkMhz | the reference clock provided to the control core. |
acUioName | the name of the uio device tracking the interrupt of the core, can be empty. |
◆ ~tcPwm()
◆ clearInterruptStatus()
void tcPwm::clearInterruptStatus |
( |
void |
| ) |
|
◆ dumpRegisters()
void tcPwm::dumpRegisters |
( |
| ) |
|
◆ enableCore()
void tcPwm::enableCore |
( |
bool |
abEnable | ) |
|
tcPwm::enableCore Enable/Disable the pulse output When disabled the output will be in the inactive state.
- Parameters
-
◆ enableInterrupts()
void tcPwm::enableInterrupts |
( |
bool |
abDeAssert, |
|
|
bool |
abEnable |
|
) |
| |
tcPwm::enableInterrupts Enables the PWM core to generate interrupts
- Parameters
-
abDeAssert | when true, interrupts are asserted at the end of the "active" time |
abEnable | when true, the PWM core will issue interrupts |
◆ initialized()
bool tcPwm::initialized |
( |
| ) |
|
◆ interruptPending()
bool tcPwm::interruptPending |
( |
void |
| ) |
|
◆ readCoreEnable()
bool tcPwm::readCoreEnable |
( |
| ) |
|
◆ readInvertPulse()
bool tcPwm::readInvertPulse |
( |
| ) |
|
tcPwm::readInvertPulse True is pulse active low and inactive high. False is pulse active high and inactive low. Default is active high.
- Returns
◆ readVersion()
uint32_t tcPwm::readVersion |
( |
| ) |
|
◆ setDutyClks()
void tcPwm::setDutyClks |
( |
uint32_t |
anDutyClks | ) |
|
tcPwm::setDutyClks Configures pulse active time register
- Parameters
-
anDutyClks | Duty cycle specified in clocks |
- Exceptions
-
std::runtime_error | if duty cycle is too high |
◆ setDutyPercent()
void tcPwm::setDutyPercent |
( |
double |
anDutyPercent | ) |
|
tcPwm::setDutyPercent Configures pulse active time register
- Parameters
-
anDutyPercent | Percent of period that output is active. 1.0 is 100% |
- Exceptions
-
std::runtime_error | if requested duty cycle is > 1 |
◆ setDutyTime()
void tcPwm::setDutyTime |
( |
std::chrono::microseconds |
anDuty | ) |
|
tcPwm::setDutyTime Configures pulse active time register
- Parameters
-
anDuty | Duty cycle specified in microseconds |
- Exceptions
-
std::runtime_error | if duty cycle is too high |
◆ setInvertPulse()
void tcPwm::setInvertPulse |
( |
bool |
abPulseLow | ) |
|
tcPwm::setInvertPulse True is pulse active low and inactive high. False is pulse active high and inactive low. Default is active high.
- Parameters
-
◆ setPeriodClks()
void tcPwm::setPeriodClks |
( |
uint64_t |
anPeriodClks | ) |
|
tcPwm::setPeriodClks Configures prescalar and pulse period registers
- Parameters
-
anPeriodClks | Number of clocks at reference clock frequency that define pwm period |
- Exceptions
-
std::runtime_error | if requested anPeriodClks is too large |
◆ setPeriodFreq()
void tcPwm::setPeriodFreq |
( |
uint32_t |
anFreqHz | ) |
|
tcPwm::setPeriodFreq Configures prescalar and pulse period registers
- Parameters
-
anFreqHz | Period specified in hz |
◆ setPeriodTime()
void tcPwm::setPeriodTime |
( |
std::chrono::microseconds |
anPeriod | ) |
|
tcPwm::setPeriodTime Configures prescalar and pulse period registers
- Parameters
-
anPeriod | Period specified in microseconds |
- Exceptions
-
std::runtime_error | if requested anPeriod is too large |
◆ setRefClkMhz()
void tcPwm::setRefClkMhz |
( |
double |
anRefClkMhz | ) |
|
|
inline |
◆ waitForInterrupt()
int tcPwm::waitForInterrupt |
( |
std::chrono::microseconds |
anTimeout | ) |
|
tcPwm::waitForInterrupt Wait for the PWM to trigger and interrupt condition
- Parameters
-
anTimeout | Number of Microseconds to wait (0 = wait forever) |
- Note
- This routine will call clearInterruptStatus() if a valid interrupt is detected.
- Returns
- -1 on error (no UIO found), 0 on timeout, or number of pending interrupts since last check Typically this will be 1 because the cleanInterruptStatus() must be called to cause a new edge level interrupt to occur.
The documentation for this class was generated from the following files:
- /tmp/mitycam_sdk/ARM/camera_software/src/Utility/Pwm.h
- /tmp/mitycam_sdk/ARM/camera_software/src/Utility/Pwm.cpp