Skip to content

Commit

Permalink
Implement some of #268 - Previously fixed mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
cnlohr committed Jan 29, 2024
1 parent a85706f commit 5e3c3a3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ch32v003fun/ch32v003fun.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down

0 comments on commit 5e3c3a3

Please sign in to comment.