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

tests/periph_i2c: Add clk stretch test #125

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions tests/periph_i2c/tests/05__periph_i2c_clk_stretch.robot
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
*** Settings ***
Documentation Tests clock stretching.

Suite Setup Run Keywords PHILIP Reset
... RIOT Reset
... API Firmware Should Match
Test Setup Run Keywords PHILIP Reset
... RIOT Reset
... API Sync Shell
... I2C Acquire
Test Teardown I2C Release

Resource periph_i2c.keywords.txt
Resource api_shell.keywords.txt
Resource riot_base.keywords.txt

Force Tags periph i2c

*** Test Cases ***
Read Register with clock stretching
[Documentation] Verify DUT functions with clock stretching.
API Call Should Succeed I2C Read Regs reg=2 leng=10
Set Test Variable ${accepted_vals} ${RESULT['data']}
API Call Should Succeed PHiLIP.write_reg i2c.mode.init 0
API Call Should Succeed PHiLIP.write_reg i2c.clk_stretch_delay 0
API Call Should Succeed PHiLIP.Execute Changes
API Call Should Succeed I2C Read Regs reg=2 leng=10
Should Be Equal ${RESULT['data']} ${accepted_vals}
API Call Should Succeed PHiLIP.write_reg i2c.mode.init 0
API Call Should Succeed PHiLIP.write_reg i2c.clk_stretch_delay 1000
API Call Should Succeed PHiLIP.Execute Changes
API Call Should Succeed I2C Read Regs reg=2 leng=10
Should Be Equal ${RESULT['data']} ${accepted_vals}
API Call Should Succeed PHiLIP.write_reg i2c.mode.init 0
API Call Should Succeed PHiLIP.write_reg i2c.clk_stretch_delay 16000
API Call Should Succeed PHiLIP.Execute Changes
API Call Should Succeed I2C Read Regs reg=2 leng=10
Should Be Equal ${RESULT['data']} ${accepted_vals}