Ein Roboter mit bürstenlosem Antrieb, differenzial und NRF24L01 Funk. Großflächig gebaut um ein großes Solarpanel aufzunehmen. https://gitlab.informatik.hs-fulda.de/fdai5253/roboter
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.0 KiB

  1. /*
  2. * TMRh20 2015
  3. *
  4. */
  5. #ifndef RF24_ARCH_GPIO_H
  6. #define RF24_ARCH_GPIO_H
  7. /**
  8. * @file spi.h
  9. * \cond HIDDEN_SYMBOLS
  10. * Class declaration for GPIO helper files
  11. */
  12. #include <cstdio>
  13. #include <stdio.h>
  14. #include "mraa.hpp"
  15. class GPIO {
  16. public:
  17. /* Constants */
  18. GPIO();
  19. virtual ~GPIO();
  20. /**
  21. * Sets up GPIO on the CE & CS pins
  22. * @param ce_pin
  23. * @param cs_pin
  24. */
  25. void begin(uint8_t ce_pin, uint8_t cs_pin);
  26. /**
  27. *
  28. * @param port
  29. * @param DDR
  30. */
  31. void open(int port, int DDR);
  32. /**
  33. *
  34. * @param port
  35. */
  36. void close(int port);
  37. /**
  38. *
  39. * @param port
  40. * @param value
  41. */
  42. int read(int port);
  43. /**
  44. *
  45. * @param port
  46. * @param value
  47. */
  48. void write(int port,int value);
  49. private:
  50. int gpio_ce_pin; /** ce_pin value of the RF24 device **/
  51. //int gpio_cs_pin; /** cs_pin value of the RF24 device **/
  52. mraa::Gpio* gpio_0; /** gpio object for ce_pin **/
  53. //mraa::Gpio* gpio_1; /** gpio object for cs_pin **/
  54. };
  55. /**
  56. * \endcond
  57. */
  58. #endif /* RF24_ARCH_GPIO_H */