Skip to content

Commit 1142df8

Browse files
committed
Merge pull request #22 from matthewelse/anotherpullrequest
PWM Patch Pull Request
2 parents 262bd86 + e1eb357 commit 1142df8

File tree

4 files changed

+35
-11
lines changed

4 files changed

+35
-11
lines changed

libraries/mbed/targets/cmsis/TARGET_NXP/TARGET_LPC11XX/LPC11xx.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ typedef struct
345345
__IO uint32_t PC; /*!< Offset: 0x010 Prescale Counter Register (R/W) */
346346
__IO uint32_t MCR; /*!< Offset: 0x014 Match Control Register (R/W) */
347347
union {
348-
__IO uint32_t MR[4]; /*!< (@ 0x40014018) Match Register */
348+
__IO uint32_t MR[4]; /*!< Offset: Match Register base */
349349
struct{
350350
__IO uint32_t MR0; /*!< Offset: 0x018 Match Register 0 (R/W) */
351351
__IO uint32_t MR1; /*!< Offset: 0x01C Match Register 1 (R/W) */

libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11CXX/objects.h

+4
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ struct spi_s {
5959
LPC_SSP_TypeDef *spi;
6060
};
6161

62+
struct can_s {
63+
int index;
64+
};
65+
6266
#include "gpio_object.h"
6367

6468
#ifdef __cplusplus

libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11CXX/pwmout_api.c

+15-5
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,21 @@ typedef struct {
5454
uint8_t mr;
5555
} timer_mr;
5656

57-
static timer_mr pwm_timer_map[4] = {
58-
{0, 0},
59-
{1, 0},
60-
{2, 0},
61-
{3, 0},
57+
static timer_mr pwm_timer_map[11] = {
58+
{0, 0}, /* CT16B0, MR0 */
59+
{0, 1}, /* CT16B0, MR1 */
60+
{0, 2}, /* CT16B0, MR2 */
61+
62+
{1, 0}, /* CT16B1, MR0 */
63+
{1, 1}, /* CT16B1, MR1 */
64+
65+
{2, 0}, /* CT32B0, MR0 */
66+
{2, 1}, /* CT32B0, MR1 */
67+
{2, 2}, /* CT32B0, MR2 */
68+
69+
{3, 0}, /* CT32B1, MR0 */
70+
{3, 1}, /* CT32B1, MR1 */
71+
{3, 2} /* CT32B1, MR2 */
6272
};
6373

6474
static LPC_TMR_TypeDef *Timers[4] = {

libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX/pwmout_api.c

+15-5
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,21 @@ typedef struct {
5454
uint8_t mr;
5555
} timer_mr;
5656

57-
static timer_mr pwm_timer_map[4] = {
58-
{0, 0},
59-
{1, 0},
60-
{2, 0},
61-
{3, 0},
57+
static timer_mr pwm_timer_map[11] = {
58+
{0, 0}, /* CT16B0, MR0 */
59+
{0, 1}, /* CT16B0, MR1 */
60+
{0, 2}, /* CT16B0, MR2 */
61+
62+
{1, 0}, /* CT16B1, MR0 */
63+
{1, 1}, /* CT16B1, MR1 */
64+
65+
{2, 0}, /* CT32B0, MR0 */
66+
{2, 1}, /* CT32B0, MR1 */
67+
{2, 2}, /* CT32B0, MR2 */
68+
69+
{3, 0}, /* CT32B1, MR0 */
70+
{3, 1}, /* CT32B1, MR1 */
71+
{3, 2} /* CT32B1, MR2 */
6272
};
6373

6474
static LPC_TMR_TypeDef *Timers[4] = {

0 commit comments

Comments
 (0)