123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- #ifndef NRF_CLI_RTT_H__
- #define NRF_CLI_RTT_H__
- #include "nrf_cli.h"
- #include "app_timer.h"
- #include "nordic_common.h"
- #ifdef __cplusplus
- extern "C" {
- #endif
- extern const nrf_cli_transport_api_t nrf_cli_rtt_transport_api;
- typedef struct {
- nrf_cli_transport_handler_t handler;
- void * p_context;
- bool timer_created;
- } nrf_cli_rtt_internal_cb_t;
- typedef struct {
- nrf_cli_transport_t transport;
- nrf_cli_rtt_internal_cb_t * p_cb;
- app_timer_id_t const * p_timer;
- } nrf_cli_rtt_internal_t;
- #define NRF_CLI_RTT_DEF(_name_) \
- APP_TIMER_DEF(CONCAT_2(_name_, _timer)); \
- static nrf_cli_rtt_internal_cb_t CONCAT_2(_name_, _cb); \
- static const nrf_cli_rtt_internal_t _name_ = { \
- .transport = {.p_api = &nrf_cli_rtt_transport_api}, \
- .p_cb = &CONCAT_2(_name_, _cb), \
- .p_timer = &CONCAT_2(_name_, _timer) \
- }
- #ifdef __cplusplus
- }
- #endif
- #endif
|