-
Notifications
You must be signed in to change notification settings - Fork 233
Docs: Add descriptive module docstring to protocol.pyDocs protocol header #276
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
base: main
Are you sure you want to change the base?
Changes from all commits
836ca4a
6690924
17c901e
2e3d2aa
5a3b713
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,7 +30,7 @@ | |
| CS = "LA3" | ||
| SPIMaster._primary_prescaler = PPRE = 0 | ||
| SPIMaster._secondary_prescaler = SPRE = 0 | ||
| PWM_FERQUENCY = SPIMaster._frequency * 2 / 3 | ||
| # Static value 100kHz used because instance property '_frequency' cannot be accessed on the class. | ||
| MICROSECONDS = 1e-6 | ||
| RELTOL = 0.05 | ||
| # Number of expected logic level changes. | ||
|
|
@@ -59,9 +59,11 @@ def slave(handler: SerialHandler) -> SPISlave: | |
|
|
||
|
|
||
| @pytest.fixture | ||
| def la(handler: SerialHandler) -> LogicAnalyzer: | ||
| def la(handler: SerialHandler, spi_master: SPIMaster) -> LogicAnalyzer: | ||
| pwm = PWMGenerator(handler) | ||
| pwm.generate(SDI[1], PWM_FERQUENCY, 0.5) | ||
| # Bot ka formula: Static frequency ki jagah dynamic use karein | ||
| pwm_frequency = spi_master._frequency * 2 / 3 | ||
| pwm.generate(SDI[1], pwm_frequency, 0.5) | ||
| return LogicAnalyzer(handler) | ||
|
|
||
|
|
||
|
|
@@ -73,7 +75,7 @@ def verify_value( | |
| smp: int = 0, | ||
| ): | ||
| sck_ts = sck_timestamps[smp::2] | ||
| pwm_half_period = ((1 / PWM_FERQUENCY) * 1e6) / 2 # microsecond | ||
| pwm_half_period = ((1 / PWM_FREQUENCY) * 1e6) / 2 # microsecond | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue (bug_risk): PWM_FREQUENCY is undefined and will cause a NameError, breaking the SPI tests. The previous code used |
||
|
|
||
| pattern = "" | ||
| for t in sck_ts: | ||
|
|
||
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.
issue (bug_risk): Consider the impact of removing explicit CS start/stop toggling on devices needing tight control over chip select.
With
_start/_stopremoved and no other explicit CS handling shown, chip-select timing now depends entirely on the new burst commands (or other firmware behavior). Some SPI devices require a CS low–high transition per logical operation. If the old API guaranteed per-call CS toggling and the new behavior keeps CS asserted across calls, this could change observable behavior for existing users. Please confirm the new CS behavior still gives appropriate transaction boundaries, or document that CS is now managed differently so callers can adjust their usage if needed.