Skip to content
Snippets Groups Projects
Commit ed44eef7 authored by James Talbert's avatar James Talbert
Browse files

Confirmed that the IMU works on the new HW platform.

parent b3e228e9
No related branches found
No related tags found
No related merge requests found
Showing
with 5 additions and 44 deletions
......@@ -49,15 +49,6 @@ struct TimerDriver create_unix_global_timer() {
return global_timer;
}
struct TimerDriver create_unix_axi_timer() {
struct TimerDriver axi_timer;
axi_timer.state = NULL;
axi_timer.reset = unix_axi_timer_reset;
axi_timer.restart = unix_axi_timer_restart;
axi_timer.read = unix_axi_timer_read;
return axi_timer;
}
struct LEDDriver create_unix_mio7_led() {
struct LEDDriver mio7_led;
mio7_led.state = NULL;
......
......@@ -57,10 +57,6 @@ int unix_global_timer_reset(struct TimerDriver *self);
int unix_global_timer_restart(struct TimerDriver *self);
int unix_global_timer_read(struct TimerDriver *self, u64 *us);
int unix_axi_timer_reset(struct TimerDriver *self);
int unix_axi_timer_restart(struct TimerDriver *self);
int unix_axi_timer_read(struct TimerDriver *self, u64 *us);
int unix_mio7_led_reset(struct LEDDriver *self);
int unix_mio7_led_turn_on(struct LEDDriver *self);
int unix_mio7_led_turn_off(struct LEDDriver *self);
......@@ -83,7 +79,6 @@ struct MotorDriver create_unix_motors();
struct RCReceiverDriver create_unix_rc_receiver();
struct I2CDriver create_unix_i2c();
struct TimerDriver create_unix_global_timer();
struct TimerDriver create_unix_axi_timer();
struct LEDDriver create_unix_mio7_led();
struct SystemDriver create_unix_system();
struct IMUDriver create_unix_imu(struct I2CDriver *i2c);
......
#include "hw_impl_unix.h"
int unix_axi_timer_reset(struct TimerDriver *self) {
if (self->state == NULL) {
self->state = malloc(sizeof(struct timeval));
}
return 0;
}
int unix_axi_timer_restart(struct TimerDriver *self) {
struct timeval *start = self->state;
struct timezone tz;
gettimeofday(start, &tz);
return 0;
}
int unix_axi_timer_read(struct TimerDriver *self, u64 *us) {
struct timeval *start = self->state;
struct timeval end;
struct timezone tz;
gettimeofday(&end, &tz);
*us = end.tv_usec - start->tv_usec;
return 0;
}
......@@ -38,7 +38,6 @@ int setup_hardware(hardware_t *hardware) {
hardware->uart_0 = create_unix_uart();
hardware->comm = create_unix_comm(&hardware->uart_0);
hardware->global_timer = create_unix_global_timer();
hardware->axi_timer = create_unix_axi_timer();
hardware->mio7_led = create_unix_mio7_led();
hardware->sys = create_unix_system();
hardware->imu = create_unix_imu(&hardware->i2c_0);
......
......@@ -124,8 +124,8 @@
##Pmod Header JC
#set_property -dict { PACKAGE_PIN V15 IOSTANDARD LVCMOS33 } [get_ports { jc[0] }]; #IO_L10P_T1_34 Sch=jc_p[1]
#set_property -dict { PACKAGE_PIN W15 IOSTANDARD LVCMOS33 } [get_ports { jc[1] }]; #IO_L10N_T1_34 Sch=jc_n[1]
#set_property -dict { PACKAGE_PIN T11 IOSTANDARD LVCMOS33 } [get_ports { jc[2] }]; #IO_L1P_T0_34 Sch=jc_p[2]
set_property -dict { PACKAGE_PIN W15 IOSTANDARD LVCMOS33 } [get_ports { UART0_TX_0 }]; #IO_L10N_T1_34 Sch=jc_n[1]
set_property -dict { PACKAGE_PIN T11 IOSTANDARD LVCMOS33 } [get_ports { UART0_RX_0 }]; #IO_L1P_T0_34 Sch=jc_p[2]
#set_property -dict { PACKAGE_PIN T10 IOSTANDARD LVCMOS33 } [get_ports { jc[3] }]; #IO_L1N_T0_34 Sch=jc_n[2]
#set_property -dict { PACKAGE_PIN W14 IOSTANDARD LVCMOS33 } [get_ports { jc[4] }]; #IO_L8P_T1_34 Sch=jc_p[3]
#set_property -dict { PACKAGE_PIN Y14 IOSTANDARD LVCMOS33 } [get_ports { jc[5] }]; #IO_L8N_T1_34 Sch=jc_n[3]
......
......@@ -4,7 +4,7 @@
#include "type_def.h"
#include "platform.h"
//#define RUN_TESTS
#define RUN_TESTS
/**
* Create the hardware drivers, and place them on the hardware struct.
......@@ -47,8 +47,8 @@ int main()
#ifdef RUN_TESTS
//test_zybo_mio7_led_and_system();
//test_zybo_i2c();
//test_zybo_i2c_imu();
test_zybo_i2c_px4flow();
test_zybo_i2c_imu();
//test_zybo_i2c_px4flow();
//test_zybo_i2c_lidar();
//test_zybo_i2c_all();
//test_zybo_rc_receiver();
......
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