Home
last modified time | relevance | path

Searched refs:hal_ctx (Results 1 – 3 of 3) sorted by relevance

/hal_espressif-latest/components/hal/
Dtwai_hal.c20 bool twai_hal_init(twai_hal_context_t *hal_ctx, const twai_hal_config_t *config) in twai_hal_init() argument
23 hal_ctx->dev = TWAI_LL_GET_HW(config->controller_id); in twai_hal_init()
24 hal_ctx->state_flags = 0; in twai_hal_init()
25 hal_ctx->clock_source_hz = config->clock_source_hz; in twai_hal_init()
27 twai_ll_enable_clock(hal_ctx->dev, true); in twai_hal_init()
29 twai_ll_enter_reset_mode(hal_ctx->dev); in twai_hal_init()
30 …if (!twai_ll_is_in_reset_mode(hal_ctx->dev)) { //Must enter reset mode to write to config regis… in twai_hal_init()
34 …twai_ll_enable_extended_reg_layout(hal_ctx->dev); //Changes the address layout of the regis… in twai_hal_init()
36 twai_ll_set_mode(hal_ctx->dev, TWAI_MODE_LISTEN_ONLY); //Freeze REC by changing to LOM mode in twai_hal_init()
38 twai_ll_set_tec(hal_ctx->dev, TWAI_HAL_INIT_TEC); in twai_hal_init()
[all …]
Dtwai_hal_iram.c24 static inline uint32_t twai_hal_decode_interrupt(twai_hal_context_t *hal_ctx) argument
27 uint32_t interrupts = twai_ll_get_and_clear_intrs(hal_ctx->dev);
28 uint32_t status = twai_ll_get_status(hal_ctx->dev);
29 uint32_t tec = twai_ll_get_tec(hal_ctx->dev);
30 uint32_t rec = twai_ll_get_rec(hal_ctx->dev);
31 uint32_t state_flags = hal_ctx->state_flags;
49 } else if (hal_ctx->state_flags & TWAI_HAL_STATE_FLAG_RECOVERING) {
65 …if ((interrupts & TWAI_LL_INTR_TI || hal_ctx->state_flags & TWAI_HAL_STATE_FLAG_TX_BUFF_OCCUPIED) …
90 hal_ctx->state_flags = state_flags;
94 uint32_t twai_hal_get_events(twai_hal_context_t *hal_ctx) argument
[all …]
/hal_espressif-latest/components/hal/include/hal/
Dtwai_hal.h87 bool twai_hal_init(twai_hal_context_t *hal_ctx, const twai_hal_config_t *config);
96 void twai_hal_deinit(twai_hal_context_t *hal_ctx);
107 void twai_hal_configure(twai_hal_context_t *hal_ctx, const twai_timing_config_t *t_config, const tw…
120 void twai_hal_start(twai_hal_context_t *hal_ctx, twai_mode_t mode);
130 void twai_hal_stop(twai_hal_context_t *hal_ctx);
137 static inline void twai_hal_start_bus_recovery(twai_hal_context_t *hal_ctx) in twai_hal_start_bus_recovery() argument
139 TWAI_HAL_SET_BITS(hal_ctx->state_flags, TWAI_HAL_STATE_FLAG_RECOVERING); in twai_hal_start_bus_recovery()
140 twai_ll_exit_reset_mode(hal_ctx->dev); in twai_hal_start_bus_recovery()
149 static inline uint32_t twai_hal_get_tec(twai_hal_context_t *hal_ctx) in twai_hal_get_tec() argument
151 return twai_ll_get_tec((hal_ctx)->dev); in twai_hal_get_tec()
[all …]