Skip to content
Snippets Groups Projects
main.c 946 B
Newer Older
bbartels's avatar
bbartels committed
#include <stdio.h>
#include "hw_impl_zybo.h"
#include "quad_app.h"
#include "type_def.h"
bbartels's avatar
bbartels committed
//#define RUN_TESTS
int setup_hardware(hardware_t *hardware) {
bbartels's avatar
bbartels committed
  hardware->i2c = create_zybo_i2c();
  hardware->pwm_inputs = create_zybo_pwm_inputs();
  hardware->pwm_outputs = create_zybo_pwm_outputs();
  hardware->uart = create_zybo_uart();
  hardware->global_timer = create_zybo_global_timer();
  hardware->axi_timer = create_zybo_axi_timer();
  hardware->mio7_led = create_zybo_mio7_led();
  hardware->sys = create_zybo_system();
  return 0;
bbartels's avatar
bbartels committed
}

int main()
{
  // Zynq initialization
  init_platform();

#ifdef RUN_TESTS
  //test_zybo_mio7_led_and_system();
  //test_zybo_i2c_imu();
  //test_zybo_pwm_inputs();
  //test_zybo_pwm_outputs();
  //test_zybo_uart();
  //test_zybo_axi_timer();
bbartels's avatar
bbartels committed
  //test_zybo_uart();
  return 0;
#endif

  // Run the main quad application
  quad_main(setup_hardware);
bbartels's avatar
bbartels committed
  return 0;
}