Skip to content

Commit 8c71583

Browse files
author
Jenny Plunkett
authored
Merge pull request ARMmbed#2 from yennster/cc3220sf
[CC3220SF] Fixed the GPIO bug
2 parents 481a93b + 00cba2c commit 8c71583

File tree

7 files changed

+28
-117
lines changed

7 files changed

+28
-117
lines changed

targets/TARGET_TI/TARGET_CC32XX/TARGET_CC3220SF/device.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,6 @@
2020
#ifndef MBED_DEVICE_H
2121
#define MBED_DEVICE_H
2222

23+
#include "objects.h"
2324

2425
#endif

targets/TARGET_TI/TARGET_CC32XX/TARGET_CC3220SF/device/CC3220SF.h

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -175,16 +175,10 @@ typedef struct
175175
*/
176176

177177
/* Peripheral and SRAM base address */
178-
// The following defines are just examples
179-
#define CC3220SF_FLASH_BASE (0x00000000UL) /*!< (FLASH ) Base Address */
180-
#define CC3220SF_SRAM_BASE (0x20000000UL) /*!< (SRAM ) Base Address */
181-
#define CC3220SF_PERIPH_BASE (0x40000000UL) /*!< (Peripheral) Base Address */
178+
// TODO
182179

183180
/* Peripheral memory map */
184-
// The following defines are just examples
185-
#define CC3220SFTIM0_BASE (CC3220SF_PERIPH_BASE) /*!< (Timer0 ) Base Address */
186-
#define CC3220SFTIM1_BASE (CC3220SF_PERIPH_BASE + 0x0800) /*!< (Timer1 ) Base Address */
187-
#define CC3220SFTIM2_BASE (CC3220SF_PERIPH_BASE + 0x1000) /*!< (Timer2 ) Base Address */
181+
// TODO
188182

189183
/** @} */ /* End of group Device_Peripheral_peripheralAddr */
190184

@@ -200,10 +194,7 @@ typedef struct
200194
* @{
201195
*/
202196

203-
// The following defines are just examples
204-
#define CC3220SF_TIM0 ((CC3220SF_TMR_TypeDef *) CC3220SFTIM0_BASE)
205-
#define CC3220SF_TIM1 ((CC3220SF_TMR_TypeDef *) CC3220SFTIM0_BASE)
206-
#define CC3220SF_TIM2 ((CC3220SF_TMR_TypeDef *) CC3220SFTIM0_BASE)
197+
// TODO
207198

208199

209200
#ifdef __cplusplus

targets/TARGET_TI/TARGET_CC32XX/TARGET_CC3220SF/gpio_api.c

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,36 +22,29 @@ uint32_t gpio_set(PinName pin)
2222
return (1);
2323
}
2424

25-
//function to initialise the gpio pin
25+
// function to initialise the gpio pin
2626
// this links the board control bits for each pin
2727
// with the object created for the pin
2828
void gpio_init(gpio_t *obj, PinName pin)
2929
{
30-
if (pin == NC) {
31-
return;
32-
} else {
33-
int pin_value = 0;
34-
obj->pin = pin;
35-
36-
// TODO
37-
}
30+
// TODO
31+
return;
3832
}
3933

4034
void gpio_mode(gpio_t *obj, PinMode mode)
4135
{
42-
pin_mode(obj->pin, mode);
36+
// TODO
37+
return;
4338
}
4439

4540
void gpio_dir(gpio_t *obj, PinDirection direction)
4641
{
4742
// TODO
43+
return;
4844
}
4945

5046
int gpio_is_connected(const gpio_t *obj)
5147
{
52-
if (obj->pin != (PinName)NC) {
53-
return 1;
54-
} else {
55-
return 0;
56-
}
48+
// TODO
49+
return 0;
5750
}

targets/TARGET_TI/TARGET_CC32XX/TARGET_CC3220SF/gpio_object.h

Lines changed: 0 additions & 62 deletions
This file was deleted.

targets/TARGET_TI/TARGET_CC32XX/TARGET_CC3220SF/objects.h

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* mbed Microcontroller Library
2-
* Copyright (c) 2006-2018 ARM Limited
2+
* Copyright (c) 2006-2013 ARM Limited
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -25,18 +25,11 @@
2525
extern "C" {
2626
#endif
2727

28-
// TODO
29-
30-
struct port_s {
31-
__IO uint32_t *reg_dir;
32-
__IO uint32_t *reg_dirclr;
33-
__IO uint32_t *reg_out;
34-
__IO uint32_t *reg_in;
35-
PortName port;
36-
uint32_t mask;
37-
};
38-
39-
#include "gpio_object.h"
28+
typedef struct {
29+
PinName pin;
30+
PinMode mode;
31+
PinDirection dir;
32+
} gpio_t;
4033

4134
#ifdef __cplusplus
4235
}

targets/TARGET_TI/mbed_rtx.h

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,12 @@
1919

2020
#include <stdint.h>
2121

22-
/**
23-
#if defined(TARGET_CC32XX)
24-
25-
#ifndef INITIAL_SP
26-
#define INITIAL_SP (0x80000000UL)
27-
#endif
28-
**/
29-
3022
#if defined(TARGET_CC3220SF)
3123

3224
#ifndef INITIAL_SP
3325
#define INITIAL_SP (0x80000000UL)
3426
#endif
3527

36-
#endif /* defined(TARGET_CC32XX) */
28+
#endif /* defined(TARGET_CC3220SF) */
3729

3830
#endif /* MBED_MBED_RTX_H */

targets/targets.json

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4216,17 +4216,20 @@
42164216
"core": "Cortex-M7",
42174217
"macros": ["CMSDK_CM7"]
42184218
},
4219-
"CC32XX": {
4219+
"TI": {
42204220
"inherits": ["Target"],
4221-
"extra_labels": ["TI", "CC32XX"],
4222-
"default_toolchain": "GCC_ARM",
4223-
"core": "Cortex-M4",
4224-
"supported_toolchains": ["ARM", "GCC_ARM", "IAR"],
4221+
"public": false,
4222+
"extra_labels": ["TI"]
4223+
},
4224+
"CC32XX": {
4225+
"inherits": ["TI"],
4226+
"public": false,
4227+
"supported_toolchains": ["GCC_ARM", "ARM", "IAR"],
42254228
"device_has": [],
42264229
"release_versions": ["5"]
42274230
},
42284231
"CC3220SF": {
42294232
"inherits": ["CC32XX"],
4230-
"macros_add": []
4233+
"core": "Cortex-M4"
42314234
}
42324235
}

0 commit comments

Comments
 (0)