UbusSlave.h 754 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * AppBridge.h
  3. *
  4. * Created on: Mar 3, 2025
  5. * Author: juraj
  6. */
  7. #include "inttypes.h"
  8. #include "dataframe.h"
  9. #if defined(STM32F401xC) || defined(STM32F401xE)
  10. #include "stm32f4xx_hal.h"
  11. #endif
  12. #if defined (STM32L432xx)
  13. #include "stm32l4xx_hal.h"
  14. #endif
  15. #if defined (STM32L031xx) || defined (STM32L082xx)
  16. #include "stm32l0xx_hal.h"
  17. #endif
  18. #ifndef SRC_APPSLAVE_H_
  19. #define SRC_APPSLAVE_H_
  20. class UbusSlave {
  21. private:
  22. uint8_t _address;
  23. uint8_t _data_packet[32];
  24. DataFrame *_packet;
  25. UART_HandleTypeDef *_uartUbus;
  26. void transmit(uint8_t);
  27. public:
  28. UbusSlave(uint8_t, UART_HandleTypeDef *);
  29. void ubus_echo();
  30. virtual ~UbusSlave();
  31. };
  32. #ifdef __cplusplus
  33. extern "C"
  34. {
  35. #endif
  36. #ifdef __cplusplus
  37. }
  38. #endif
  39. #endif /* SRC_APPSLAVE_H_ */