Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MicroCART
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Distributed Autonomous Networked Control Lab
MicroCART
Commits
20296f0e
Commit
20296f0e
authored
8 years ago
by
bbartels
Committed by
dawehr
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
wip: add hardware test for I2CDriver
parent
d3d9f743
No related branches found
No related tags found
1 merge request
!9
Abstract the hardware layer
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
quad/xsdk_workspace/modular_quad_pid/src/hw_impl_zybo_tests.c
+30
-5
30 additions, 5 deletions
.../xsdk_workspace/modular_quad_pid/src/hw_impl_zybo_tests.c
with
30 additions
and
5 deletions
quad/xsdk_workspace/modular_quad_pid/src/hw_impl_zybo_tests.c
+
30
−
5
View file @
20296f0e
...
...
@@ -4,13 +4,17 @@
#include
<stdio.h>
/**
* Use the LEDDriver and SystemDriver to create a basic "blink" program,
* using the mio7 LED on the Zybo board.
* Test for the LEDDriver and SystemDriver.
*
* This is essentially a basic "blink" program, using the mio7 LED
* on the Zybo board.
*
* Instructions:
* 1) Use the USB cable and plug Zybo board into computer.
* 2) Run.
* 3) Observe MIO7 LED on board blinking at 1 second intervals.
* 1) Connect Zybo board to computer by USB cable.
* 2) Set the RUN_TESTS macro in main.c
* 3) Uncomment only this test in main.c
* 4) Run main.c
* 5) Observe MIO7 LED on board blinking at 1 second intervals.
*/
int
test_zybo_mio7_led_and_system
()
{
struct
LEDDriver
mio7
=
create_zybo_mio7_led
();
...
...
@@ -28,6 +32,27 @@ int test_zybo_mio7_led_and_system() {
return
0
;
}
/**
* Test for the I2CDriver.
*
* Raw I2C tests are tedius, so we are going to cheat a bit, and use
* some of the LIDAR code we have.
*
* Instructions:
* 1) Connect Zybo Board to computer by USB cable.
* 2) Prepare a breadboard to accomplish the following connections:
* - Zybo GND <-> LIDAR GND
* - Zybo WALL <-> LIDAR VCC
* - Zybo VV5V0 <-> LIDAR VCC
* - Zybo SDA/SCL <-> LIDAR SDA/SCL
* - The Zybo I2C SCL and SDA pins are on pins 1 and 2 of PORT JF, respectively
* 3) Place breakpoint in this test function, somewhere in the while loop.
* 4) Set the RUN_TESTS macro in main.c
* 5) Uncomment only this test in main.c
* 6) Debug main.c
* 7) Step through the while loop, observing x change as you physically change the
* distance of the LIDAR sensor.
*/
int
test_zybo_i2c
()
{
struct
I2CDriver
i2c
=
create_zybo_i2c
();
struct
SystemDriver
sys
=
create_zybo_system
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment