Skip to content

Commit 816d33f

Browse files
NodraakCruz Monrreal II
authored andcommitted
Initial support for PSoC 6.
1 parent 45c0fa1 commit 816d33f

File tree

141 files changed

+61826
-0
lines changed

Some content is hidden

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

141 files changed

+61826
-0
lines changed
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
/* mbed Microcontroller Library
2+
*******************************************************************************
3+
* Copyright (c) XXX
4+
* All rights reserved.
5+
*
6+
* Redistribution and use in source and binary forms, with or without
7+
* modification, are permitted provided that the following conditions are met:
8+
*
9+
* 1. Redistributions of source code must retain the above copyright notice,
10+
* this list of conditions and the following disclaimer.
11+
* 2. Redistributions in binary form must reproduce the above copyright notice,
12+
* this list of conditions and the following disclaimer in the documentation
13+
* and/or other materials provided with the distribution.
14+
* 3. Neither the name of ARM Limited nor the names of its contributors
15+
* may be used to endorse or promote products derived from this software
16+
* without specific prior written permission.
17+
*
18+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28+
*******************************************************************************
29+
*/
30+
31+
#ifndef MBED_PERIPHERALNAMES_H
32+
#define MBED_PERIPHERALNAMES_H
33+
34+
#include "cmsis.h"
35+
#include "PinNames.h"
36+
37+
#ifdef __cplusplus
38+
extern "C" {
39+
#endif
40+
41+
// typedef enum {
42+
// ADC_1 = (int)ADC1_BASE,
43+
// ADC_2 = (int)ADC2_BASE,
44+
// ADC_3 = (int)ADC3_BASE,
45+
// } ADCName;
46+
47+
// typedef enum {
48+
// DAC_1 = (int)DAC_BASE,
49+
// } DACName;
50+
51+
// typedef enum {
52+
// UART_1 = (int)USART1_BASE,
53+
// UART_2 = (int)USART2_BASE,
54+
// UART_3 = (int)USART3_BASE,
55+
// } UARTName;
56+
57+
#define STDIO_UART_TX CY_UART_TX
58+
#define STDIO_UART_RX CY_UART_RX
59+
60+
// typedef enum {
61+
// SPI_1 = (int)SPI1_BASE,
62+
// SPI_2 = (int)SPI2_BASE,
63+
// SPI_3 = (int)SPI3_BASE,
64+
// } SPIName;
65+
66+
// typedef enum {
67+
// I2C_0 = (int)I2C0_BASE,
68+
// I2C_1 = (int)I2C1_BASE,
69+
// } I2CName;
70+
71+
// typedef enum {
72+
// PWM_0 = (int)PWM_CH0_BASE,
73+
// PWM_1 = (int)PWM_CH1_BASE,
74+
// PWM_2 = (int)PWM_CH2_BASE,
75+
// PWM_3 = (int)PWM_CH3_BASE,
76+
// PWM_4 = (int)PWM_CH4_BASE,
77+
// PWM_5 = (int)PWM_CH5_BASE,
78+
// PWM_6 = (int)PWM_CH6_BASE,
79+
// PWM_7 = (int)PWM_CH7_BASE,
80+
// } PWMName;
81+
82+
// typedef enum {
83+
// CAN_1 = (int)CAN1_BASE,
84+
// } CANName;
85+
86+
#ifdef __cplusplus
87+
}
88+
#endif
89+
90+
#endif
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
/* mbed Microcontroller Library
2+
*******************************************************************************
3+
* Copyright (c) XXX
4+
* All rights reserved.
5+
*
6+
* Redistribution and use in source and binary forms, with or without
7+
* modification, are permitted provided that the following conditions are met:
8+
*
9+
* 1. Redistributions of source code must retain the above copyright notice,
10+
* this list of conditions and the following disclaimer.
11+
* 2. Redistributions in binary form must reproduce the above copyright notice,
12+
* this list of conditions and the following disclaimer in the documentation
13+
* and/or other materials provided with the distribution.
14+
* 3. Neither the name of ARM Limited nor the names of its contributors
15+
* may be used to endorse or promote products derived from this software
16+
* without specific prior written permission.
17+
*
18+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28+
*******************************************************************************
29+
*/
30+
31+
#ifndef MBED_PERIPHERALPINS_H
32+
#define MBED_PERIPHERALPINS_H
33+
34+
#include "pinmap.h"
35+
#include "PeripheralNames.h"
36+
37+
// //*** ADC ***
38+
// #ifdef DEVICE_ANALOGIN
39+
// extern const PinMap PinMap_ADC[];
40+
// #endif
41+
42+
// //*** DAC ***
43+
// #ifdef DEVICE_ANALOGOUT
44+
// extern const PinMap PinMap_DAC[];
45+
// #endif
46+
47+
// //*** I2C ***
48+
// #if DEVICE_I2C
49+
// extern const PinMap PinMap_I2C_SDA[];
50+
// extern const PinMap PinMap_I2C_SCL[];
51+
// #endif
52+
53+
// //*** PWM ***
54+
// #if DEVICE_PWMOUT
55+
// extern const PinMap PinMap_PWM[];
56+
// #endif
57+
58+
// //*** SERIAL ***
59+
// #ifdef DEVICE_SERIAL
60+
// extern const PinMap PinMap_UART_TX[];
61+
// extern const PinMap PinMap_UART_RX[];
62+
// #endif
63+
64+
// //*** I2C ***
65+
// #ifdef DEVICE_I2C
66+
// extern const PinMap PinMap_I2C_SDA[];
67+
// extern const PinMap PinMap_I2C_SCL[];
68+
// #endif
69+
70+
// //*** SPI ***
71+
// #ifdef DEVICE_SPI
72+
// extern const PinMap PinMap_SPI_MOSI[];
73+
// extern const PinMap PinMap_SPI_MISO[];
74+
// extern const PinMap PinMap_SPI_SCLK[];
75+
// extern const PinMap PinMap_SPI_SSEL[];
76+
// #endif
77+
78+
// //*** CAN ***
79+
// #ifdef DEVICE_CAN
80+
// extern const PinMap PinMap_CAN_RD[];
81+
// extern const PinMap PinMap_CAN_TD[];
82+
// #endif
83+
84+
#endif
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
/* mbed Microcontroller Library
2+
*******************************************************************************
3+
* Copyright (c) 2016, STMicroelectronics
4+
* All rights reserved.
5+
*
6+
* Redistribution and use in source and binary forms, with or without
7+
* modification, are permitted provided that the following conditions are met:
8+
*
9+
* 1. Redistributions of source code must retain the above copyright notice,
10+
* this list of conditions and the following disclaimer.
11+
* 2. Redistributions in binary form must reproduce the above copyright notice,
12+
* this list of conditions and the following disclaimer in the documentation
13+
* and/or other materials provided with the distribution.
14+
* 3. Neither the name of ARM nor the names of its contributors
15+
* may be used to endorse or promote products derived from this software
16+
* without specific prior written permission.
17+
*
18+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28+
*******************************************************************************
29+
*/
30+
31+
#ifndef MBED_PINNAMESTYPES_H
32+
#define MBED_PINNAMESTYPES_H
33+
34+
#include "cmsis.h"
35+
36+
#ifdef __cplusplus
37+
extern "C" {
38+
#endif
39+
40+
// PinName[15-0] = Port[15-8] + Pin[7-0]
41+
#define CYPRESS_PIN(pinname) ((pinname) & 0xFF)
42+
#define CYPRESS_PORT(pinname) (((pinname) >> 8) & 0xFF)
43+
44+
typedef enum {
45+
PIN_INPUT = 0,
46+
PIN_OUTPUT
47+
} PinDirection;
48+
49+
typedef enum {
50+
PullNone = 0,
51+
PullUp = 1,
52+
PullDown = 2,
53+
OpenDrainPullUp = 3,
54+
OpenDrainNoPull = 4,
55+
OpenDrainPullDown = 5,
56+
PushPullNoPull = PullNone,
57+
PushPullPullUp = PullUp,
58+
PushPullPullDown = PullDown,
59+
OpenDrain = OpenDrainPullUp,
60+
PullDefault = PullNone
61+
} PinMode;
62+
63+
#ifdef __cplusplus
64+
}
65+
#endif
66+
67+
#endif
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/* mbed Microcontroller Library
2+
*******************************************************************************
3+
* Copyright (c) XXX
4+
* All rights reserved.
5+
*
6+
* Redistribution and use in source and binary forms, with or without
7+
* modification, are permitted provided that the following conditions are met:
8+
*
9+
* 1. Redistributions of source code must retain the above copyright notice,
10+
* this list of conditions and the following disclaimer.
11+
* 2. Redistributions in binary form must reproduce the above copyright notice,
12+
* this list of conditions and the following disclaimer in the documentation
13+
* and/or other materials provided with the distribution.
14+
* 3. Neither the name of ARM Limited nor the names of its contributors
15+
* may be used to endorse or promote products derived from this software
16+
* without specific prior written permission.
17+
*
18+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28+
*******************************************************************************
29+
*/
30+
31+
#ifndef MBED_PORTNAMES_H
32+
#define MBED_PORTNAMES_H
33+
34+
#ifdef __cplusplus
35+
extern "C" {
36+
#endif
37+
38+
// Port[7-0]
39+
typedef enum {
40+
Port0 = 0x0,
41+
Port1 = 0x1,
42+
Port2 = 0x2,
43+
Port3 = 0x3,
44+
Port4 = 0x4,
45+
Port5 = 0x5,
46+
Port6 = 0x6,
47+
Port7 = 0x7,
48+
Port8 = 0x8,
49+
Port9 = 0x9,
50+
Port10 = 0xA,
51+
Port11 = 0xB,
52+
Port12 = 0xC,
53+
Port13 = 0xD,
54+
Port14 = 0xE,
55+
Port15 = 0xF
56+
} PortName;
57+
58+
#ifdef __cplusplus
59+
}
60+
#endif
61+
#endif

0 commit comments

Comments
 (0)