From 5e3c3a322efa12bb4d398e0ec4adcf07fcad446f Mon Sep 17 00:00:00 2001 From: cnlohr <lohr85@gmail.com> Date: Mon, 29 Jan 2024 12:18:27 -0800 Subject: [PATCH] Implement some of #268 - Previously fixed mode. --- ch32v003fun/ch32v003fun.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ch32v003fun/ch32v003fun.h b/ch32v003fun/ch32v003fun.h index 9ff051d..86c511e 100644 --- a/ch32v003fun/ch32v003fun.h +++ b/ch32v003fun/ch32v003fun.h @@ -5184,6 +5184,9 @@ extern "C" { #define funDigitalWrite( pin, value ) { GpioOf( pin )->BSHR = 1<<((!(value))*16 + ((pin) & 0xf)); } #define funPinMode( pin, mode ) { GpioOf(pin)->CFGLR = (GpioOf(pin)->CFGLR & (~(0xf<<(4*((pin)&0xf))))) | ((mode)<<(4*((pin)&0xf))); } #define funGpioInitAll() { RCC->APB2PCENR |= ( RCC_APB2Periph_AFIO | RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOC | RCC_APB2Periph_GPIOD ); } +#define funGpioInitA() { RCC->APB2PCENR |= ( RCC_APB2Periph_AFIO | RCC_APB2Periph_GPIOA ); } +#define funGpioInitC() { RCC->APB2PCENR |= ( RCC_APB2Periph_AFIO | RCC_APB2Periph_GPIOC ); } +#define funGpioInitD() { RCC->APB2PCENR |= ( RCC_APB2Periph_AFIO | RCC_APB2Periph_GPIOD ); } #define funDigitalRead( pin ) ((GpioOf(pin)->INDR >> ((pin)&0xf)) & 1) -- GitLab