ARM Microcontroller Projects

Page 24

ARM Microcontroller Projects: Beginner to Intermediate

_GPIO_PINMASK_0 pin

0 mask

_GPIO_PINMASK_1 pin

1 mask

…………………………………………….............…... _GPIO_PINMASK_15 pin

15 mask

_GPIO_PINMASK_LOW

low 8 port pins

_GPIO_PINMASK_HIGH

high 8 port pins

_GPIO_PINMASK_ALL

all pins masked

config can take different values depending upon the port usage. The following values are valid: Basic

_GPIO_CFG_PULL_UP

configure pins as pull-up

_GPIO_CFG_PULL_DOWN

configure pins as pull-down

_GPIO_CFG_PULL_NO

configure pins as floating (no pull-up/down)

_GPIO_CFG_MODE_ALT_FUNCTION

pins have alternate functions (non GPIO)

_GPIO_CFG_MODE_ANALOG

configure pins for analog

_GPIO_CFG_OTYPE_OD

configure pins as open-drain

_GPIO_CFG_OTYPE_PP

configure pins as push-pull

_GPIO_CFG_SPEED_400KHZ

configure pins for 400kHz clock

_GPIO_CFG_SPEED_2MHZ

configure pins for 2MHz clock

_GPIO_CFG_SPEED_10MHZ

configure pins for 10MHz clock

_GPIO_CFG_SPEED_25MHZ

configure pins for 25MHz clock

_GPIO_CFG_SPEED_40MHZ

configure pins for 40MHz clock

_GPIO_CFG_SPEED_50MHZ

configure pins for 50MHZ clock

_GPIO_CFG_SPEED_100MHZ

configure pins for 100MHZ clock

_GPIO_CFG_SPEED_MAX

configure pins for maximum clock

_GPIO_CFG_DIGITAL_OUTPUT

configure pins as digital output

_GPIO_CFG_DIGITAL_INPUT

configure pins as digital input

_GPIO_CFG_ANALOG_INPUT

configure pins as analog input

Timer These are timer functions and the function name changes depending upon the timer used. For example, for Timer 1 the following functions are available (similar functions are available for other timers, see the HELP file for more details):

_GPIO_CFG_AF_TIM1

Timer 1 alternate function mapping

_GPIO_CFG_AF2_TIM2

Timer 1 alternate function 2 mapping

_GPIO_CFG_AF6_TIM1

Timer 1 alternate function 6 mapping

_GPIO_CFG_AF11_TIM1

Timer 1 alternate function 11 mapping

● 66


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.