Added WB32 GPIO current configuration

This commit is contained in:
Joy 2021-11-30 13:50:33 +08:00 committed by Fabio Utzig
parent 9741167391
commit 43886c36f5
2 changed files with 9 additions and 0 deletions

View File

@ -101,6 +101,10 @@ void _pal_lld_setgroupmode(ioportid_t port, ioportmask_t mask, iomode_t mode) {
port->OSPEEDR = (ospeedr & 0x3) * 0x55555555U;
port->PUPDR = (pupdr & 0x3) * 0x55555555U;
#ifdef WB32_GPIO_CURRENT
port->CURRENT = (WB32_GPIO_CURRENT & 0x03) * 0x55555555U;
#endif
tmp = altr * 0x11111111U;
port->AFRL = tmp;
port->AFRH = tmp;

View File

@ -44,6 +44,11 @@
#undef PAL_MODE_OUTPUT_PUSHPULL
#undef PAL_MODE_OUTPUT_OPENDRAIN
/* GPIO drive current, Value range 0-3 */
#ifndef WB32_GPIO_CURRENT
#define WB32_GPIO_CURRENT 0x03
#endif
/**
* @name WB32-specific I/O mode flags
* @{