You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

67 lines
1.8KB

  1. // Copyright 2012 Olivier Gillet.
  2. //
  3. // Author: Olivier Gillet (ol.gillet@gmail.com)
  4. //
  5. // This program is free software: you can redistribute it and/or modify
  6. // it under the terms of the GNU General Public License as published by
  7. // the Free Software Foundation, either version 3 of the License, or
  8. // (at your option) any later version.
  9. // This program is distributed in the hope that it will be useful,
  10. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. // GNU General Public License for more details.
  13. // You should have received a copy of the GNU General Public License
  14. // along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. #ifndef GRIDS_HARDWARE_CONFIG_H_
  16. #define GRIDS_HARDWARE_CONFIG_H_
  17. #include "avrlib/base.h"
  18. #include "avrlib/gpio.h"
  19. #include "avrlib/parallel_io.h"
  20. #include "avrlib/serial.h"
  21. #include "avrlib/spi.h"
  22. namespace grids {
  23. enum AdcChannel {
  24. ADC_CHANNEL_X_CV,
  25. ADC_CHANNEL_Y_CV,
  26. ADC_CHANNEL_RANDOMNESS_CV,
  27. ADC_CHANNEL_BD_DENSITY_CV,
  28. ADC_CHANNEL_SD_DENSITY_CV,
  29. ADC_CHANNEL_HH_DENSITY_CV,
  30. ADC_CHANNEL_TEMPO,
  31. ADC_CHANNEL_LAST
  32. };
  33. enum LedBits {
  34. LED_CLOCK = 1,
  35. LED_BD = 8,
  36. LED_SD = 4,
  37. LED_HH = 2,
  38. LED_ALL = LED_CLOCK | LED_BD | LED_SD | LED_HH
  39. };
  40. enum InputBits {
  41. INPUT_CLOCK = 2,
  42. INPUT_RESET = 4,
  43. INPUT_SW_RESET = 8
  44. };
  45. using avrlib::Gpio;
  46. using avrlib::ParallelPort;
  47. using avrlib::PortB;
  48. using avrlib::PortD;
  49. using avrlib::Serial;
  50. using avrlib::SerialPort0;
  51. using avrlib::SpiMaster;
  52. typedef ParallelPort<PortD, avrlib::PARALLEL_NIBBLE_HIGH> Leds;
  53. typedef ParallelPort<PortD, avrlib::PARALLEL_NIBBLE_LOW> Inputs;
  54. typedef SpiMaster<Gpio<PortB, 2>, avrlib::MSB_FIRST, 2> ShiftRegister;
  55. typedef Serial<SerialPort0, 31250, avrlib::POLLED, avrlib::DISABLED> MidiInput;
  56. } // namespace grids
  57. #endif // GRIDS_HARDWARE_CONFIG_H_