Skip to content

Commit

Permalink
Use open drain reset for all lpc11u35 interfaces
Browse files Browse the repository at this point in the history
Remove the configuration option CONF_OPENDRAIN from DAP_config.h.
All boards using the lpc11u35 now use open drain on the reset line.
  • Loading branch information
c1728p9 committed Feb 24, 2016
1 parent 2f19cc1 commit fc33466
Showing 1 changed file with 1 addition and 27 deletions.
28 changes: 1 addition & 27 deletions source/hif_hal/nxp/lpc11u35/DAP_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@ Provides definitions about:

// Board configuration options

// Configure nReset as open drain
#if defined(BOARD_UBLOX_C027)
#define CONF_OPENDRAIN
#endif

// Configure JTAG option
#if defined(BOARD_BAMBINO_210) || defined(BOARD_BAMBINO_210E)
// LPC43xx multicore targets require JTAG to debug slave cores
Expand Down Expand Up @@ -204,15 +199,10 @@ Configures the DAP Hardware I/O pins for Serial Wire Debug (SWD) mode:
static __inline void PORT_SWD_SETUP (void) {
LPC_GPIO->SET[0] = PIN_SWCLK;
LPC_GPIO->SET[0] = PIN_SWDIO;
#if defined(CONF_OPENDRAIN)
// open drain logic
LPC_GPIO->DIR[0] &= ~PIN_nRESET;
LPC_GPIO->CLR[0] = PIN_nRESET;
LPC_GPIO->DIR[0] |= (PIN_SWCLK | PIN_SWDIO);
#else
LPC_GPIO->SET[0] = PIN_nRESET;
LPC_GPIO->DIR[0] |= (PIN_SWCLK | PIN_SWDIO | PIN_nRESET);
#endif
}

/** Disable JTAG/SWD I/O Pins.
Expand All @@ -222,15 +212,10 @@ Disables the DAP Hardware I/O pins which configures:
static __inline void PORT_OFF (void) {
LPC_GPIO->CLR[0] = PIN_SWCLK;
LPC_GPIO->CLR[0] = PIN_SWDIO;
#if defined(CONF_OPENDRAIN)
// open drain logic
LPC_GPIO->DIR[0] &= ~PIN_nRESET; // reset not an output
LPC_GPIO->CLR[0] = PIN_nRESET;
LPC_GPIO->DIR[0] |= (PIN_SWCLK | PIN_SWDIO);
#else
LPC_GPIO->SET[0] = PIN_nRESET;
LPC_GPIO->DIR[0] |= (PIN_SWCLK | PIN_SWDIO | PIN_nRESET);
#endif
}


Expand Down Expand Up @@ -390,16 +375,9 @@ static __forceinline uint32_t PIN_nRESET_IN (void) {
- 1: release device hardware reset.
*/
static __forceinline void PIN_nRESET_OUT (uint32_t bit) {
#if defined(CONF_OPENDRAIN)
// open drain logic
if (bit) LPC_GPIO->DIR[0] &= ~PIN_nRESET; // input (pulled high external)
else LPC_GPIO->DIR[0] |= PIN_nRESET; // output (low)
#else
if (bit)
LPC_GPIO->SET[0] = (PIN_nRESET);
else
LPC_GPIO->CLR[0] = (PIN_nRESET);
#endif
}

///@}
Expand Down Expand Up @@ -459,11 +437,7 @@ static __inline void DAP_SETUP (void) {
// Configure I/O pins
PIN_SWCLK_TCK_IOCON = FUNC_0 | PULL_UP_ENABLED; // SWCLK/TCK
PIN_SWDIO_TMS_IOCON = FUNC_0 | PULL_UP_ENABLED; // SWDIO/TMS
#if !defined(CONF_OPENDRAIN)
PIN_nRESET_IOCON = FUNC_0 | PULL_UP_ENABLED; // nRESET
#else
PIN_nRESET_IOCON = FUNC_0 | OPENDRAIN; // nRESET
#endif
PIN_nRESET_IOCON = FUNC_0 | OPENDRAIN | PULL_UP_ENABLED; // nRESET
#if (DAP_JTAG != 0)
PIN_TDI_IOCON = FUNC_0 | PULL_UP_ENABLED; // TDI
PIN_TDO_IOCON = FUNC_0 | PULL_UP_ENABLED; // TDO
Expand Down

0 comments on commit fc33466

Please sign in to comment.