Skip to content

Commit ca5126e

Browse files
authored
Merge pull request #15003 from dustin-crossman/pr/add_missing_bt_support
Add bluetooth support files to Cypress BSPs.
2 parents df00ed4 + 1aa67dd commit ca5126e

File tree

16 files changed

+1168
-0
lines changed

16 files changed

+1168
-0
lines changed
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
/***********************************************************************************************//**
2+
* \copyright
3+
* Copyright 2020-2021 Cypress Semiconductor Corporation
4+
* SPDX-License-Identifier: Apache-2.0
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* 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, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
**************************************************************************************************/
18+
19+
#if defined(COMPONENT_WICED_BLE) || defined(COMPONENT_WICED_DUALMODE)
20+
21+
#include "cybsp_bt_config.h"
22+
#include "wiced_bt_dev.h"
23+
24+
const cybt_platform_config_t cybsp_bt_platform_cfg =
25+
{
26+
.hci_config =
27+
{
28+
.hci_transport = CYBT_HCI_UART,
29+
30+
.hci =
31+
{
32+
.hci_uart =
33+
{
34+
.uart_tx_pin = CYBSP_BT_UART_TX,
35+
.uart_rx_pin = CYBSP_BT_UART_RX,
36+
.uart_rts_pin = CYBSP_BT_UART_RTS,
37+
.uart_cts_pin = CYBSP_BT_UART_CTS,
38+
39+
.baud_rate_for_fw_download = CYBSP_BT_PLATFORM_CFG_BAUD_DOWNLOAD,
40+
.baud_rate_for_feature = CYBSP_BT_PLATFORM_CFG_BAUD_FEATURE,
41+
42+
.data_bits = CYBSP_BT_PLATFORM_CFG_BITS_DATA,
43+
.stop_bits = CYBSP_BT_PLATFORM_CFG_BITS_STOP,
44+
.parity = CYHAL_UART_PARITY_NONE,
45+
.flow_control = true
46+
}
47+
}
48+
},
49+
50+
.controller_config =
51+
{
52+
.bt_power_pin = CYBSP_BT_POWER,
53+
#if (bt_0_power_0_ENABLED == 1)
54+
.sleep_mode =
55+
{
56+
.sleep_mode_enabled = CYCFG_BT_LP_ENABLED,
57+
.device_wakeup_pin = CYCFG_BT_DEV_WAKE_GPIO,
58+
.host_wakeup_pin = CYCFG_BT_HOST_WAKE_GPIO,
59+
.device_wake_polarity = CYCFG_BT_DEV_WAKE_POLARITY,
60+
.host_wake_polarity = CYCFG_BT_HOST_WAKE_IRQ_EVENT
61+
}
62+
#else
63+
.sleep_mode =
64+
{
65+
.sleep_mode_enabled = true,
66+
.device_wakeup_pin = CYBSP_BT_DEVICE_WAKE,
67+
.host_wakeup_pin = CYBSP_BT_HOST_WAKE,
68+
.device_wake_polarity = CYBT_WAKE_ACTIVE_LOW,
69+
.host_wake_polarity = CYBT_WAKE_ACTIVE_LOW
70+
}
71+
#endif /* (bt_0_power_0_ENABLED == 1) */
72+
},
73+
74+
.task_mem_pool_size = CYBSP_BT_PLATFORM_CFG_MEM_POOL_BYTES
75+
};
76+
77+
#endif /* defined(COMPONENT_WICED_BLE) || defined(COMPONENT_WICED_DUALMODE) */
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
/***********************************************************************************************//**
2+
* \copyright
3+
* Copyright 2020-2021 Cypress Semiconductor Corporation
4+
* SPDX-License-Identifier: Apache-2.0
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* 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, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
**************************************************************************************************/
18+
19+
/**
20+
* \addtogroup group_bsp_bt Bluetooth Configuration Structure
21+
* \{
22+
* Basic configuration structure for the Bluetooth interface on this board.
23+
*/
24+
#pragma once
25+
26+
#if defined(COMPONENT_WICED_BLE) || defined(COMPONENT_WICED_DUALMODE)
27+
28+
#include "cybt_platform_config.h"
29+
#include "cycfg_pins.h"
30+
31+
#if defined(__cplusplus)
32+
extern "C" {
33+
#endif
34+
35+
#if !defined(CYBSP_BT_PLATFORM_CFG_BAUD_DOWNLOAD)
36+
/** If not already defined, the baud rate to download data at. */
37+
#define CYBSP_BT_PLATFORM_CFG_BAUD_DOWNLOAD (115200)
38+
#endif
39+
40+
#if !defined(CYBSP_BT_PLATFORM_CFG_BAUD_FEATURE)
41+
/** If not already defined, the baud rate for general operation. */
42+
#define CYBSP_BT_PLATFORM_CFG_BAUD_FEATURE (115200)
43+
#endif
44+
45+
#if !defined(CYBSP_BT_PLATFORM_CFG_BITS_DATA)
46+
/** If not already defined, the number of data bits to transmit. */
47+
#define CYBSP_BT_PLATFORM_CFG_BITS_DATA (8)
48+
#endif
49+
50+
#if !defined(CYBSP_BT_PLATFORM_CFG_BITS_STOP)
51+
/** If not already defined, the number of stop bits to transmit. */
52+
#define CYBSP_BT_PLATFORM_CFG_BITS_STOP (1)
53+
#endif
54+
55+
#if !defined(CYBSP_BT_PLATFORM_CFG_MEM_POOL_BYTES)
56+
/** If not already defined, the number of bytes to allocated for the task memory pool. */
57+
#define CYBSP_BT_PLATFORM_CFG_MEM_POOL_BYTES (2048)
58+
#endif
59+
60+
/** Bluetooth platform configuration settings for the board. */
61+
extern const cybt_platform_config_t cybsp_bt_platform_cfg;
62+
63+
#ifdef __cplusplus
64+
}
65+
#endif // __cplusplus
66+
67+
#endif /* defined(COMPONENT_WICED_BLE) || defined(COMPONENT_WICED_DUALMODE) */
68+
69+
/** \} group_bsp_bt */
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
/***********************************************************************************************//**
2+
* \copyright
3+
* Copyright 2020-2021 Cypress Semiconductor Corporation
4+
* SPDX-License-Identifier: Apache-2.0
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* 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, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
**************************************************************************************************/
18+
19+
#if defined(COMPONENT_WICED_BLE) || defined(COMPONENT_WICED_DUALMODE)
20+
21+
#include "cybsp_bt_config.h"
22+
#include "wiced_bt_dev.h"
23+
24+
const cybt_platform_config_t cybsp_bt_platform_cfg =
25+
{
26+
.hci_config =
27+
{
28+
.hci_transport = CYBT_HCI_UART,
29+
30+
.hci =
31+
{
32+
.hci_uart =
33+
{
34+
.uart_tx_pin = CYBSP_BT_UART_TX,
35+
.uart_rx_pin = CYBSP_BT_UART_RX,
36+
.uart_rts_pin = CYBSP_BT_UART_RTS,
37+
.uart_cts_pin = CYBSP_BT_UART_CTS,
38+
39+
.baud_rate_for_fw_download = CYBSP_BT_PLATFORM_CFG_BAUD_DOWNLOAD,
40+
.baud_rate_for_feature = CYBSP_BT_PLATFORM_CFG_BAUD_FEATURE,
41+
42+
.data_bits = CYBSP_BT_PLATFORM_CFG_BITS_DATA,
43+
.stop_bits = CYBSP_BT_PLATFORM_CFG_BITS_STOP,
44+
.parity = CYHAL_UART_PARITY_NONE,
45+
.flow_control = true
46+
}
47+
}
48+
},
49+
50+
.controller_config =
51+
{
52+
.bt_power_pin = CYBSP_BT_POWER,
53+
#if (bt_0_power_0_ENABLED == 1)
54+
.sleep_mode =
55+
{
56+
.sleep_mode_enabled = CYCFG_BT_LP_ENABLED,
57+
.device_wakeup_pin = CYCFG_BT_DEV_WAKE_GPIO,
58+
.host_wakeup_pin = CYCFG_BT_HOST_WAKE_GPIO,
59+
.device_wake_polarity = CYCFG_BT_DEV_WAKE_POLARITY,
60+
.host_wake_polarity = CYCFG_BT_HOST_WAKE_IRQ_EVENT
61+
}
62+
#else
63+
.sleep_mode =
64+
{
65+
.sleep_mode_enabled = true,
66+
.device_wakeup_pin = CYBSP_BT_DEVICE_WAKE,
67+
.host_wakeup_pin = CYBSP_BT_HOST_WAKE,
68+
.device_wake_polarity = CYBT_WAKE_ACTIVE_LOW,
69+
.host_wake_polarity = CYBT_WAKE_ACTIVE_LOW
70+
}
71+
#endif /* (bt_0_power_0_ENABLED == 1) */
72+
},
73+
74+
.task_mem_pool_size = CYBSP_BT_PLATFORM_CFG_MEM_POOL_BYTES
75+
};
76+
77+
#endif /* defined(COMPONENT_WICED_BLE) || defined(COMPONENT_WICED_DUALMODE) */
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
/***********************************************************************************************//**
2+
* \copyright
3+
* Copyright 2020-2021 Cypress Semiconductor Corporation
4+
* SPDX-License-Identifier: Apache-2.0
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* 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, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
**************************************************************************************************/
18+
19+
/**
20+
* \addtogroup group_bsp_bt Bluetooth Configuration Structure
21+
* \{
22+
* Basic configuration structure for the Bluetooth interface on this board.
23+
*/
24+
#pragma once
25+
26+
#if defined(COMPONENT_WICED_BLE) || defined(COMPONENT_WICED_DUALMODE)
27+
28+
#include "cybt_platform_config.h"
29+
#include "cycfg_pins.h"
30+
31+
#if defined(__cplusplus)
32+
extern "C" {
33+
#endif
34+
35+
#if !defined(CYBSP_BT_PLATFORM_CFG_BAUD_DOWNLOAD)
36+
/** If not already defined, the baud rate to download data at. */
37+
#define CYBSP_BT_PLATFORM_CFG_BAUD_DOWNLOAD (115200)
38+
#endif
39+
40+
#if !defined(CYBSP_BT_PLATFORM_CFG_BAUD_FEATURE)
41+
/** If not already defined, the baud rate for general operation. */
42+
#define CYBSP_BT_PLATFORM_CFG_BAUD_FEATURE (115200)
43+
#endif
44+
45+
#if !defined(CYBSP_BT_PLATFORM_CFG_BITS_DATA)
46+
/** If not already defined, the number of data bits to transmit. */
47+
#define CYBSP_BT_PLATFORM_CFG_BITS_DATA (8)
48+
#endif
49+
50+
#if !defined(CYBSP_BT_PLATFORM_CFG_BITS_STOP)
51+
/** If not already defined, the number of stop bits to transmit. */
52+
#define CYBSP_BT_PLATFORM_CFG_BITS_STOP (1)
53+
#endif
54+
55+
#if !defined(CYBSP_BT_PLATFORM_CFG_MEM_POOL_BYTES)
56+
/** If not already defined, the number of bytes to allocated for the task memory pool. */
57+
#define CYBSP_BT_PLATFORM_CFG_MEM_POOL_BYTES (2048)
58+
#endif
59+
60+
/** Bluetooth platform configuration settings for the board. */
61+
extern const cybt_platform_config_t cybsp_bt_platform_cfg;
62+
63+
#ifdef __cplusplus
64+
}
65+
#endif // __cplusplus
66+
67+
#endif /* defined(COMPONENT_WICED_BLE) || defined(COMPONENT_WICED_DUALMODE) */
68+
69+
/** \} group_bsp_bt */
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
/***********************************************************************************************//**
2+
* \copyright
3+
* Copyright 2020-2021 Cypress Semiconductor Corporation
4+
* SPDX-License-Identifier: Apache-2.0
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* 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, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
**************************************************************************************************/
18+
19+
#if defined(COMPONENT_WICED_BLE) || defined(COMPONENT_WICED_DUALMODE)
20+
21+
#include "cybsp_bt_config.h"
22+
#include "wiced_bt_dev.h"
23+
24+
const cybt_platform_config_t cybsp_bt_platform_cfg =
25+
{
26+
.hci_config =
27+
{
28+
.hci_transport = CYBT_HCI_UART,
29+
30+
.hci =
31+
{
32+
.hci_uart =
33+
{
34+
.uart_tx_pin = CYBSP_BT_UART_TX,
35+
.uart_rx_pin = CYBSP_BT_UART_RX,
36+
.uart_rts_pin = CYBSP_BT_UART_RTS,
37+
.uart_cts_pin = CYBSP_BT_UART_CTS,
38+
39+
.baud_rate_for_fw_download = CYBSP_BT_PLATFORM_CFG_BAUD_DOWNLOAD,
40+
.baud_rate_for_feature = CYBSP_BT_PLATFORM_CFG_BAUD_FEATURE,
41+
42+
.data_bits = CYBSP_BT_PLATFORM_CFG_BITS_DATA,
43+
.stop_bits = CYBSP_BT_PLATFORM_CFG_BITS_STOP,
44+
.parity = CYHAL_UART_PARITY_NONE,
45+
.flow_control = true
46+
}
47+
}
48+
},
49+
50+
.controller_config =
51+
{
52+
.bt_power_pin = CYBSP_BT_POWER,
53+
#if (bt_0_power_0_ENABLED == 1)
54+
.sleep_mode =
55+
{
56+
.sleep_mode_enabled = CYCFG_BT_LP_ENABLED,
57+
.device_wakeup_pin = CYCFG_BT_DEV_WAKE_GPIO,
58+
.host_wakeup_pin = CYCFG_BT_HOST_WAKE_GPIO,
59+
.device_wake_polarity = CYCFG_BT_DEV_WAKE_POLARITY,
60+
.host_wake_polarity = CYCFG_BT_HOST_WAKE_IRQ_EVENT
61+
}
62+
#else
63+
.sleep_mode =
64+
{
65+
.sleep_mode_enabled = true,
66+
.device_wakeup_pin = CYBSP_BT_DEVICE_WAKE,
67+
.host_wakeup_pin = CYBSP_BT_HOST_WAKE,
68+
.device_wake_polarity = CYBT_WAKE_ACTIVE_LOW,
69+
.host_wake_polarity = CYBT_WAKE_ACTIVE_LOW
70+
}
71+
#endif /* (bt_0_power_0_ENABLED == 1) */
72+
},
73+
74+
.task_mem_pool_size = CYBSP_BT_PLATFORM_CFG_MEM_POOL_BYTES
75+
};
76+
77+
#endif /* defined(COMPONENT_WICED_BLE) || defined(COMPONENT_WICED_DUALMODE) */

0 commit comments

Comments
 (0)