Skip to content

Commit

Permalink
Merge pull request #34 from ytsuboi/master
Browse files Browse the repository at this point in the history
Added LPC1114 and target for some test cases, Removed SWCLK and SWDIO pins from pinmap
  • Loading branch information
emilmont committed Aug 16, 2013
2 parents 73b1687 + 478f049 commit 089441f
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 23 deletions.
10 changes: 0 additions & 10 deletions libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX/PinNames.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,11 @@ typedef enum {
P0_7 = (0 << PORT_SHIFT) | (7 << PIN_SHIFT) | 0x50,
P0_8 = (0 << PORT_SHIFT) | (8 << PIN_SHIFT) | 0x60,
P0_9 = (0 << PORT_SHIFT) | (9 << PIN_SHIFT) | 0x64,
P0_10 = (0 << PORT_SHIFT) | (10 << PIN_SHIFT) | 0x68,
P0_11 = (0 << PORT_SHIFT) | (11 << PIN_SHIFT) | 0x74,

P1_0 = (1 << PORT_SHIFT) | (0 << PIN_SHIFT) | 0x78,
P1_1 = (1 << PORT_SHIFT) | (1 << PIN_SHIFT) | 0x7c,
P1_2 = (1 << PORT_SHIFT) | (2 << PIN_SHIFT) | 0x80,
P1_3 = (1 << PORT_SHIFT) | (3 << PIN_SHIFT) | 0x90,
P1_4 = (1 << PORT_SHIFT) | (4 << PIN_SHIFT) | 0x94,
P1_5 = (1 << PORT_SHIFT) | (5 << PIN_SHIFT) | 0xa0,
P1_6 = (1 << PORT_SHIFT) | (6 << PIN_SHIFT) | 0xa4,
Expand Down Expand Up @@ -95,9 +93,7 @@ typedef enum {
p16 = P1_0,
p17 = P1_1,
p18 = P1_2,
p19 = P1_3,
p20 = P1_4,
p21 = P0_10,
p22 = P0_2,
p23 = P0_11,
p24 = P0_2,
Expand Down Expand Up @@ -133,12 +129,10 @@ typedef enum {
xp16 = P1_0,
xp17 = P1_1,
xp18 = P1_2,
xp19 = P1_3,
xp20 = P1_4,
xp21 = P1_5,
xp22 = P1_8,
xp23 = P0_6,
xp24 = P0_10,
xp25 = P3_0,
xp26 = P3_1,
xp27 = P3_2,
Expand Down Expand Up @@ -167,14 +161,12 @@ typedef enum {

dp1 = P0_8,
dp2 = P0_9,
dp3 = P0_10,
dp4 = P0_11,
dp5 = P0_5,
dp6 = P0_6,
dp9 = P1_0,
dp10 = P1_1,
dp11 = P1_2,
dp12 = P1_3,
dp13 = P1_4,
dp14 = P1_5,
dp15 = P1_6,
Expand All @@ -190,14 +182,12 @@ typedef enum {

dip1 = P0_8,
dip2 = P0_9,
dip3 = P0_10,
dip4 = P0_11,
dip5 = P0_5,
dip6 = P0_6,
dip9 = P1_0,
dip10 = P1_1,
dip11 = P1_2,
dip12 = P1_3,
dip13 = P1_4,
dip14 = P1_5,
dip15 = P1_6,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ static const PinMap PinMap_ADC[] = {
{P1_0 , ADC0_1, 2},
{P1_1 , ADC0_2, 2},
{P1_2 , ADC0_3, 2},
{P1_3 , ADC0_4, 2},
{P1_4 , ADC0_5, 1},
{P1_10, ADC0_6, 1},
{P1_11, ADC0_7, 1},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@
uint32_t gpio_set(PinName pin) {
// PIO default value of following ports are not same as others
int f = ((pin == P0_0 ) || // RESET
(pin == P0_10) || // SWCLK
(pin == P0_11) || // R
(pin == P1_0 ) || // R
(pin == P1_1 ) || // R
(pin == P1_2 ) || // R
(pin == P1_3 )) ? //
(pin == P1_2 )) ? // R
(1) : (0);

pin_function(pin, f);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ static const PinMap PinMap_PWM[] = {
/* CT16B0 */
{P0_8 , PWM_1, 0x02}, /* MR0 */
{P0_9 , PWM_2, 0x02}, /* MR1 */
{P0_10, PWM_3, 0x03}, /* MR2 */

/* CT16B1 */
{P1_9 , PWM_4, 0x01}, /* MR0 */
Expand All @@ -44,7 +43,6 @@ static const PinMap PinMap_PWM[] = {
/* CT32B1 */
{P1_1 , PWM_9 ,0x03}, /* MR0 */
{P1_2 , PWM_10,0x03}, /* MR1 */
{P1_3 , PWM_11,0x03}, /* MR2 */

{NC , NC ,0x00}
};
Expand All @@ -54,10 +52,9 @@ typedef struct {
uint8_t mr;
} timer_mr;

static timer_mr pwm_timer_map[11] = {
static timer_mr pwm_timer_map[9] = {
{0, 0}, /* CT16B0, MR0 */
{0, 1}, /* CT16B0, MR1 */
{0, 2}, /* CT16B0, MR2 */

{1, 0}, /* CT16B1, MR0 */
{1, 1}, /* CT16B1, MR1 */
Expand All @@ -68,7 +65,6 @@ static timer_mr pwm_timer_map[11] = {

{3, 0}, /* CT32B1, MR0 */
{3, 1}, /* CT32B1, MR1 */
{3, 2} /* CT32B1, MR2 */
};

static LPC_TMR_TypeDef *Timers[4] = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

static const PinMap PinMap_SPI_SCLK[] = {
{P0_6 , SPI_0, 0x02},
{P0_10, SPI_0, 0x02},
{P2_11, SPI_0, 0x01},
{P2_1 , SPI_1, 0x02},
{NC , NC , 0}
Expand Down
6 changes: 5 additions & 1 deletion libraries/rpc/parse_pins.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,18 @@ PinName parse_pins(const char *str) {
static const PinName pin_names[] = {p5, p6, p7, p8, p9, p10, p11, p12, p13, p14
, p15, p16, p17, p18, p19, p20, p21, p22, p23
, p24, p25, p26, p27, p28, p29, p30};
#elif defined(TARGET_LPC1114)
static const PinName pin_names[] = {dp1, dp2, dp4, dp5, dp6, dp9, dp10, dp11
, dp13, dp14, dp15, dp16, dp17, dp18, dp23
, dp24, dp25, dp26, dp27, dp28};
#elif defined(TARGET_LPC4088)
static const PinName pin_names[] = {p5, p6, p7, p8, p9, p10, p11, p12, p13, p14
, p15, p16, p17, p18, p19, p20, NC, NC, p23
, p24, p25, p26, p27, p28, p29, p30, p31, p32
, p33, p34, NC, NC, p37, p38, p39};
#endif

#if defined(TARGET_LPC1768) || defined(TARGET_LPC11U24) || defined(TARGET_LPC2368) || defined(TARGET_LPC812) || defined(TARGET_LPC4088)
#if defined(TARGET_LPC1768) || defined(TARGET_LPC11U24) || defined(TARGET_LPC2368) || defined(TARGET_LPC812) || defined(TARGET_LPC4088)|| defined(TARGET_LPC1114)
if (str[0] == 'P') { // Pn_n
uint32_t port = str[1] - '0';
uint32_t pin = str[3] - '0'; // Pn_n
Expand Down
2 changes: 2 additions & 0 deletions libraries/tests/mbed/heap_and_stack/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ void report_iterations(void) {
printf("%.2f\n", ((float)(tot)/(float)(initial_stack_p - initial_heap_p))*100.);
#endif
#ifdef TOOLCHAIN_ARM
#ifndef __MICROLIB
__heapvalid((__heapprt) fprintf, stdout, 1);
#endif
#endif
}

void stack_test(char *latest_heap_pointer) {
Expand Down
4 changes: 2 additions & 2 deletions libraries/tests/mbed/interrupt_chaining/ticker/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#if defined(TARGET_LPC1768) || defined(TARGET_LPC4088)
#define TIMER_IRQ TIMER3_IRQn
#elif defined(TARGET_LPC11U24)
#elif defined(TARGET_LPC11U24) || defined(TARGET_LPC1114)
#define TIMER_IRQ TIMER_32_1_IRQn
#elif defined(TARGET_KL25Z)
#define TIMER_IRQ LPTimer_IRQn
Expand Down Expand Up @@ -40,7 +40,7 @@ Ticker flipper_2;
Sender s1(pc, '1');
Sender s2(pc, '2');

#if defined(TARGET_LPC1768) || defined(TARGET_LPC11U24) || defined(TARGET_LPC4088) || defined(TARGET_LPC2368)
#if defined(TARGET_LPC1768) || defined(TARGET_LPC11U24) || defined(TARGET_LPC4088) || defined(TARGET_LPC2368) || defined(TARGET_LPC1114)
# define LED_NAME LED2
#elif defined(TARGET_KL05Z)
# define LED_NAME LED2
Expand Down

0 comments on commit 089441f

Please sign in to comment.