Skip to content

Commit d37026d

Browse files
committed
Updated TARGET_Cypress sub-tree for FUTURE_SEQUANA target:
1. Complete set of HAL drivers for all peripherals of CY8C63xx PSoC chips. 2. Cypress PDL library updated to official 3.0.1 version. 3. Tree structure reorganized and cleaned up: + TARGET_Cypress +--+ TARGET_PSOC6+ -> code & libs applicable to all PSoC 6 based devices +--+ TARGET_CY86XX -> code & libs applicable to PSoC 63 based devices | +--- TARGET_MCU_PSOC6_M0 -> code & libs applicable to PSoC6 Corted M0+ core | +--- TARGET_MCU_PSOC6_M4 -> code & libs applicable to PSoC6 Corted M0F core | +--+ TARGET_FUTURE_SEQUANA -> code applicable to Sequana board, both cores +--- TARGET_FUTURE_SEQUANA_M0 -> code applicable only to M0+ core on Sequana board
1 parent ec22815 commit d37026d

File tree

321 files changed

+29020
-99324
lines changed

Some content is hidden

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

321 files changed

+29020
-99324
lines changed
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
/*
2+
* mbed Microcontroller Library
3+
* Copyright (c) 2017-2018 Future Electronics
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
#ifndef MBED_PERIPHERALNAMES_H
19+
#define MBED_PERIPHERALNAMES_H
20+
21+
#include "cmsis.h"
22+
#include "PinNames.h"
23+
24+
#ifdef __cplusplus
25+
extern "C" {
26+
#endif
27+
28+
typedef enum {
29+
UART_0 = (int)SCB0_BASE,
30+
UART_1 = (int)SCB1_BASE,
31+
UART_2 = (int)SCB2_BASE,
32+
UART_3 = (int)SCB3_BASE,
33+
UART_4 = (int)SCB4_BASE,
34+
UART_5 = (int)SCB5_BASE,
35+
UART_6 = (int)SCB6_BASE,
36+
UART_7 = (int)SCB7_BASE,
37+
} UARTName;
38+
39+
40+
typedef enum {
41+
SPI_0 = (int)SCB0_BASE,
42+
SPI_1 = (int)SCB1_BASE,
43+
SPI_2 = (int)SCB2_BASE,
44+
SPI_3 = (int)SCB3_BASE,
45+
SPI_4 = (int)SCB4_BASE,
46+
SPI_5 = (int)SCB5_BASE,
47+
SPI_6 = (int)SCB6_BASE,
48+
SPI_7 = (int)SCB7_BASE,
49+
} SPIName;
50+
51+
typedef enum {
52+
I2C_0 = (int)SCB0_BASE,
53+
I2C_1 = (int)SCB1_BASE,
54+
I2C_2 = (int)SCB2_BASE,
55+
I2C_3 = (int)SCB3_BASE,
56+
I2C_4 = (int)SCB4_BASE,
57+
I2C_5 = (int)SCB5_BASE,
58+
I2C_6 = (int)SCB6_BASE,
59+
I2C_7 = (int)SCB7_BASE,
60+
} I2CName;
61+
62+
typedef enum {
63+
PWM_32b_0 = TCPWM0_BASE,
64+
PWM_32b_1,
65+
PWM_32b_2,
66+
PWM_32b_3,
67+
PWM_32b_4,
68+
PWM_32b_5,
69+
PWM_32b_6,
70+
PWM_32b_7,
71+
PWM_16b_0 = TCPWM1_BASE,
72+
PWM_16b_1,
73+
PWM_16b_2,
74+
PWM_16b_3,
75+
PWM_16b_4,
76+
PWM_16b_5,
77+
PWM_16b_6,
78+
PWM_16b_7,
79+
PWM_16b_8,
80+
PWM_16b_9,
81+
PWM_16b_10,
82+
PWM_16b_11,
83+
PWM_16b_12,
84+
PWM_16b_13,
85+
PWM_16b_14,
86+
PWM_16b_15,
87+
PWM_16b_16,
88+
PWM_16b_17,
89+
PWM_16b_18,
90+
PWM_16b_19,
91+
PWM_16b_20,
92+
PWM_16b_21,
93+
PWM_16b_22,
94+
PWM_16b_23,
95+
} PWMName;
96+
97+
typedef enum {
98+
ADC_0 = (int)SAR_BASE,
99+
}ADCName;
100+
101+
typedef enum {
102+
DAC_0 = (int)CTDAC0_BASE,
103+
} DACName;
104+
105+
#ifdef __cplusplus
106+
}
107+
#endif
108+
109+
#endif
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/*
2+
* mbed Microcontroller Library
3+
* Copyright (c) 2017-2018 Future Electronics
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
#ifndef MBED_PERIPHERALPINS_H
19+
#define MBED_PERIPHERALPINS_H
20+
21+
#include "pinmap.h"
22+
#include "PeripheralNames.h"
23+
24+
25+
// //*** I2C ***
26+
#if DEVICE_I2C
27+
extern const PinMap PinMap_I2C_SDA[];
28+
extern const PinMap PinMap_I2C_SCL[];
29+
#endif
30+
31+
//*** PWM ***
32+
#if DEVICE_PWMOUT
33+
extern const PinMap PinMap_PWM_OUT[];
34+
#endif
35+
36+
//*** SERIAL ***
37+
#ifdef DEVICE_SERIAL
38+
extern const PinMap PinMap_UART_TX[];
39+
extern const PinMap PinMap_UART_RX[];
40+
extern const PinMap PinMap_UART_RTS[];
41+
extern const PinMap PinMap_UART_CTS[];
42+
#endif
43+
44+
//*** SPI ***
45+
#ifdef DEVICE_SPI
46+
extern const PinMap PinMap_SPI_MOSI[];
47+
extern const PinMap PinMap_SPI_MISO[];
48+
extern const PinMap PinMap_SPI_SCLK[];
49+
extern const PinMap PinMap_SPI_SSEL[];
50+
#endif
51+
52+
//*** ADC ***
53+
#ifdef DEVICE_ANALOGIN
54+
extern const PinMap PinMap_ADC[];
55+
#endif
56+
57+
//*** DAC ***
58+
#ifdef DEVICE_ANALOGOUT
59+
extern const PinMap PinMap_DAC[];
60+
#endif
61+
62+
#endif
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
/*
2+
* mbed Microcontroller Library
3+
* Copyright (c) 2017-2018 Future Electronics
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
#ifndef MBED_PINNAMESTYPES_H
19+
#define MBED_PINNAMESTYPES_H
20+
21+
#include "cmsis.h"
22+
23+
typedef enum {
24+
PIN_INPUT = 0,
25+
PIN_OUTPUT
26+
} PinDirection;
27+
28+
typedef enum {
29+
PullNone = 0,
30+
PullUp = 1,
31+
PullDown = 2,
32+
OpenDrainDriveLow = 3,
33+
OpenDrainDriveHigh = 4,
34+
OpenDrain = OpenDrainDriveLow,
35+
PushPull = 5,
36+
AnalogMode = 6,
37+
PullDefault = PullNone
38+
} PinMode;
39+
40+
typedef struct {
41+
en_hsiom_sel_t hsiom : 8;
42+
en_clk_dst_t clock : 8;
43+
PinMode mode : 4;
44+
PinDirection dir : 1;
45+
} PinFunction;
46+
47+
// Encode pin function.
48+
// Output function
49+
#define CY_PIN_FUNCTION(hsiom, clock, mode, dir) (int)(((dir) << 20) | ((mode) << 16) | ((clock) << 8) | (hsiom))
50+
#define CY_PIN_OUT_FUNCTION(hsiom, clock) CY_PIN_FUNCTION(hsiom, clock, PushPull, PIN_OUTPUT)
51+
#define CY_PIN_OD_FUNCTION(hsiom, clock) CY_PIN_FUNCTION(hsiom, clock, OpenDrain, PIN_OUTPUT)
52+
#define CY_PIN_IN_FUNCTION(hsiom, clock) CY_PIN_FUNCTION(hsiom, clock, PullDefault, PIN_INPUT)
53+
#define CY_PIN_PULLUP_FUNCTION(hsiom, clock) CY_PIN_FUNCTION(hsiom, clock, PullUp, PIN_INPUT)
54+
#define CY_PIN_ANALOG_FUNCTION(clock) CY_PIN_FUNCTION(HSIOM_SEL_GPIO, clock, AnalogMode, 0)
55+
56+
// Create unique name to force 32-bit PWM usage on a pin.
57+
#define CY_PIN_FORCE_PWM_32(pin) ((uint32_t)(pin) + 0x8000)
58+
59+
static inline en_hsiom_sel_t CY_PIN_HSIOM(int function)
60+
{
61+
return (en_hsiom_sel_t)(function & 0xFF);
62+
}
63+
64+
static inline en_clk_dst_t CY_PIN_CLOCK(int function)
65+
{
66+
return (en_clk_dst_t)((function >> 8) & 0xFF);
67+
}
68+
69+
static inline PinMode CY_PIN_MODE(int function)
70+
{
71+
return (PinMode)((function >> 16) & 0x0F);
72+
}
73+
74+
static inline PinDirection CY_PIN_DIRECTION(int function)
75+
{
76+
return (PinDirection)((function >> 20) & 1);
77+
}
78+
79+
static inline int CY_PERIPHERAL_BASE(int peripheral)
80+
{
81+
return peripheral & 0xffff0000;
82+
}
83+
84+
#endif
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*
2+
* mbed Microcontroller Library
3+
* Copyright (c) 2017-2018 Future Electronics
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
#ifndef MBED_PORTNAMES_H
19+
#define MBED_PORTNAMES_H
20+
21+
#ifdef __cplusplus
22+
extern "C" {
23+
#endif
24+
25+
// Port[15-0]
26+
typedef enum {
27+
Port0 = 0x0,
28+
Port1 = 0x1,
29+
Port2 = 0x2,
30+
Port3 = 0x3,
31+
Port4 = 0x4,
32+
Port5 = 0x5,
33+
Port6 = 0x6,
34+
Port7 = 0x7,
35+
Port8 = 0x8,
36+
Port9 = 0x9,
37+
Port10 = 0xA,
38+
Port11 = 0xB,
39+
Port12 = 0xC,
40+
Port13 = 0xD,
41+
Port14 = 0xE
42+
} PortName;
43+
44+
#ifdef __cplusplus
45+
}
46+
#endif
47+
#endif

0 commit comments

Comments
 (0)