8000 lpc4322(scu): pinmux mode needs more than 8bits · ARMmbed/DAPLink@9f14137 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9f14137

Browse files
author
Adrian Negreanu
committed
lpc4322(scu): pinmux mode needs more than 8bits
1 parent aec0d97 commit 9f14137

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

source/hic_hal/nxp/lpc4322/lpc43xx_scu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
* - FUNC7 :Function 7
8181
* @return None
8282
**********************************************************************/
83-
void scu_pinmux(uint8_t port, uint8_t pin, uint8_t mode, uint8_t func)
83+
void scu_pinmux(uint8_t port, uint8_t pin, uint16_t mode, uint8_t func)
8484
{
8585
uint32_t *scu_base = (uint32_t *)(LPC_SCU_BASE);
8686
scu_base[(PORT_OFFSET * port + PIN_OFFSET * pin) / 4] = mode + func;

source/hic_hal/nxp/lpc4322/lpc43xx_scu.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,10 @@ extern "C"
6969
#define INBUF_DISABLE (0 << 6) // Input buffer
7070
#define FILTER_ENABLE (0 << 7) // Glitch filter (for signals below 30MHz)
7171
#define FILTER_DISABLE (1 << 7) // No glitch filter (for signals above 30MHz)
72-
#define DRIVE_8MA (1 << 8) // Drive strength of 8mA
73-
#define DRIVE_14MA (1 << 9) // Drive strength of 14mA
74-
#define DRIVE_20MA (3 << 8) // Drive strength of 20mA
72+
#define DRIVE_4MA (0 << 8) // Normal-drive: drive strength of 4mA (default)
73+
#define DRIVE_8MA (1 << 8) // Medium-drive: drive strength of 8mA
74+
#define DRIVE_14MA (2 << 8) // High-drive: drive strength of 14mA
75+
#define DRIVE_20MA (3 << 8) // Ultra high-drive: drive strength of 20mA
7576

7677

7778
/* Configuration examples for various I/O pins */
@@ -107,7 +108,7 @@ extern "C"
107108
* @{
108109
*/
109110

110-
void scu_pinmux(uint8_t port, uint8_t pin, uint8_t mode, uint8_t func);
111+
void scu_pinmux(uint8_t port, uint8_t pin, uint16_t mode, uint8_t func);
111112

112113
/**
113114
* @}

0 commit comments

Comments
 (0)
0