-
Notifications
You must be signed in to change notification settings - Fork 3k
Description
Note: This is just a template, so feel free to use/remove the unnecessary things
Description
- Type: Bug / Enhancement
- Related issue:
#5918
- Priority: Minor
Bug
Target
NXP|LPC4088
Toolchain:
GCC_ARM
Toolchain version:
gcc version 6.3.1 20170620 (release) [ARM/embedded-6-branch revision 249437] (GNU Tools for ARM Embedded Processors 6-2017-q2-update)
mbed-cli version:
1.2.2
mbed-os sha:
97e2d4a (HEAD -> master) Merge pull request #5025 from grygorek/master
DAPLink version:
Expected behavior
When using Pins of the Type I IOCON register (P0[27], P0[28], P5[2], P5[3]) as normal GPIO pins (not for specialized I2C functions), as well as for SSP2, they should behave as normal GPIO pins as described in chapter 7.3.8 of UM10562 (https://www.nxp.com/docs/en/user-guide/UM10562.pdf). This means the HS bit ([8:8]) should be set to 1 when configuring the pin, somewhere in pinmap_pinout, pin_function or pin_mode
Actual behavior
SSP2 with P5[2] and P5[3] is currently not usable without special code setting the HS bit, e.g.
for( auto&& pin : {sclk, ssel})
{
auto reg = (__IO uint32_t*) (LPC_IOCON_BASE + 4 * pin);
// Type I IOCON register pin HS bits: [8:8] -> b1'0000'0000 = (0x100)
*reg = (*reg & ~0x100) | (1 << 8); // set HS bit to 1
}
Comments
Since I cannot estimate the impact of any hacky changes to eg. pin_mode, I cannot offer a ready-made pull-request here. The thing is that the solution depends both on the function (!I2C) and the type of the IOCON Base of the pin, and requires some extended logic.