Skip to content

Commit 2c5ed79

Browse files
author
Kyle Kearney
committed
Move BSP design.modus/GenSrc into its own component
Enables code examples/end user applications to override if necessary Add BSP_DESIGN_MODUS component by default to all PSOC6 boards. Applications can remove this if necessary.
1 parent 567293a commit 2c5ed79

File tree

90 files changed

+3929
-1
lines changed

Some content is hidden

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

90 files changed

+3929
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*******************************************************************************
2+
* File Name: cycfg_clocks.c
3+
*
4+
* Description:
5+
* Clock configuration
6+
* This file was automatically generated and should not be modified.
7+
*
8+
********************************************************************************
9+
* Copyright 2017-2019 Cypress Semiconductor Corporation
10+
* SPDX-License-Identifier: Apache-2.0
11+
*
12+
* Licensed under the Apache License, Version 2.0 (the "License");
13+
* you may not use this file except in compliance with the License.
14+
* You may obtain a copy of the License at
15+
*
16+
* http://www.apache.org/licenses/LICENSE-2.0
17+
*
18+
* Unless required by applicable law or agreed to in writing, software
19+
* distributed under the License is distributed on an "AS IS" BASIS,
20+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21+
* See the License for the specific language governing permissions and
22+
* limitations under the License.
23+
********************************************************************************/
24+
25+
#include "cycfg_clocks.h"
26+
27+
28+
void init_cycfg_clocks(void)
29+
{
30+
Cy_SysClk_PeriphDisableDivider(CY_SYSCLK_DIV_16_BIT, 0U);
31+
Cy_SysClk_PeriphSetDivider(CY_SYSCLK_DIV_16_BIT, 0U, 51U);
32+
Cy_SysClk_PeriphEnableDivider(CY_SYSCLK_DIV_16_BIT, 0U);
33+
34+
Cy_SysClk_PeriphDisableDivider(CY_SYSCLK_DIV_16_BIT, 1U);
35+
Cy_SysClk_PeriphSetDivider(CY_SYSCLK_DIV_16_BIT, 1U, 77U);
36+
Cy_SysClk_PeriphEnableDivider(CY_SYSCLK_DIV_16_BIT, 1U);
37+
38+
Cy_SysClk_PeriphDisableDivider(CY_SYSCLK_DIV_8_BIT, 0U);
39+
Cy_SysClk_PeriphSetDivider(CY_SYSCLK_DIV_8_BIT, 0U, 0U);
40+
Cy_SysClk_PeriphEnableDivider(CY_SYSCLK_DIV_8_BIT, 0U);
41+
42+
Cy_SysClk_PeriphDisableDivider(CY_SYSCLK_DIV_8_BIT, 1U);
43+
Cy_SysClk_PeriphSetDivider(CY_SYSCLK_DIV_8_BIT, 1U, 5U);
44+
Cy_SysClk_PeriphEnableDivider(CY_SYSCLK_DIV_8_BIT, 1U);
45+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/*******************************************************************************
2+
* File Name: cycfg_clocks.h
3+
*
4+
* Description:
5+
* Clock configuration
6+
* This file was automatically generated and should not be modified.
7+
*
8+
********************************************************************************
9+
* Copyright 2017-2019 Cypress Semiconductor Corporation
10+
* SPDX-License-Identifier: Apache-2.0
11+
*
12+
* Licensed under the Apache License, Version 2.0 (the "License");
13+
* you may not use this file except in compliance with the License.
14+
* You may obtain a copy of the License at
15+
*
16+
* http://www.apache.org/licenses/LICENSE-2.0
17+
*
18+
* Unless required by applicable law or agreed to in writing, software
19+
* distributed under the License is distributed on an "AS IS" BASIS,
20+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21+
* See the License for the specific language governing permissions and
22+
* limitations under the License.
23+
********************************************************************************/
24+
25+
#if !defined(CYCFG_CLOCKS_H)
26+
#define CYCFG_CLOCKS_H
27+
28+
#include "cycfg_notices.h"
29+
#include "cy_sysclk.h"
30+
31+
#if defined(__cplusplus)
32+
extern "C" {
33+
#endif
34+
35+
#define CYBSP_DEBUG_UART_CLK_DIV_ENABLED 1U
36+
#define CYBSP_DEBUG_UART_CLK_DIV_HW CY_SYSCLK_DIV_16_BIT
37+
#define CYBSP_DEBUG_UART_CLK_DIV_NUM 0U
38+
#define CYBSP_BT_UART_CLK_DIV_ENABLED 1U
39+
#define CYBSP_BT_UART_CLK_DIV_HW CY_SYSCLK_DIV_16_BIT
40+
#define CYBSP_BT_UART_CLK_DIV_NUM 1U
41+
#define CYBSP_CSD_CLK_DIV_ENABLED 1U
42+
#define CYBSP_CSD_CLK_DIV_HW CY_SYSCLK_DIV_8_BIT
43+
#define CYBSP_CSD_CLK_DIV_NUM 0U
44+
#define CYBSP_CSD_COMM_CLK_DIV_ENABLED 1U
45+
#define CYBSP_CSD_COMM_CLK_DIV_HW CY_SYSCLK_DIV_8_BIT
46+
#define CYBSP_CSD_COMM_CLK_DIV_NUM 1U
47+
48+
void init_cycfg_clocks(void);
49+
50+
#if defined(__cplusplus)
51+
}
52+
#endif
53+
54+
55+
#endif /* CYCFG_CLOCKS_H */
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
/*******************************************************************************
2+
* File Name: cycfg_peripherals.c
3+
*
4+
* Description:
5+
* Peripheral Hardware Block configuration
6+
* This file was automatically generated and should not be modified.
7+
*
8+
********************************************************************************
9+
* Copyright 2017-2019 Cypress Semiconductor Corporation
10+
* SPDX-License-Identifier: Apache-2.0
11+
*
12+
* Licensed under the Apache License, Version 2.0 (the "License");
13+
* you may not use this file except in compliance with the License.
14+
* You may obtain a copy of the License at
15+
*
16+
* http://www.apache.org/licenses/LICENSE-2.0
17+
*
18+
* Unless required by applicable law or agreed to in writing, software
19+
* distributed under the License is distributed on an "AS IS" BASIS,
20+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21+
* See the License for the specific language governing permissions and
22+
* limitations under the License.
23+
********************************************************************************/
24+
25+
#include "cycfg_peripherals.h"
26+
27+
cy_stc_csd_context_t cy_csd_0_context =
28+
{
29+
.lockKey = CY_CSD_NONE_KEY,
30+
};
31+
const cy_stc_scb_uart_config_t CYBSP_BT_UART_config =
32+
{
33+
.uartMode = CY_SCB_UART_STANDARD,
34+
.enableMutliProcessorMode = false,
35+
.smartCardRetryOnNack = false,
36+
.irdaInvertRx = false,
37+
.irdaEnableLowPowerReceiver = false,
38+
.oversample = 8,
39+
.enableMsbFirst = false,
40+
.dataWidth = 8UL,
41+
.parity = CY_SCB_UART_PARITY_NONE,
42+
.stopBits = CY_SCB_UART_STOP_BITS_1,
43+
.enableInputFilter = false,
44+
.breakWidth = 11UL,
45+
.dropOnFrameError = false,
46+
.dropOnParityError = false,
47+
.receiverAddress = 0x0UL,
48+
.receiverAddressMask = 0x0UL,
49+
.acceptAddrInFifo = false,
50+
.enableCts = true,
51+
.ctsPolarity = CY_SCB_UART_ACTIVE_LOW,
52+
.rtsRxFifoLevel = 63,
53+
.rtsPolarity = CY_SCB_UART_ACTIVE_LOW,
54+
.rxFifoTriggerLevel = 1UL,
55+
.rxFifoIntEnableMask = 0UL,
56+
.txFifoTriggerLevel = 63UL,
57+
.txFifoIntEnableMask = 0UL,
58+
};
59+
const cy_stc_scb_ezi2c_config_t CYBSP_CSD_COMM_config =
60+
{
61+
.numberOfAddresses = CY_SCB_EZI2C_ONE_ADDRESS,
62+
.slaveAddress1 = 8U,
63+
.slaveAddress2 = 0U,
64+
.subAddressSize = CY_SCB_EZI2C_SUB_ADDR16_BITS,
65+
.enableWakeFromSleep = false,
66+
};
67+
const cy_stc_scb_uart_config_t CYBSP_DEBUG_UART_config =
68+
{
69+
.uartMode = CY_SCB_UART_STANDARD,
70+
.enableMutliProcessorMode = false,
71+
.smartCardRetryOnNack = false,
72+
.irdaInvertRx = false,
73+
.irdaEnableLowPowerReceiver = false,
74+
.oversample = 12,
75+
.enableMsbFirst = false,
76+
.dataWidth = 9UL,
77+
.parity = CY_SCB_UART_PARITY_NONE,
78+
.stopBits = CY_SCB_UART_STOP_BITS_1,
79+
.enableInputFilter = false,
80+
.breakWidth = 11UL,
81+
.dropOnFrameError = false,
82+
.dropOnParityError = false,
83+
.receiverAddress = 0x0UL,
84+
.receiverAddressMask = 0x0UL,
85+
.acceptAddrInFifo = false,
86+
.enableCts = true,
87+
.ctsPolarity = CY_SCB_UART_ACTIVE_HIGH,
88+
.rtsRxFifoLevel = 63,
89+
.rtsPolarity = CY_SCB_UART_ACTIVE_LOW,
90+
.rxFifoTriggerLevel = 63UL,
91+
.rxFifoIntEnableMask = 0UL,
92+
.txFifoTriggerLevel = 63UL,
93+
.txFifoIntEnableMask = 0UL,
94+
};
95+
cy_en_sd_host_card_capacity_t CYBSP_RADIO_cardCapacity = CY_SD_HOST_SDSC;
96+
cy_en_sd_host_card_type_t CYBSP_RADIO_cardType = CY_SD_HOST_NOT_EMMC;
97+
uint32_t CYBSP_RADIO_rca = 0u;
98+
const cy_stc_sd_host_init_config_t CYBSP_RADIO_config =
99+
{
100+
.emmc = false,
101+
.dmaType = CY_SD_HOST_DMA_SDMA,
102+
.enableLedControl = false,
103+
};
104+
cy_stc_sd_host_sd_card_config_t CYBSP_RADIO_card_cfg =
105+
{
106+
.lowVoltageSignaling = false,
107+
.busWidth = CY_SD_HOST_BUS_WIDTH_4_BIT,
108+
.cardType = &CYBSP_RADIO_cardType,
109+
.rca = &CYBSP_RADIO_rca,
110+
.cardCapacity = &CYBSP_RADIO_cardCapacity,
111+
};
112+
const cy_stc_smif_config_t CYBSP_QSPI_config =
113+
{
114+
.mode = (uint32_t)CY_SMIF_NORMAL,
115+
.deselectDelay = CYBSP_QSPI_DESELECT_DELAY,
116+
.rxClockSel = (uint32_t)CY_SMIF_SEL_INV_INTERNAL_CLK,
117+
.blockEvent = (uint32_t)CY_SMIF_BUS_ERROR,
118+
};
119+
const cy_stc_mcwdt_config_t CYBSP_MCWDT_config =
120+
{
121+
.c0Match = 32768U,
122+
.c1Match = 32768U,
123+
.c0Mode = CY_MCWDT_MODE_NONE,
124+
.c1Mode = CY_MCWDT_MODE_NONE,
125+
.c2ToggleBit = 16U,
126+
.c2Mode = CY_MCWDT_MODE_NONE,
127+
.c0ClearOnMatch = false,
128+
.c1ClearOnMatch = false,
129+
.c0c1Cascade = true,
130+
.c1c2Cascade = false,
131+
};
132+
const cy_stc_rtc_config_t CYBSP_RTC_config =
133+
{
134+
.sec = 0U,
135+
.min = 0U,
136+
.hour = 12U,
137+
.amPm = CY_RTC_AM,
138+
.hrFormat = CY_RTC_24_HOURS,
139+
.dayOfWeek = CY_RTC_SUNDAY,
140+
.date = 1U,
141+
.month = CY_RTC_JANUARY,
142+
.year = 0U,
143+
};
144+
145+
146+
void init_cycfg_peripherals(void)
147+
{
148+
Cy_SysClk_PeriphAssignDivider(PCLK_CSD_CLOCK, CY_SYSCLK_DIV_8_BIT, 0U);
149+
150+
Cy_SysClk_PeriphAssignDivider(PCLK_SCB2_CLOCK, CY_SYSCLK_DIV_16_BIT, 1U);
151+
152+
Cy_SysClk_PeriphAssignDivider(PCLK_SCB3_CLOCK, CY_SYSCLK_DIV_8_BIT, 1U);
153+
154+
Cy_SysClk_PeriphAssignDivider(PCLK_SCB5_CLOCK, CY_SYSCLK_DIV_16_BIT, 0U);
155+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
/*******************************************************************************
2+
* File Name: cycfg_peripherals.h
3+
*
4+
* Description:
5+
* Peripheral Hardware Block configuration
6+
* This file was automatically generated and should not be modified.
7+
*
8+
********************************************************************************
9+
* Copyright 2017-2019 Cypress Semiconductor Corporation
10+
* SPDX-License-Identifier: Apache-2.0
11+
*
12+
* Licensed under the Apache License, Version 2.0 (the "License");
13+
* you may not use this file except in compliance with the License.
14+
* You may obtain a copy of the License at
15+
*
16+
* http://www.apache.org/licenses/LICENSE-2.0
17+
*
18+
* Unless required by applicable law or agreed to in writing, software
19+
* distributed under the License is distributed on an "AS IS" BASIS,
20+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21+
* See the License for the specific language governing permissions and
22+
* limitations under the License.
23+
********************************************************************************/
24+
25+
#if !defined(CYCFG_PERIPHERALS_H)
26+
#define CYCFG_PERIPHERALS_H
27+
28+
#include "cycfg_notices.h"
29+
#include "cy_sysclk.h"
30+
#include "cy_csd.h"
31+
#include "cy_scb_uart.h"
32+
#include "cy_scb_ezi2c.h"
33+
#include "cy_sd_host.h"
34+
#include "cy_smif.h"
35+
#include "cy_mcwdt.h"
36+
#include "cy_rtc.h"
37+
38+
#if defined(__cplusplus)
39+
extern "C" {
40+
#endif
41+
42+
#define CYBSP_CAPSENSE_ENABLED 1U
43+
#define CY_CAPSENSE_CORE 4u
44+
#define CY_CAPSENSE_CPU_CLK 144000000u
45+
#define CY_CAPSENSE_PERI_CLK 72000000u
46+
#define CY_CAPSENSE_VDDA_MV 3300u
47+
#define CY_CAPSENSE_PERI_DIV_TYPE CY_SYSCLK_DIV_8_BIT
48+
#define CY_CAPSENSE_PERI_DIV_INDEX 0u
49+
#define Cmod_PORT GPIO_PRT7
50+
#define CintA_PORT GPIO_PRT7
51+
#define CintB_PORT GPIO_PRT7
52+
#define Button0_Rx0_PORT GPIO_PRT8
53+
#define Button0_Tx_PORT GPIO_PRT1
54+
#define Button1_Rx0_PORT GPIO_PRT8
55+
#define Button1_Tx_PORT GPIO_PRT1
56+
#define LinearSlider0_Sns0_PORT GPIO_PRT8
57+
#define LinearSlider0_Sns1_PORT GPIO_PRT8
58+
#define LinearSlider0_Sns2_PORT GPIO_PRT8
59+
#define LinearSlider0_Sns3_PORT GPIO_PRT8
60+
#define LinearSlider0_Sns4_PORT GPIO_PRT8
61+
#define Cmod_PIN 7u
62+
#define CintA_PIN 1u
63+
#define CintB_PIN 2u
64+
#define Button0_Rx0_PIN 1u
65+
#define Button0_Tx_PIN 0u
66+
#define Button1_Rx0_PIN 2u
67+
#define Button1_Tx_PIN 0u
68+
#define LinearSlider0_Sns0_PIN 3u
69+
#define LinearSlider0_Sns1_PIN 4u
70+
#define LinearSlider0_Sns2_PIN 5u
71+
#define LinearSlider0_Sns3_PIN 6u
72+
#define LinearSlider0_Sns4_PIN 7u
73+
#define Cmod_PORT_NUM 7u
74+
#define CintA_PORT_NUM 7u
75+
#define CintB_PORT_NUM 7u
76+
#define CYBSP_CAPSENSE_HW CSD0
77+
#define CYBSP_CAPSENSE_IRQ csd_interrupt_IRQn
78+
#define CYBSP_BT_UART_ENABLED 1U
79+
#define CYBSP_BT_UART_HW SCB2
80+
#define CYBSP_BT_UART_IRQ scb_2_interrupt_IRQn
81+
#define CYBSP_CSD_COMM_ENABLED 1U
82+
#define CYBSP_CSD_COMM_HW SCB3
83+
#define CYBSP_CSD_COMM_IRQ scb_3_interrupt_IRQn
84+
#define CYBSP_DEBUG_UART_ENABLED 1U
85+
#define CYBSP_DEBUG_UART_HW SCB5
86+
#define CYBSP_DEBUG_UART_IRQ scb_5_interrupt_IRQn
87+
#define CYBSP_RADIO_ENABLED 1U
88+
#define CYBSP_RADIO_HW SDHC0
89+
#define CYBSP_RADIO_IRQ sdhc_0_interrupt_general_IRQn
90+
#define CYBSP_QSPI_ENABLED 1U
91+
#define CYBSP_QSPI_HW SMIF0
92+
#define CYBSP_QSPI_IRQ smif_interrupt_IRQn
93+
#define CYBSP_QSPI_MEMORY_MODE_ALIGMENT_ERROR (0UL)
94+
#define CYBSP_QSPI_RX_DATA_FIFO_UNDERFLOW (0UL)
95+
#define CYBSP_QSPI_TX_COMMAND_FIFO_OVERFLOW (0UL)
96+
#define CYBSP_QSPI_TX_DATA_FIFO_OVERFLOW (0UL)
97+
#define CYBSP_QSPI_RX_FIFO_TRIGEER_LEVEL (0UL)
98+
#define CYBSP_QSPI_TX_FIFO_TRIGEER_LEVEL (0UL)
99+
#define CYBSP_QSPI_DATALINES0_1 (1UL)
100+
#define CYBSP_QSPI_DATALINES2_3 (1UL)
101+
#define CYBSP_QSPI_DATALINES4_5 (0UL)
102+
#define CYBSP_QSPI_DATALINES6_7 (0UL)
103+
#define CYBSP_QSPI_SS0 (1UL)
104+
#define CYBSP_QSPI_SS1 (0UL)
105+
#define CYBSP_QSPI_SS2 (0UL)
106+
#define CYBSP_QSPI_SS3 (0UL)
107+
#define CYBSP_QSPI_DESELECT_DELAY 7
108+
#define CYBSP_MCWDT_ENABLED 1U
109+
#define CYBSP_MCWDT_HW MCWDT_STRUCT0
110+
#define CYBSP_RTC_ENABLED 1U
111+
#define CYBSP_RTC_10_MONTH_OFFSET (28U)
112+
#define CYBSP_RTC_MONTH_OFFSET (24U)
113+
#define CYBSP_RTC_10_DAY_OFFSET (20U)
114+
#define CYBSP_RTC_DAY_OFFSET (16U)
115+
#define CYBSP_RTC_1000_YEAR_OFFSET (12U)
116+
#define CYBSP_RTC_100_YEAR_OFFSET (8U)
117+
#define CYBSP_RTC_10_YEAR_OFFSET (4U)
118+
#define CYBSP_RTC_YEAR_OFFSET (0U)
119+
120+
extern cy_stc_csd_context_t cy_csd_0_context;
121+
extern const cy_stc_scb_uart_config_t CYBSP_BT_UART_config;
122+
extern const cy_stc_scb_ezi2c_config_t CYBSP_CSD_COMM_config;
123+
extern const cy_stc_scb_uart_config_t CYBSP_DEBUG_UART_config;
124+
extern cy_en_sd_host_card_capacity_t CYBSP_RADIO_cardCapacity;
125+
extern cy_en_sd_host_card_type_t CYBSP_RADIO_cardType;
126+
extern uint32_t CYBSP_RADIO_rca;
127+
extern const cy_stc_sd_host_init_config_t CYBSP_RADIO_config;
128+
extern cy_stc_sd_host_sd_card_config_t CYBSP_RADIO_card_cfg;
129+
extern const cy_stc_smif_config_t CYBSP_QSPI_config;
130+
extern const cy_stc_mcwdt_config_t CYBSP_MCWDT_config;
131+
extern const cy_stc_rtc_config_t CYBSP_RTC_config;
132+
133+
void init_cycfg_peripherals(void);
134+
135+
#if defined(__cplusplus)
136+
}
137+
#endif
138+
139+
140+
#endif /* CYCFG_PERIPHERALS_H */

0 commit comments

Comments
 (0)