Skip to content

Commit 4b42f58

Browse files
committed
Initial addition of files to support CY8CKIT_064S2_4343W target
1 parent 1798c24 commit 4b42f58

Some content is hidden

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

41 files changed

+11655
-50
lines changed

drivers/internal/Task.h

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ namespace events {
2929
*/
3030

3131

32-
template<typename F, typename A1 = void, typename A2 = void, typename A3 = void, typename A4 = void, typename A5 = void>
32+
template<typename F, typename ARG1 = void, typename ARG2 = void, typename ARG3 = void, typename ARG4 = void, typename ARG5 = void>
3333
struct AllArgs;
3434

3535
template<typename B0>
@@ -543,22 +543,22 @@ class Task<R()>: public TaskBase {
543543
All _args;
544544
};
545545

546-
template <typename R, typename A0>
547-
class Task<R(A0)>: public TaskBase {
546+
template <typename R, typename ARG0>
547+
class Task<R(ARG0)>: public TaskBase {
548548
public:
549549

550-
Task(TaskQueue *q = NULL, mbed::Callback<R(A0)> cb = mbed::Callback<R(A0)>())
550+
Task(TaskQueue *q = NULL, mbed::Callback<R(ARG0)> cb = mbed::Callback<R(ARG0)>())
551551
: TaskBase(q), _args(cb)
552552
{
553553
}
554554

555-
Task &operator=(mbed::Callback<R(A0)> cb)
555+
Task &operator=(mbed::Callback<R(ARG0)> cb)
556556
{
557557
_args.b0 = cb;
558558
return *this;
559559
}
560560

561-
void call(A0 a0)
561+
void call(ARG0 a0)
562562
{
563563
_args.b1 = a0;
564564
post();
@@ -578,16 +578,16 @@ class Task<R(A0)>: public TaskBase {
578578
}
579579

580580
private:
581-
typedef AllArgs<mbed::Callback<R(A0)>, A0> All;
581+
typedef AllArgs<mbed::Callback<R(ARG0)>, ARG0> All;
582582
All _args;
583583
};
584584

585585
/** Task
586586
*
587587
* Representation of a postable task
588588
*/
589-
template <typename R, typename A0, typename A1>
590-
class Task<R(A0, A1)>: public TaskBase {
589+
template <typename R, typename ARG0, typename ARG1>
590+
class Task<R(ARG0, ARG1)>: public TaskBase {
591591
public:
592592

593593
/**
@@ -596,7 +596,7 @@ class Task<R(A0, A1)>: public TaskBase {
596596
* @param q TaskQueue to post to
597597
* @param cb Callback to run
598598
*/
599-
Task(TaskQueue *q = NULL, mbed::Callback<R(A0, A1)> cb = mbed::Callback<R(A0, A1)>())
599+
Task(TaskQueue *q = NULL, mbed::Callback<R(ARG0, ARG1)> cb = mbed::Callback<R(ARG0, ARG1)>())
600600
: TaskBase(q), _args(cb)
601601
{
602602
}
@@ -606,7 +606,7 @@ class Task<R(A0, A1)>: public TaskBase {
606606
*
607607
* @param cb Callback to run
608608
*/
609-
Task &operator=(mbed::Callback<R(A0, A1)> cb)
609+
Task &operator=(mbed::Callback<R(ARG0, ARG1)> cb)
610610
{
611611
_args.b0 = cb;
612612
return *this;
@@ -623,7 +623,7 @@ class Task<R(A0, A1)>: public TaskBase {
623623
* @param a0 First callback parameter
624624
* @param a1 Second callback parameter
625625
*/
626-
void call(A0 a0, A1 a1)
626+
void call(ARG0 a0, ARG1 a1)
627627
{
628628
_args.b1 = a0;
629629
_args.b2 = a1;
@@ -644,7 +644,7 @@ class Task<R(A0, A1)>: public TaskBase {
644644
}
645645

646646
private:
647-
typedef AllArgs<mbed::Callback<R(A0, A1)>, A0, A1> All;
647+
typedef AllArgs<mbed::Callback<R(ARG0, ARG1)>, ARG0, ARG1> All;
648648
All _args;
649649
};
650650

platform/FunctionPointer.h

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,37 +32,37 @@ namespace mbed {
3232

3333
// Declarations for backwards compatibility
3434
// To be foward compatible, code should adopt the Callback class
35-
template <typename R, typename A1>
36-
class FunctionPointerArg1 : public Callback<R(A1)> {
35+
template <typename R, typename ARG1>
36+
class FunctionPointerArg1 : public Callback<R(ARG1)> {
3737
public:
3838
MBED_DEPRECATED_SINCE("mbed-os-5.1",
3939
"FunctionPointerArg1<R, A> has been replaced by Callback<R(A)>")
40-
FunctionPointerArg1(R(*function)(A1) = 0)
41-
: Callback<R(A1)>(function) {}
40+
FunctionPointerArg1(R(*function)(ARG1) = 0)
41+
: Callback<R(ARG1)>(function) {}
4242

4343
template<typename T>
4444
MBED_DEPRECATED_SINCE("mbed-os-5.1",
4545
"FunctionPointerArg1<R, A> has been replaced by Callback<R(A)>")
46-
FunctionPointerArg1(T *object, R(T::*member)(A1))
47-
: Callback<R(A1)>(object, member) {}
46+
FunctionPointerArg1(T *object, R(T::*member)(ARG1))
47+
: Callback<R(ARG1)>(object, member) {}
4848

49-
R(*get_function())(A1)
49+
R(*get_function())(ARG1)
5050
{
51-
return *reinterpret_cast<R(* *)(A1)>(this);
51+
return *reinterpret_cast<R(* *)(ARG1)>(this);
5252
}
5353

54-
R call(A1 a1) const
54+
R call(ARG1 a1) const
5555
{
56-
if (!Callback<R(A1)>::operator bool()) {
56+
if (!Callback<R(ARG1)>::operator bool()) {
5757
return (R)0;
5858
}
5959

60-
return Callback<R(A1)>::call(a1);
60+
return Callback<R(ARG1)>::call(a1);
6161
}
6262

63-
R operator()(A1 a1) const
63+
R operator()(ARG1 a1) const
6464
{
65-
return Callback<R(A1)>::call(a1);
65+
return Callback<R(ARG1)>::call(a1);
6666
}
6767
};
6868

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*******************************************************************************
2+
* File Name: cycfg.c
3+
*
4+
* Description:
5+
* Wrapper function to initialize all generated code.
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.h"
26+
27+
void init_cycfg_all(void)
28+
{
29+
init_cycfg_system();
30+
init_cycfg_clocks();
31+
init_cycfg_dmas();
32+
init_cycfg_routing();
33+
init_cycfg_peripherals();
34+
init_cycfg_pins();
35+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/*******************************************************************************
2+
* File Name: cycfg.h
3+
*
4+
* Description:
5+
* Simple wrapper header containing all generated files.
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_H)
26+
#define CYCFG_H
27+
28+
#if defined(__cplusplus)
29+
extern "C" {
30+
#endif
31+
32+
#include "cycfg_notices.h"
33+
#include "cycfg_system.h"
34+
#include "cycfg_clocks.h"
35+
#include "cycfg_dmas.h"
36+
#include "cycfg_routing.h"
37+
#include "cycfg_peripherals.h"
38+
#include "cycfg_pins.h"
39+
40+
void init_cycfg_all(void);
41+
42+
43+
#if defined(__cplusplus)
44+
}
45+
#endif
46+
47+
48+
#endif /* CYCFG_H */
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*******************************************************************************
2+
* File Name: cycfg.timestamp
3+
*
4+
* Description:
5+
* Sentinel file for determining if generated source is up to date.
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+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
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+
#if defined (CY_USING_HAL)
28+
const cyhal_resource_inst_t CYBSP_USB_CLK_DIV_obj =
29+
{
30+
.type = CYHAL_RSC_CLOCK,
31+
.block_num = CYBSP_USB_CLK_DIV_HW,
32+
.channel_num = CYBSP_USB_CLK_DIV_NUM,
33+
};
34+
#endif //defined (CY_USING_HAL)
35+
#if defined (CY_USING_HAL)
36+
const cyhal_resource_inst_t CYBSP_SDIO_DIV_obj =
37+
{
38+
.type = CYHAL_RSC_CLOCK,
39+
.block_num = CYBSP_SDIO_DIV_HW,
40+
.channel_num = CYBSP_SDIO_DIV_NUM,
41+
};
42+
#endif //defined (CY_USING_HAL)
43+
#if defined (CY_USING_HAL)
44+
const cyhal_resource_inst_t CYBSP_CSD_COMM_CLK_DIV_obj =
45+
{
46+
.type = CYHAL_RSC_CLOCK,
47+
.block_num = CYBSP_CSD_COMM_CLK_DIV_HW,
48+
.channel_num = CYBSP_CSD_COMM_CLK_DIV_NUM,
49+
};
50+
#endif //defined (CY_USING_HAL)
51+
#if defined (CY_USING_HAL)
52+
const cyhal_resource_inst_t CYBSP_CSD_CLK_DIV_obj =
53+
{
54+
.type = CYHAL_RSC_CLOCK,
55+
.block_num = CYBSP_CSD_CLK_DIV_HW,
56+
.channel_num = CYBSP_CSD_CLK_DIV_NUM,
57+
};
58+
#endif //defined (CY_USING_HAL)
59+
#if defined (CY_USING_HAL)
60+
const cyhal_resource_inst_t peri_0_div_8_4_obj =
61+
{
62+
.type = CYHAL_RSC_CLOCK,
63+
.block_num = peri_0_div_8_4_HW,
64+
.channel_num = peri_0_div_8_4_NUM,
65+
};
66+
#endif //defined (CY_USING_HAL)
67+
68+
69+
void init_cycfg_clocks(void)
70+
{
71+
Cy_SysClk_PeriphDisableDivider(CY_SYSCLK_DIV_16_BIT, 0U);
72+
Cy_SysClk_PeriphSetDivider(CY_SYSCLK_DIV_16_BIT, 0U, 999U);
73+
Cy_SysClk_PeriphEnableDivider(CY_SYSCLK_DIV_16_BIT, 0U);
74+
#if defined (CY_USING_HAL)
75+
cyhal_hwmgr_reserve(&CYBSP_USB_CLK_DIV_obj);
76+
#endif //defined (CY_USING_HAL)
77+
78+
Cy_SysClk_PeriphDisableDivider(CY_SYSCLK_DIV_8_BIT, 0U);
79+
Cy_SysClk_PeriphSetDivider(CY_SYSCLK_DIV_8_BIT, 0U, 0U);
80+
Cy_SysClk_PeriphEnableDivider(CY_SYSCLK_DIV_8_BIT, 0U);
81+
#if defined (CY_USING_HAL)
82+
cyhal_hwmgr_reserve(&CYBSP_SDIO_DIV_obj);
83+
#endif //defined (CY_USING_HAL)
84+
85+
Cy_SysClk_PeriphDisableDivider(CY_SYSCLK_DIV_8_BIT, 1U);
86+
Cy_SysClk_PeriphSetDivider(CY_SYSCLK_DIV_8_BIT, 1U, 7U);
87+
Cy_SysClk_PeriphEnableDivider(CY_SYSCLK_DIV_8_BIT, 1U);
88+
#if defined (CY_USING_HAL)
89+
cyhal_hwmgr_reserve(&CYBSP_CSD_COMM_CLK_DIV_obj);
90+
#endif //defined (CY_USING_HAL)
91+
92+
Cy_SysClk_PeriphDisableDivider(CY_SYSCLK_DIV_8_BIT, 3U);
93+
Cy_SysClk_PeriphSetDivider(CY_SYSCLK_DIV_8_BIT, 3U, 255U);
94+
Cy_SysClk_PeriphEnableDivider(CY_SYSCLK_DIV_8_BIT, 3U);
95+
#if defined (CY_USING_HAL)
96+
cyhal_hwmgr_reserve(&CYBSP_CSD_CLK_DIV_obj);
97+
#endif //defined (CY_USING_HAL)
98+
99+
Cy_SysClk_PeriphDisableDivider(CY_SYSCLK_DIV_8_BIT, 4U);
100+
Cy_SysClk_PeriphSetDivider(CY_SYSCLK_DIV_8_BIT, 4U, 108U);
101+
Cy_SysClk_PeriphEnableDivider(CY_SYSCLK_DIV_8_BIT, 4U);
102+
#if defined (CY_USING_HAL)
103+
cyhal_hwmgr_reserve(&peri_0_div_8_4_obj);
104+
#endif //defined (CY_USING_HAL)
105+
}

0 commit comments

Comments
 (0)