Skip to content

Commit 2a06ae2

Browse files
committed
Added missing pinmap definitions. Fixed target JSON config to avoid treating cc3220sf a target
1 parent 387bb66 commit 2a06ae2

File tree

8 files changed

+132
-3
lines changed

8 files changed

+132
-3
lines changed

targets/TARGET_TI/TARGET_CC32XX/TARGET_CC3220SF/PeripheralPins.h

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,31 @@
2424
extern const PinMap PinMap_GPIO[];
2525

2626
/************PWM****************/
27+
#if DEVICE_PWMOUT
2728
extern const PinMap PinMap_PWM[];
29+
#endif
2830

2931
/************UART***************/
32+
#if DEVICE_SERIAL
3033
extern const PinMap PinMap_UART_TX[];
3134
extern const PinMap PinMap_UART_RX[];
32-
extern const PinMap PinMap_UART_CTS[];
35+
#if DEVICE_SERIAL_FC
3336
extern const PinMap PinMap_UART_RTS[];
37+
extern const PinMap PinMap_UART_CTS[];
38+
#endif
39+
#endif
40+
41+
/************ADC***************/
42+
#if DEVICE_ANALOGIN
43+
extern const PinMap PinMap_ADC[];
44+
#endif
45+
46+
/************SPI***************/
47+
#if DEVICE_SPI
48+
extern const PinMap PinMap_SPI_MOSI[];
49+
extern const PinMap PinMap_SPI_MISO[];
50+
extern const PinMap PinMap_SPI_SCLK[];
51+
extern const PinMap PinMap_SPI_SSEL[];
52+
#endif
3453

3554
#endif

targets/TARGET_TI/TARGET_CC32XX/TARGET_CC3220SF/TARGET_CC3220SF_LAUNCHXL/PeripheralNames.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ typedef enum {
4343
PWM_6
4444
} PWMName;
4545

46+
typedef enum {
47+
GSPI = 0
48+
} SPIName;
49+
4650
#define STDIO_UART_TX USBTX
4751
#define STDIO_UART_RX USBRX
4852
#define STDIO_UART UART_0

targets/TARGET_TI/TARGET_CC32XX/TARGET_CC3220SF/TARGET_CC3220SF_LAUNCHXL/PeripheralPins.c

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,20 @@ const PinMap PinMap_GPIO[] = {
6262
};
6363

6464
/************PWM***************/
65+
#if DEVICE_PWMOUT
6566
const PinMap PinMap_PWM[] = {
6667
{PIN_01, PWM_1, 3},
6768
{PIN_02, PWM_2, 3},
6869
{PIN_17, PWM_3, 5},
6970
{PIN_19, PWM_4, 8},
7071
{PIN_21, PWM_5, 9},
7172
{PIN_64, PWM_6, 3},
73+
{NC, NC, 0}
7274
};
75+
#endif
7376

7477
/************UART***************/
78+
#if DEVICE_SERIAL
7579
const PinMap PinMap_UART_TX[] = {
7680
{PIN_01, UART_1, 7},
7781
{PIN_03, UART_0, 7},
@@ -97,7 +101,7 @@ const PinMap PinMap_UART_RX[] = {
97101
{PIN_59, UART_1, 6},
98102
{NC, NC, 0}
99103
};
100-
104+
#if DEVICE_SERIAL_FC
101105
const PinMap PinMap_UART_RTS[] = {
102106
{PIN_50, UART_0, 3},
103107
{PIN_50, UART_1, 10},
@@ -114,3 +118,42 @@ const PinMap PinMap_UART_CTS[] = {
114118
{PIN_61, UART_1, 3},
115119
{NC, NC, 0}
116120
};
121+
#endif
122+
#endif
123+
124+
#if DEVICE_ANALOGIN
125+
const PinMap PinMap_ADC[] = {
126+
{PIN_57, ADC0_0, 0},
127+
{PIN_58, ADC0_1, 0},
128+
{PIN_59, ADC0_2, 0},
129+
{PIN_60, ADC0_3, 0},
130+
{NC, NC, 0}
131+
};
132+
#endif
133+
134+
#if DEVICE_SPI
135+
/************SPI***************/
136+
const PinMap PinMap_SPI_SCLK[] = {
137+
{PIN_05, GSPI, 7},
138+
{PIN_45, GSPI, 7},
139+
{NC, NC, 0}
140+
};
141+
142+
const PinMap PinMap_SPI_MOSI[] = {
143+
{PIN_07, GSPI, 7},
144+
{PIN_52, GSPI, 7},
145+
{NC, NC, 0}
146+
};
147+
148+
const PinMap PinMap_SPI_MISO[] = {
149+
{PIN_06, GSPI, 7},
150+
{PIN_53, GSPI, 7},
151+
{NC, NC, 0}
152+
};
153+
154+
const PinMap PinMap_SPI_SSEL[] = {
155+
{PIN_08, GSPI, 7},
156+
{PIN_50, GSPI, 7},
157+
{NC, NC, 0}
158+
};
159+
#endif

targets/TARGET_TI/TARGET_CC32XX/TARGET_CC3220SF/analogin_api.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,7 @@ float analogin_read(analogin_t *obj) {
5555
return (float)value * (1.0f / (float)ADC_RESOLUTION);
5656
}
5757

58+
const PinMap *analogin_pinmap()
59+
{
60+
return PinMap_ADC;
61+
}

targets/TARGET_TI/TARGET_CC32XX/TARGET_CC3220SF/pwmout_api.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,3 +179,8 @@ void pwmout_pulsewidth_ms(pwmout_t* obj, int ms) {
179179
void pwmout_pulsewidth_us(pwmout_t* obj, int us) {
180180

181181
}
182+
183+
const PinMap *pwmout_pinmap()
184+
{
185+
return PinMap_PWM;
186+
}

targets/TARGET_TI/TARGET_CC32XX/TARGET_CC3220SF/serial_api.c

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,3 +403,35 @@ void serial_set_flow_control(serial_t *obj, FlowControl type, PinName rxflow, Pi
403403
break;
404404
}
405405
}
406+
407+
const PinMap *serial_tx_pinmap()
408+
{
409+
return PinMap_UART_TX;
410+
}
411+
412+
const PinMap *serial_rx_pinmap()
413+
{
414+
return PinMap_UART_RX;
415+
}
416+
417+
const PinMap *serial_cts_pinmap()
418+
{
419+
#if !DEVICE_SERIAL_FC
420+
static const PinMap PinMap_UART_CTS[] = {
421+
{NC, NC, 0}
422+
};
423+
#endif
424+
425+
return PinMap_UART_CTS;
426+
}
427+
428+
const PinMap *serial_rts_pinmap()
429+
{
430+
#if !DEVICE_SERIAL_FC
431+
static const PinMap PinMap_UART_RTS[] = {
432+
{NC, NC, 0}
433+
};
434+
#endif
435+
436+
return PinMap_UART_RTS;
437+
}

targets/TARGET_TI/TARGET_CC32XX/TARGET_CC3220SF/spi_api.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include "ti/devices/cc32xx/driverlib/rom_map.h"
2626
#include "ti/devices/cc32xx/driverlib/ti_spi_driverlib.h"
2727
#include "ti/devices/cc32xx/driverlib/prcm.h"
28+
#include "PeripheralPins.h"
2829

2930
#define PIN_MODE_SPI 7
3031
#define SPI_WL_MASK 0xF80
@@ -56,6 +57,26 @@ static void spi_configure_driver_instance(spi_t *obj)
5657
}
5758
}
5859

60+
const PinMap *spi_master_mosi_pinmap()
61+
{
62+
return PinMap_SPI_MOSI;
63+
}
64+
65+
const PinMap *spi_master_miso_pinmap()
66+
{
67+
return PinMap_SPI_MISO;
68+
}
69+
70+
const PinMap *spi_master_clk_pinmap()
71+
{
72+
return PinMap_SPI_SCLK;
73+
}
74+
75+
const PinMap *spi_master_cs_pinmap()
76+
{
77+
return PinMap_SPI_SSEL;
78+
}
79+
5980
/** Initialize the SPI peripheral
6081
*
6182
* Configures the pins used by SPI, sets a default format and frequency, and enables the peripheral

targets/targets.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8782,17 +8782,18 @@
87828782
"CC32XX": {
87838783
"inherits": ["TI"],
87848784
"public": false,
8785-
"supported_toolchains": ["GCC_ARM", "ARM", "IAR"],
87868785
"release_versions": ["5"]
87878786
},
87888787
"CC3220SF": {
87898788
"inherits": ["CC32XX"],
8789+
"public": false,
87908790
"macros": ["MBED_MPU_CUSTOM"],
87918791
"core": "Cortex-M4",
87928792
"device_name": "CC3220SF"
87938793
},
87948794
"CC3220SF_LAUNCHXL": {
87958795
"inherits": ["CC3220SF"],
8796+
"supported_toolchains": ["GCC_ARM", "ARM", "IAR"],
87968797
"components_add": ["SD", "FLASHIAP"],
87978798
"device_has": ["USTICKER",
87988799
"SERIAL",

0 commit comments

Comments
 (0)