esp_coexist_adapter.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. // Copyright 2019 Espressif Systems (Shanghai) PTE LTD
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. #ifndef __ESP_COEXIST_ADAPTER_H__
  15. #define __ESP_COEXIST_ADAPTER_H__
  16. #include <stdarg.h>
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif
  20. #define COEX_ADAPTER_VERSION 0x00000001
  21. #define COEX_ADAPTER_MAGIC 0xDEADBEAF
  22. #define COEX_ADAPTER_FUNCS_TIME_BLOCKING 0xffffffff
  23. typedef struct {
  24. int32_t _version;
  25. void *(* _spin_lock_create)(void);
  26. void (* _spin_lock_delete)(void *lock);
  27. uint32_t (*_int_disable)(void *mux);
  28. void (*_int_enable)(void *mux, uint32_t tmp);
  29. void (*_task_yield_from_isr)(void);
  30. void *(*_semphr_create)(uint32_t max, uint32_t init);
  31. void (*_semphr_delete)(void *semphr);
  32. int32_t (*_semphr_take_from_isr)(void *semphr, void *hptw);
  33. int32_t (*_semphr_give_from_isr)(void *semphr, void *hptw);
  34. int32_t (*_semphr_take)(void *semphr, uint32_t block_time_tick);
  35. int32_t (*_semphr_give)(void *semphr);
  36. int32_t (* _is_in_isr)(void);
  37. void * (* _malloc_internal)(size_t size);
  38. void (* _free)(void *p);
  39. void (* _timer_disarm)(void *timer);
  40. void (* _timer_done)(void *ptimer);
  41. void (* _timer_setfn)(void *ptimer, void *pfunction, void *parg);
  42. void (* _timer_arm_us)(void *ptimer, uint32_t us, bool repeat);
  43. int64_t (* _esp_timer_get_time)(void);
  44. int32_t _magic;
  45. } coex_adapter_funcs_t;
  46. extern coex_adapter_funcs_t g_coex_adapter_funcs;
  47. #ifdef __cplusplus
  48. }
  49. #endif
  50. #endif /* __ESP_COEXIST_ADAPTER_H__ */