1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- #ifndef SHELL_RTT_H__
- #define SHELL_RTT_H__
- #include <shell/shell.h>
- #ifdef __cplusplus
- extern "C" {
- #endif
- extern const struct shell_transport_api shell_rtt_transport_api;
- typedef void (* shell_rtt_callback_t)(const uint8_t *data, uint32_t len, void *user_data);
- struct shell_rtt {
- shell_transport_handler_t handler;
- struct k_timer timer;
- void *context;
- shell_rtt_callback_t callback;
- void *user_data;
- };
- #define SHELL_RTT_DEFINE(_name) \
- static struct shell_rtt _name##_shell_rtt; \
- struct shell_transport _name = { \
- .api = &shell_rtt_transport_api, \
- .ctx = (struct shell_rtt *)&_name##_shell_rtt \
- }
- const struct shell *shell_backend_rtt_get_ptr(void);
- int shell_rtt_register_output_callback(shell_rtt_callback_t callback, void *user_data);
- #ifdef __cplusplus
- }
- #endif
- #endif
|