Skip to content
Snippets Groups Projects
Commit 20296f0e authored by bbartels's avatar bbartels Committed by dawehr
Browse files

wip: add hardware test for I2CDriver

parent d3d9f743
No related branches found
No related tags found
1 merge request!9Abstract the hardware layer
......@@ -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();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment