Skip to content

Commit 5c027db

Browse files
vmedcyArto Kinnunen
authored andcommitted
PSOC6: update BSP sources
1 parent b09e7cd commit 5c027db

File tree

56 files changed

+9440
-56
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+9440
-56
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
/***************************************************************************//**
2+
* \file cybsp_cy8ckit_062_ble.c
3+
*
4+
* Description:
5+
* Provides APIs for interacting with the hardware contained on the Cypress
6+
* CY8CKIT-062-BLE pioneer kit.
7+
*
8+
********************************************************************************
9+
* \copyright
10+
* Copyright 2018-2019 Cypress Semiconductor Corporation
11+
* SPDX-License-Identifier: Apache-2.0
12+
*
13+
* Licensed under the Apache License, Version 2.0 (the "License");
14+
* you may not use this file except in compliance with the License.
15+
* You may obtain a copy of the License at
16+
*
17+
* http://www.apache.org/licenses/LICENSE-2.0
18+
*
19+
* Unless required by applicable law or agreed to in writing, software
20+
* distributed under the License is distributed on an "AS IS" BASIS,
21+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22+
* See the License for the specific language governing permissions and
23+
* limitations under the License.
24+
*******************************************************************************/
25+
26+
#include <stdlib.h>
27+
#include "cybsp_cy8ckit_062_ble.h"
28+
#include "cyhal_implementation.h"
29+
#include "cycfg.h"
30+
31+
#if defined(__cplusplus)
32+
extern "C" {
33+
#endif
34+
35+
cy_rslt_t cybsp_init(void)
36+
{
37+
init_cycfg_system();
38+
39+
cy_rslt_t result = CY_RSLT_SUCCESS;
40+
41+
#ifndef __MBED__
42+
/* Initialize User LEDs */
43+
result |= cybsp_led_init(CYBSP_USER_LED1);
44+
result |= cybsp_led_init(CYBSP_USER_LED2);
45+
result |= cybsp_led_init(CYBSP_USER_LED3);
46+
result |= cybsp_led_init(CYBSP_USER_LED4);
47+
result |= cybsp_led_init(CYBSP_USER_LED5);
48+
/* Initialize User Buttons */
49+
result |= cybsp_btn_init(CYBSP_USER_BTN1);
50+
51+
CY_ASSERT(CY_RSLT_SUCCESS == result);
52+
#endif
53+
54+
#if defined(CYBSP_RETARGET_ENABLED)
55+
/* Initialize retargetting stdio to 'DEBUG_UART' peripheral */
56+
if (CY_RSLT_SUCCESS == result)
57+
{
58+
result = cybsp_retarget_init();
59+
}
60+
#endif
61+
62+
return result;
63+
}
64+
65+
#if defined(__cplusplus)
66+
}
67+
#endif
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
/***************************************************************************//**
2+
* \file cybsp_cy8ckit_062_ble.h
3+
*
4+
* Description:
5+
* Provides APIs for interacting with the hardware contained on the Cypress
6+
* CY8CKIT-062-BLE pioneer kit.
7+
*
8+
********************************************************************************
9+
* \copyright
10+
* Copyright 2018-2019 Cypress Semiconductor Corporation
11+
* SPDX-License-Identifier: Apache-2.0
12+
*
13+
* Licensed under the Apache License, Version 2.0 (the "License");
14+
* you may not use this file except in compliance with the License.
15+
* You may obtain a copy of the License at
16+
*
17+
* http://www.apache.org/licenses/LICENSE-2.0
18+
*
19+
* Unless required by applicable law or agreed to in writing, software
20+
* distributed under the License is distributed on an "AS IS" BASIS,
21+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22+
* See the License for the specific language governing permissions and
23+
* limitations under the License.
24+
*******************************************************************************/
25+
26+
/**
27+
* \addtogroup group_bsp_cy8ckit_062_ble CY8CKIT-062-BLE
28+
* \ingroup group_bsp
29+
* \{
30+
* The PSoC 6 BLE Pioneer Kit is a low-cost hardware platform
31+
* that enables design and debug of the PSoC 63 MCU (CY8C6347BZI-BLD53).
32+
*
33+
* <div class="category">Kit Features:</div>
34+
* <ul>
35+
* <li>BLE v5.0</li>
36+
* <li>Serial memory interface</li>
37+
* <li>PDM-PCM digital microphone interface</li>
38+
* <li>Industry-leading CapSense</li>
39+
* </ul>
40+
*
41+
* <div class="category">Kit Contents:</div>
42+
* <ul>
43+
* <li>CY8CKIT-062-BLE evaluation board</li>
44+
* <li>E-Ink display shield with an ultra-low-power 2.7" E-ink display, thermistor, 6-axis motion sensor, and digital microphone</li>
45+
* <li>USB cable</li>
46+
* </ul>
47+
*
48+
* \defgroup group_bsp_cy8ckit_062_ble_macros Macros
49+
* \defgroup group_bsp_cy8ckit_062_ble_functions Functions
50+
* \defgroup group_bsp_cy8ckit_062_ble_enums Enumerated Types
51+
*/
52+
53+
#pragma once
54+
55+
#include "cybsp_api_core.h"
56+
57+
#if defined(__cplusplus)
58+
extern "C" {
59+
#endif
60+
61+
/** \cond INTERNAL */
62+
63+
// HAL HW configuration data
64+
extern cyhal_qspi_t cybsp_qspi;
65+
extern cyhal_uart_t cybsp_bt_uart;
66+
extern cyhal_uart_t cybsp_uart;
67+
extern cyhal_i2c_t cybsp_i2c;
68+
extern cyhal_rtc_t cybsp_rtc;
69+
70+
/** \endcond */
71+
72+
#if defined(__cplusplus)
73+
}
74+
#endif
75+
76+
/** \} group_bsp_cy8ckit_062_ble */
Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
/***************************************************************************//**
2+
* \file CY8CKIT-062-BLE/cybsp_types.h
3+
*
4+
* Description:
5+
* Provides APIs for interacting with the hardware contained on the Cypress
6+
* CY8CKIT-062-BLE pioneer kit.
7+
*
8+
********************************************************************************
9+
* \copyright
10+
* Copyright 2018-2019 Cypress Semiconductor Corporation
11+
* SPDX-License-Identifier: Apache-2.0
12+
*
13+
* Licensed under the Apache License, Version 2.0 (the "License");
14+
* you may not use this file except in compliance with the License.
15+
* You may obtain a copy of the License at
16+
*
17+
* http://www.apache.org/licenses/LICENSE-2.0
18+
*
19+
* Unless required by applicable law or agreed to in writing, software
20+
* distributed under the License is distributed on an "AS IS" BASIS,
21+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22+
* See the License for the specific language governing permissions and
23+
* limitations under the License.
24+
*******************************************************************************/
25+
26+
/**
27+
* \addtogroup group_bsp_cy8ckit_062_ble CY8CKIT-062-BLE
28+
* \ingroup group_bsp
29+
* \{
30+
* \defgroup group_bsp_cy8ckit_062_ble_macros Macros
31+
* \defgroup group_bsp_cy8ckit_062_ble_enums Enumerated Types
32+
*/
33+
34+
#pragma once
35+
36+
#include "cyhal.h"
37+
38+
#if defined(__cplusplus)
39+
extern "C" {
40+
#endif
41+
42+
/**
43+
* \addtogroup group_bsp_cy8ckit_062_ble_macros
44+
* \{
45+
*/
46+
47+
// Generic signal names
48+
/** Pin: WCO input */
49+
#define CYBSP_WCO_IN P0_0
50+
/** Pin: WCO output */
51+
#define CYBSP_WCO_OUT P0_1
52+
53+
/** Pin: UART RX */
54+
#define CYBSP_DEBUG_UART_RX P5_0
55+
/** Pin: UART TX */
56+
#define CYBSP_DEBUG_UART_TX P5_1
57+
58+
/** Pin: I2C SCL */
59+
#define CYBSP_I2C_SCL P6_0
60+
/** Pin: I2C SDA */
61+
#define CYBSP_I2C_SDA P6_1
62+
63+
/** Pin: SWO */
64+
#define CYBSP_SWO P6_4
65+
/** Pin: SWDIO */
66+
#define CYBSP_SWDIO P6_6
67+
/** Pin: SWDCK */
68+
#define CYBSP_SWDCK P6_7
69+
70+
/** Pin: CapSesnse TX */
71+
#define CYBSP_CSD_TX P1_0
72+
/** Pin: CapSesnse CINA */
73+
#define CYBSP_CINA P7_1
74+
/** Pin: CapSesnse CINB */
75+
#define CYBSP_CINB P7_2
76+
/** Pin: CapSesnse CMOD */
77+
#define CYBSP_CMOD P7_7
78+
/** Pin: CapSesnse Button 0 */
79+
#define CYBSP_CSD_BTN0 P8_1
80+
/** Pin: CapSesnse Button 1 */
81+
#define CYBSP_CSD_BTN1 P8_2
82+
/** Pin: CapSesnse Slider 0 */
83+
#define CYBSP_CSD_SLD0 P8_3
84+
/** Pin: CapSesnse Slider 1 */
85+
#define CYBSP_CSD_SLD1 P8_4
86+
/** Pin: CapSesnse Slider 2 */
87+
#define CYBSP_CSD_SLD2 P8_5
88+
/** Pin: CapSesnse Slider 3 */
89+
#define CYBSP_CSD_SLD3 P8_6
90+
/** Pin: CapSesnse Slider 4 */
91+
#define CYBSP_CSD_SLD4 P8_7
92+
93+
/** Pin: QUAD SPI SS */
94+
#define CYBSP_QSPI_SS P11_2
95+
/** Pin: QUAD SPI D3 */
96+
#define CYBSP_QSPI_D3 P11_3
97+
/** Pin: QUAD SPI D2 */
98+
#define CYBSP_QSPI_D2 P11_4
99+
/** Pin: QUAD SPI D1 */
100+
#define CYBSP_QSPI_D1 P11_5
101+
/** Pin: QUAD SPI D0 */
102+
#define CYBSP_QSPI_D0 P11_6
103+
/** Pin: QUAD SPI SCK */
104+
#define CYBSP_QSPI_SCK P11_7
105+
106+
/** \} group_bsp_cy8ckit_062_ble_macros */
107+
108+
/**
109+
* \addtogroup group_bsp_cy8ckit_062_ble_enums
110+
* \{
111+
*/
112+
113+
/** Enum defining the different states for the LED. */
114+
typedef enum
115+
{
116+
CYBSP_LED_STATE_ON = 0,
117+
CYBSP_LED_STATE_OFF = 1,
118+
} cybsp_led_state_t;
119+
120+
/** Enum defining the different states for a button. */
121+
typedef enum
122+
{
123+
CYBSP_BTN_PRESSED = 0,
124+
CYBSP_BTN_OFF = 1,
125+
} cybsp_btn_state_t;
126+
127+
/** Enum defining the different LED pins on the board. */
128+
typedef enum
129+
{
130+
CYBSP_LED9 = P13_7,
131+
CYBSP_LED8 = P1_5,
132+
CYBSP_LED_RGB_RED = P0_3,
133+
CYBSP_LED_RGB_GREEN = P1_1,
134+
CYBSP_LED_RGB_BLUE = P11_1,
135+
136+
CYBSP_USER_LED1 = CYBSP_LED8,
137+
CYBSP_USER_LED2 = CYBSP_LED9,
138+
CYBSP_USER_LED3 = CYBSP_LED_RGB_RED,
139+
CYBSP_USER_LED4 = CYBSP_LED_RGB_GREEN,
140+
CYBSP_USER_LED5 = CYBSP_LED_RGB_BLUE,
141+
CYBSP_USER_LED = CYBSP_USER_LED1,
142+
} cybsp_led_t;
143+
144+
/** Enum defining the different button pins on the board. */
145+
typedef enum
146+
{
147+
CYBSP_SW2 = P0_4,
148+
149+
CYBSP_USER_BTN1 = CYBSP_SW2,
150+
CYBSP_USER_BTN = CYBSP_USER_BTN1,
151+
} cybsp_btn_t;
152+
153+
/** \} group_bsp_cy8ckit_062_ble_enums */
154+
155+
#if defined(__cplusplus)
156+
}
157+
#endif
158+
159+
/** \} group_bsp_cy8ckit_062_ble */

targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CY8CKIT_062_BLE/device/TOOLCHAIN_ARM/cy8c6xx7_cm4_dual.sct

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
;*******************************************************************************
66
;* \file cy8c6xx7_cm4_dual.scat
7-
;* \version 2.40
7+
;* \version 2.50
88
;*
99
;* Linker file for the ARMCC.
1010
;*
@@ -78,7 +78,7 @@
7878
#define MBED_BOOT_STACK_SIZE 0x400
7979
#endif
8080

81-
#define Stack_Size MBED_BOOT_STACK_SIZE
81+
#define STACK_SIZE MBED_BOOT_STACK_SIZE
8282

8383
; The defines below describe the location and size of blocks of memory in the target.
8484
; Use these defines to specify the memory regions available for allocation.
@@ -190,7 +190,7 @@ LR_IROM1 FLASH_CM4_START FLASH_CM4_SIZE
190190
}
191191

192192
; Stack region growing down
193-
ARM_LIB_STACK RAM_START+RAM_SIZE -Stack_Size
193+
ARM_LIB_STACK RAM_START+RAM_SIZE -STACK_SIZE
194194
{
195195
* (STACK)
196196
}

targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CY8CKIT_062_BLE/device/TOOLCHAIN_GCC_ARM/cy8c6xx7_cm4_dual.ld

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/***************************************************************************//**
22
* \file cy8c6xx7_cm4_dual.ld
3-
* \version 2.40
3+
* \version 2.50
44
*
55
* Linker file for the GNU C compiler.
66
*

targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CY8CKIT_062_BLE/device/TOOLCHAIN_IAR/cy8c6xx7_cm4_dual.icf

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/***************************************************************************//**
22
* \file cy8c6xx7_cm4_dual.icf
3-
* \version 2.40
3+
* \version 2.50
44
*
55
* Linker file for the IAR compiler.
66
*
@@ -154,8 +154,9 @@ if (!isdefinedsymbol(__STACK_SIZE)) {
154154
define symbol __ICFEDIT_size_cstack__ = __STACK_SIZE;
155155
}
156156

157+
/* Defines the minimum heap size. The actual heap size will be expanded to the end of the stack region */
157158
if (!isdefinedsymbol(__HEAP_SIZE)) {
158-
define symbol __ICFEDIT_size_heap__ = 0x20000;
159+
define symbol __ICFEDIT_size_heap__ = 0x400;
159160
} else {
160161
define symbol __ICFEDIT_size_heap__ = __HEAP_SIZE;
161162
}
@@ -183,7 +184,7 @@ define block RAM_BSS {readwrite section .bss};
183184
define block RAM with fixed order {block RAM_DATA, block RAM_OTHER, block RAM_NOINIT, block RAM_BSS};
184185

185186
define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
186-
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
187+
define block HEAP with expanding size, alignment = 8, minimum size = __ICFEDIT_size_heap__ { };
187188

188189
define block CM0P_RO with size = FLASH_CM0P_SIZE { readonly section .cy_m0p_image };
189190
define block RO {first section .intvec, readonly};

targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CY8CKIT_062_BLE/device/TOOLCHAIN_IAR/startup_psoc6_01_cm4.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
;/**************************************************************************//**
2-
; * @file startup_psoc6_01_cm4.s
2+
; * @file startup_psoc6_01_cm4.S
33
; * @brief CMSIS Core Device Startup File for
44
; * ARMCM4 Device Series
55
; * @version V5.00

targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CY8CKIT_062_BLE/device/system_psoc6.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/***************************************************************************//**
22
* \file system_psoc6.h
3-
* \version 2.40
3+
* \version 2.50
44
*
55
* \brief Device system header file.
66
*
@@ -320,6 +320,11 @@
320320
* <th>Reason for Change</th>
321321
* </tr>
322322
* <tr>
323+
* <td>2.50</td>
324+
* <td>Updated assembler files, C files, linker scripts.</td>
325+
* <td>Dynamic allocated HEAP size for Arm Compiler 6, IAR 8.</td>
326+
* </tr>
327+
* <tr>
323328
* <td>2.40</td>
324329
* <td>Updated assembler files, C files, linker scripts.</td>
325330
* <td>Added Arm Compiler 6 support.</td>

0 commit comments

Comments
 (0)