Control drones with a proper joystick
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

config.h 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * EEPROM configuration storage utility
  3. * Copyright 2016 by Thomas Buck <xythobuz@xythobuz.de>
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License as
  7. * published by the Free Software Foundation, version 2.
  8. */
  9. #ifndef __CONFIG_H__
  10. #define __CONFIG_H__
  11. #include <stdint.h>
  12. #define CPPM_OUTPUT_PIN_DEFAULT 4
  13. #define CHANNEL_MINIMUM_VALUE 1000
  14. #define CHANNEL_DEFAULT_VALUE 1500
  15. #define CHANNEL_MAXIMUM_VALUE 2000
  16. #define CHANNELS_MAX 12
  17. #define DEFAULT_CHANNELS 6
  18. #define DEFAULT_FRAME_LENGTH 20000
  19. #define DEFAULT_PULSE_LENGTH 300
  20. #define DEFAULT_INVERT_STATE 0
  21. enum RxChannels {
  22. CHANNEL_ROLL = 0,
  23. CHANNEL_PITCH = 1,
  24. CHANNEL_THROTTLE = 2,
  25. CHANNEL_YAW = 3,
  26. CHANNEL_AUX1 = 4,
  27. CHANNEL_AUX2 = 5
  28. };
  29. // Increase string number when struct changes!
  30. #define CONFIG_VERSION "USBCPPM-02"
  31. #define CONFIG_VERSION_LENGTH (sizeof(CONFIG_VERSION) - 1)
  32. struct ConfigData {
  33. uint16_t channels, frameLength, pulseLength, inverted, cppmPin;
  34. uint16_t minimum[CHANNELS_MAX];
  35. uint16_t maximum[CHANNELS_MAX];
  36. uint16_t invert[CHANNELS_MAX];
  37. int16_t trim[CHANNELS_MAX];
  38. };
  39. #define CONFIG_DATA_LENGTH (sizeof(ConfigData))
  40. void eepromRead();
  41. void eepromWrite();
  42. #endif // __CONFIG_H__