-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DAC trigger support #359
DAC trigger support #359
Conversation
da79529
to
33a4b06
Compare
|
||
std::vector<std::string> M2kHardwareTriggerV033Impl::m_trigger_source_out = { | ||
"none", | ||
"trigger-Ti", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is T intentionally uppercase?
otherwise looks good |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is T intentionally uppercase?
The name was defined to match the attribute definition within the firmware.
33a4b06
to
08efeec
Compare
336b683
to
33c0f6d
Compare
- Analog output interface can execute start/stop actions based on trigger events. - Available trigger sources are: TI pin, ADC and LA. - Added functions to control the TI trigger source when aout is triggered by this source. - ADC and LA sources use the configuration of the corresponding interface. - Add get trigger handler from the AnalogOut interface. Signed-off-by: Adrian Stanea <[email protected]>
… versions - AnalogOut trigger features are only available in fw0.33 and onwards. Show error messages for older versions. Signed-off-by: Adrian Stanea <[email protected]>
- Introduce the auto_rearm attribute to the AnalogOut class. - This attribute controls the behavior of the DAC when configured to start on a trigger event. - When auto_rearm is disabled, all previously loaded buffers will be sent to the DAC output upon the trigger event. - When auto_rearm is enabled, each previously loaded buffer will be sent to the DAC output on each trigger event. Signed-off-by: Adrian Stanea <[email protected]>
- The Python script is designed as a demo to showcase the capabilities of the START trigger for the AnalogOut. Signed-off-by: Adrian Stanea <[email protected]>
- This update ensures the `raw_enable` attribute is automatically set to `enabled` when the M2kAnalogOut class is instantiated and after a reset. - With raw_enable active, the output reflects the value set in the `raw` attribute. - During buffer operations involving DMA, the firmware temporarily disables `raw_enable` to allow proper DMA output. Once the DMA transaction completes, `raw_enable` is restored to its initial state, ensuring consistent behavior. - The change introduced in this commit sets `raw` to 0 and ensures `raw_enable` is set. This guarantees that, upon restart, the output begins at 0V, avoiding the use of old raw values or residual samples from the last sample hold state. Signed-off-by: Adrian Stanea <[email protected]>
- Make clear that functions intend to override a function definition in the base class Signed-off-by: Adrian Stanea <[email protected]>
- Use the 'override' keyword to explicitly denote that the base class destructor is virtual. - Implement virtual destructors to guarantee their invocation when utilizing pointers to the base class, ensuring proper resource cleanup across the inheritance hierarchy. Signed-off-by: Adrian Stanea <[email protected]>
Signed-off-by: Adrian Stanea <[email protected]>
- This change ensures that the IIO attributes of the trigger are properly reset when the context is closed. As a result, the interfaces remains in a usable state, and any previously configured triggers are set to a condition that always triggers. Signed-off-by: Adrian Stanea <[email protected]>
33c0f6d
to
5b20a29
Compare
Introduce support for
START
andSTOP
trigger events in the M2KAnalogOut.Ensure predictable reset of the interface at 0V
Features:
START
: initiates DAC output based on a trigger event. This trigger can be customized using therearm
functionality, allowing for different behaviors in response to each trigger event.STOP:
stops the DAC output, applicable only to cyclic buffers.Output Reset:
Utilize the
raw
andraw_enable
attributes to ensure outputs are reset to 0V. This is particularly important in scenarios where external programs may have altered the raw IIO attribute or when the DAC output remains in the last sample hold state.Demo Example:
A Python demo has been added to showcase the START trigger capabilities
NOTES:
STOP Trigger: the STOP trigger is functional only with cyclic buffers. In non-cyclic mode, if all samples are already sent and the channel is in the last sample hold state, the STOP trigger will have no impact.
START Trigger with Non-Cyclic Buffers: When using the START trigger with non-cyclic buffers and with rearm functionality disabled, it is recommended to merge all buffers into a single buffer. This addresses potential unpredictable behavior due to race conditions in HDL. In this scenario, since all buffers will be sent regardless, merging them will standardize the outcome.