NimBLE-Arduino 2.1.2
Loading...
Searching...
No Matches
nimble_port.h
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19
20#ifndef _NIMBLE_PORT_H
21#define _NIMBLE_PORT_H
22
23#include "nimble/nimble/include/nimble/nimble_npl.h"
24
25#ifdef ESP_PLATFORM
26#include "esp_err.h"
27#include "nimconfig.h"
28#define NIMBLE_CORE (CONFIG_BT_NIMBLE_PINNED_TO_CORE < portNUM_PROCESSORS ? CONFIG_BT_NIMBLE_PINNED_TO_CORE : tskNO_AFFINITY)
29#define NIMBLE_HS_STACK_SIZE CONFIG_BT_NIMBLE_HOST_TASK_STACK_SIZE
30#else
31#include "../syscfg/syscfg.h"
32#define NIMBLE_HS_STACK_SIZE (CONFIG_BT_NIMBLE_HOST_TASK_STACK_SIZE / 4)
33#endif
34
35#if SOC_ESP_NIMBLE_CONTROLLER && CONFIG_BT_CONTROLLER_ENABLED
36#define NIMBLE_LL_STACK_SIZE CONFIG_BT_LE_CONTROLLER_TASK_STACK_SIZE
37#endif
38
39#ifdef __cplusplus
40extern "C" {
41#endif
42
43#ifdef ESP_PLATFORM
50esp_err_t nimble_port_init(void);
51
58esp_err_t nimble_port_deinit(void);
59
60void nimble_port_run(void);
61int nimble_port_stop(void);
62
63
69esp_err_t esp_nimble_init(void);
70
76esp_err_t esp_nimble_deinit(void);
77
78#else
79
80void nimble_port_init(void);
81
82void nimble_port_run(void);
83
84int nimble_port_stop(void);
85
86void nimble_port_deinit(void);
87
88#endif //ESP_PLATFORM
89
90struct ble_npl_eventq *nimble_port_get_dflt_eventq(void);
91
92#if NIMBLE_CFG_CONTROLLER
93void nimble_port_ll_task_func(void *arg);
94#endif
95
96#ifdef __cplusplus
97}
98#endif
99
100#endif /* _NIMBLE_PORT_H */