libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
SYSCON peripheral API

SWM050 SYSCON API. More...

Collaboration diagram for SYSCON peripheral API:

Functions

void syscon_sel_af (uint16_t gpios, bool af_en)
 Select the alternative function of a Group of Pins. More...
 
void syscon_pullup (uint16_t gpios, bool en)
 Enable the internal pull-up of a Group of Pins. More...
 
void syscon_input_enable (uint16_t gpios, bool en)
 Enable the input function of a Group of Pins. More...
 
void syscon_sel_swd (bool en)
 Select the SWD function of GPIO 1/2. More...
 

Detailed Description

SWM050 SYSCON API.

LGPL License Terms libopencm3 License

Author
© 2019 Icenowy Zheng iceno.nosp@m.wy@a.nosp@m.osc.i.nosp@m.o
© 2019 Caleb Szalacinski conta.nosp@m.ct@s.nosp@m.kiboy.nosp@m..net

Function Documentation

◆ syscon_input_enable()

void syscon_input_enable ( uint16_t  gpios,
bool  en 
)

Enable the input function of a Group of Pins.

Enable or disable the input function of one or more pins of GPIO. Disabling the input function of pins decreases the power usage of the MCU.

Parameters
[in]gpiosPin identifiers GPIO Pin Identifiers If multiple pins are to be changed, use bitwise OR '|' to separate them.
[in]enTrue to enable input function.

Definition at line 95 of file syscon.c.

References SYSCON_PORTA_INEN.

◆ syscon_pullup()

void syscon_pullup ( uint16_t  gpios,
bool  en 
)

Enable the internal pull-up of a Group of Pins.

Enable or disable the internal pull-up of one or more pins of GPIO.

Parameters
[in]gpiosPin identifiers GPIO Pin Identifiers If multiple pins are to be changed, use bitwise OR '|' to separate them.
[in]enTrue to enable pull-up, false to disable.

Definition at line 75 of file syscon.c.

References SYSCON_PORTA_PULLUP.

◆ syscon_sel_af()

void syscon_sel_af ( uint16_t  gpios,
bool  af_en 
)

Select the alternative function of a Group of Pins.

Select the alternative function of one or more pins of GPIO.

Parameters
[in]gpiosPin identifiers GPIO Pin Identifiers If multiple pins are to be changed, use bitwise OR '|' to separate them.
[in]af_enWhether alternative function is selected

Definition at line 43 of file syscon.c.

References GPIO0, GPIO1, GPIO2, GPIO7, and SYSCON_PORTA_SEL.

◆ syscon_sel_swd()

void syscon_sel_swd ( bool  en)

Select the SWD function of GPIO 1/2.

Enable or disable the SWD debugging port at GPIO 1/2. When SWD debugging port is enabled, GPIO and AF of the SWD pins will be both unavailable.

Parameters
[in]enTrue to enable SWD.

Definition at line 112 of file syscon.c.

References SYSCON_SWD_SEL.