Skip to content
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

Rework peripheral's FIRQ triggering #202

Merged
merged 11 commits into from
Nov 9, 2021
Merged

Conversation

stnolting
Copy link
Owner

@stnolting stnolting commented Nov 5, 2021

This PR changes the behavior of the IO module's fast interrupt request signals.

Affected peripheral devices: SPI, TWI, UART0, UART1, NEOLED, SLINK

Pre-PR

In the current pre-PR design the interrupts are triggered whenever the according module is in the interrupt triggering state. For example, the SPI unit's interrupt gets pending whenever the SPI module is idle. This is disruptive because once the interrupt is configured and enabled it keeps firing all the time even if there is no data to be send via SPI right now.

In the current version an interrupt is acknowledged (= no longer pending) by resolving the interrupt-causing conditions. In term of the SPI module this mean triggering a new transmission.

Post-PR

This PR changes the triggering of the module's FIRQ interrupts so that they are triggered when the according module enters the interrupt-triggering state. For example, the SPI unit's interrupt only gets pending once (= only fires once) when the module finishes it's current transmission and enters idle mode. Once the interrupt is processed there will be no new interrupt request until the SPI module finishes another transmission.

This PR also reworks (⚠️) the mechanism for acknowledging interrupts. In the updated design interrupt are acknowledged by either writing to a unit' control register (this can also be a dummy write like reading the control register and writing it back) or by reading/writing the module's data register(s) - the last point is device specific.

Example 1: the SPI interrupt is acknowledged by writing the SPI control register or by reading or writing the SPI data register.

Example 2: the UART0 RX interrupt is acknowledged by writing the UART0 control register or by reading the UART0 data register.

Example 3: the UART TX interrupt is acknowledged by writing the UART0 control register or by writing the UART0 data register.

Misc

This PR also reworks the SLINK interrupt system (also the trigger logic) and fixes some bugs in the interrupt logic (also fixing #199).

Waht do you think? 👍? 👎?
Feedback and thoughts are highly appreciated! 😉

@stnolting stnolting added enhancement New feature or request HW hardware-related labels Nov 5, 2021
@stnolting stnolting self-assigned this Nov 5, 2021
@stnolting stnolting marked this pull request as ready for review November 5, 2021 23:49
@stnolting stnolting linked an issue Nov 9, 2021 that may be closed by this pull request
@stnolting stnolting merged commit 5b4b1a4 into master Nov 9, 2021
@stnolting stnolting deleted the rework_firq_triggering branch November 9, 2021 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request HW hardware-related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

slink variables rx_tmp_v and tx_tmp_v have wrong size
1 participant