Wakeup Light with touch user interface, anti-aliased Font, SD card access and RTC usage on STM32F746NG-DISCO board

Dependencies:   BSP_DISCO_F746NG_patch_fixed LCD_DISCO_F746NG TS_DISCO_F746NG FATFileSystem TinyJpgDec_interwork mbed-src

Embed: (wiki syntax)

« Back to documentation index

TM_GPIO_Functions

TM_GPIO_Functions
[TM_GPIO]

TM_GPIO_Typedefs. More...

Functions

void TM_GPIO_Init (GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin, TM_GPIO_Mode_t GPIO_Mode, TM_GPIO_OType_t GPIO_OType, TM_GPIO_PuPd_t GPIO_PuPd, TM_GPIO_Speed_t GPIO_Speed)
 Initializes GPIO pins(s)
void TM_GPIO_InitAlternate (GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin, TM_GPIO_OType_t GPIO_OType, TM_GPIO_PuPd_t GPIO_PuPd, TM_GPIO_Speed_t GPIO_Speed, uint8_t Alternate)
 Initializes GPIO pins(s) as alternate function.
void TM_GPIO_DeInit (GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin)
 Deinitializes pin(s)
void TM_GPIO_SetPinAsInput (GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin)
 Sets pin(s) as input.
void TM_GPIO_SetPinAsOutput (GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin)
 Sets pin(s) as output.
void TM_GPIO_SetPinAsAnalog (GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin)
 Sets pin(s) as analog.
void TM_GPIO_SetPinAsAlternate (GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin)
 Sets pin(s) as alternate function.
void TM_GPIO_SetPullResistor (GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin, TM_GPIO_PuPd_t GPIO_PuPd)
 Sets pull resistor settings to GPIO pin(s)
uint16_t TM_GPIO_GetPortSource (GPIO_TypeDef *GPIOx)
 Gets port source from desired GPIOx PORT.
uint16_t TM_GPIO_GetPinSource (uint16_t GPIO_Pin)
 Gets pin source from desired GPIO pin.
void TM_GPIO_Lock (GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin)
 Locks GPIOx register for future changes.
uint16_t TM_GPIO_GetUsedPins (GPIO_TypeDef *GPIOx)
 Gets bit separated pins which were used at least once in library and were not deinitialized.
uint16_t TM_GPIO_GetFreePins (GPIO_TypeDef *GPIOx)
 Gets bit separated pins which were not used at in library or were deinitialized.

Detailed Description

TM_GPIO_Typedefs.

GPIO Functions


Function Documentation

void TM_GPIO_DeInit ( GPIO_TypeDef *  GPIOx,
uint16_t  GPIO_Pin 
)

Deinitializes pin(s)

Note:
Pins(s) will be set as analog mode to get low power consumption
Parameters:
GPIOx,:GPIOx PORT where you want to set pin as input
GPIO_Pin,:Select GPIO pin(s). You can select more pins with | (OR) operator to set them as input
Return values:
None
uint16_t TM_GPIO_GetFreePins ( GPIO_TypeDef *  GPIOx )

Gets bit separated pins which were not used at in library or were deinitialized.

Parameters:
*GPIOx,:Pointer to GPIOx peripheral where to check used GPIO pins
Return values:
Bitvalues for free pins
uint16_t TM_GPIO_GetPinSource ( uint16_t  GPIO_Pin )

Gets pin source from desired GPIO pin.

Note:
Meant for private use, unless you know what are you doing
Parameters:
GPIO_Pin,:GPIO pin for calculating port source
Return values:
Calculatedpin source for GPIO pin
uint16_t TM_GPIO_GetPortSource ( GPIO_TypeDef *  GPIOx )

Gets port source from desired GPIOx PORT.

Note:
Meant for private use, unless you know what are you doing
Parameters:
GPIOx,:GPIO PORT for calculating port source
Return values:
Calculatedport source for GPIO
uint16_t TM_GPIO_GetUsedPins ( GPIO_TypeDef *  GPIOx )

Gets bit separated pins which were used at least once in library and were not deinitialized.

Parameters:
*GPIOx,:Pointer to GPIOx peripheral where to check used GPIO pins
Return values:
Bitvalues for used pins
void TM_GPIO_Init ( GPIO_TypeDef *  GPIOx,
uint16_t  GPIO_Pin,
TM_GPIO_Mode_t  GPIO_Mode,
TM_GPIO_OType_t  GPIO_OType,
TM_GPIO_PuPd_t  GPIO_PuPd,
TM_GPIO_Speed_t  GPIO_Speed 
)

Initializes GPIO pins(s)

Note:
This function also enables clock for GPIO port
Parameters:
GPIOx,:Pointer to GPIOx port you will use for initialization
GPIO_Pin,:GPIO pin(s) you will use for initialization
GPIO_Mode,:Select GPIO mode. This parameter can be a value of TM_GPIO_Mode_t enumeration
GPIO_OType,:Select GPIO Output type. This parameter can be a value of TM_GPIO_OType_t enumeration
GPIO_PuPd,:Select GPIO pull resistor. This parameter can be a value of TM_GPIO_PuPd_t enumeration
GPIO_Speed,:Select GPIO speed. This parameter can be a value of TM_GPIO_Speed_t enumeration
Return values:
None
void TM_GPIO_InitAlternate ( GPIO_TypeDef *  GPIOx,
uint16_t  GPIO_Pin,
TM_GPIO_OType_t  GPIO_OType,
TM_GPIO_PuPd_t  GPIO_PuPd,
TM_GPIO_Speed_t  GPIO_Speed,
uint8_t  Alternate 
)

Initializes GPIO pins(s) as alternate function.

Note:
This function also enables clock for GPIO port
Parameters:
GPIOx,:Pointer to GPIOx port you will use for initialization
GPIO_Pin,:GPIO pin(s) you will use for initialization
GPIO_OType,:Select GPIO Output type. This parameter can be a value of TM_GPIO_OType_t enumeration
GPIO_PuPd,:Select GPIO pull resistor. This parameter can be a value of TM_GPIO_PuPd_t enumeration
GPIO_Speed,:Select GPIO speed. This parameter can be a value of TM_GPIO_Speed_t enumeration
Alternate,:Alternate function you will use
Return values:
None
void TM_GPIO_Lock ( GPIO_TypeDef *  GPIOx,
uint16_t  GPIO_Pin 
)

Locks GPIOx register for future changes.

Note:
You are not able to config GPIO registers until new MCU reset occurs
Parameters:
*GPIOx,:GPIOx PORT where you want to lock config registers
GPIO_Pin,:GPIO pin(s) where you want to lock config registers
Return values:
None
void TM_GPIO_SetPinAsAlternate ( GPIO_TypeDef *  GPIOx,
uint16_t  GPIO_Pin 
)

Sets pin(s) as alternate function.

Note:
For proper alternate function, you should first init pin using TM_GPIO_InitAlternate() function. This functions is only used for changing GPIO mode
Parameters:
GPIOx,:GPIOx PORT where you want to set pin as alternate
GPIO_Pin,:Select GPIO pin(s). You can select more pins with | (OR) operator to set them as alternate
Return values:
None
void TM_GPIO_SetPinAsAnalog ( GPIO_TypeDef *  GPIOx,
uint16_t  GPIO_Pin 
)

Sets pin(s) as analog.

Note:
Pins HAVE to be initialized first using TM_GPIO_Init() or TM_GPIO_InitAlternate() function
This is just an option for fast analog mode
Parameters:
GPIOx,:GPIOx PORT where you want to set pin as analog
GPIO_Pin,:Select GPIO pin(s). You can select more pins with | (OR) operator to set them as analog
Return values:
None
void TM_GPIO_SetPinAsInput ( GPIO_TypeDef *  GPIOx,
uint16_t  GPIO_Pin 
)

Sets pin(s) as input.

Note:
Pins HAVE to be initialized first using TM_GPIO_Init() or TM_GPIO_InitAlternate() function
This is just an option for fast input mode
Parameters:
GPIOx,:GPIOx PORT where you want to set pin as input
GPIO_Pin,:Select GPIO pin(s). You can select more pins with | (OR) operator to set them as input
Return values:
None
void TM_GPIO_SetPinAsOutput ( GPIO_TypeDef *  GPIOx,
uint16_t  GPIO_Pin 
)

Sets pin(s) as output.

Note:
Pins HAVE to be initialized first using TM_GPIO_Init() or TM_GPIO_InitAlternate() function
This is just an option for fast output mode
Parameters:
GPIOx,:GPIOx PORT where you want to set pin as output
GPIO_Pin,:Select GPIO pin(s). You can select more pins with | (OR) operator to set them as output
Return values:
None
void TM_GPIO_SetPullResistor ( GPIO_TypeDef *  GPIOx,
uint16_t  GPIO_Pin,
TM_GPIO_PuPd_t  GPIO_PuPd 
)

Sets pull resistor settings to GPIO pin(s)

Note:
Pins HAVE to be initialized first using TM_GPIO_Init() or TM_GPIO_InitAlternate() function
Parameters:
*GPIOx,:GPIOx PORT where you want to select pull resistor
GPIO_Pin,:Select GPIO pin(s). You can select more pins with | (OR) operator to set them as output
GPIO_PuPd,:Pull resistor option. This parameter can be a value of TM_GPIO_PuPd_t enumeration
Return values:
None