mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/TACOS.git
synced 2025-08-06 09:37:34 +00:00
CAN implementation for standard CAN
This commit is contained in:
@@ -78,9 +78,7 @@ namespace sta
|
||||
return thread_ptr;
|
||||
}
|
||||
|
||||
bool queueCanBusMsg(const CanDataMsg & msg, uint32_t timeout);
|
||||
|
||||
bool queueCanBusMsg(const CanSysMsg & msg, uint32_t timeout);
|
||||
bool queueCanBusMsg(CanSysMsg & msg, uint32_t timeout);
|
||||
} // namespace tacos
|
||||
}
|
||||
|
||||
|
@@ -12,6 +12,8 @@
|
||||
|
||||
#include <sta/config.hpp>
|
||||
#include <sta/rtos/thread.hpp>
|
||||
#include <sta/rtos/queue.hpp>
|
||||
#include <sta/rtos/system/can_bus.hpp>
|
||||
|
||||
/**
|
||||
* @defgroup tacos_thread TACOS Thread
|
||||
@@ -126,6 +128,24 @@ namespace sta
|
||||
*/
|
||||
void sleep(uint32_t ticks);
|
||||
|
||||
#ifdef STA_CAN_BUS_ENABLE
|
||||
/**
|
||||
* @brief Set the ID of the CAN bus this thread is associated with.
|
||||
*
|
||||
* @param canID
|
||||
*/
|
||||
void setCanID(uint32_t canID);
|
||||
|
||||
/**
|
||||
* @brief Get the ID of the CAN bus this thread is associated with.
|
||||
*
|
||||
* @return can ID
|
||||
*/
|
||||
uint32_t getCanID();
|
||||
|
||||
sta::RtosQueue<CanSysMsg> CAN_queue_;
|
||||
#endif // STA_CAN_BUS_ENABLE
|
||||
|
||||
#ifdef STA_TACOS_WATCHDOG_ENABLED
|
||||
/**
|
||||
* @brief This macro wraps a given statement into waiting() and heartbeat() to make the code more readable.
|
||||
@@ -191,6 +211,9 @@ namespace sta
|
||||
bool running_;
|
||||
#ifdef STA_TACOS_WATCHDOG_ENABLED
|
||||
ThreadStatus status_;
|
||||
#endif // STA_TACOS_WATCHDOG_ENABLED
|
||||
#ifdef STA_CAN_BUS_ENABLE
|
||||
uint32_t canID_;
|
||||
#endif // STA_TACOS_WATCHDOG_ENABLED
|
||||
bool terminate_;
|
||||
};
|
||||
|
Reference in New Issue
Block a user