TM STM32Fxxx HAL Libraries  v1.0.0
Libraries for STM32Fxxx (F0, F4 and F7 series) devices based on HAL drivers from ST from Tilen Majerle

Library Functions. More...

Macros

#define TM_DISCO_LedOn(led)    TM_GPIO_SetPinHigh(DISCO_LED_PORT, (uint16_t)(led))
 Turns on LED on board. More...
 
#define TM_DISCO_LedOff(led)    TM_GPIO_SetPinLow(DISCO_LED_PORT, (uint16_t)(led))
 Turns off LED on board. More...
 
#define TM_DISCO_LedToggle(led)    TM_GPIO_TogglePinValue(DISCO_LED_PORT, (uint16_t)(led))
 Toggles LED on board. More...
 
#define TM_DISCO_LedIsOn(led)    TM_GPIO_GetOutputPinValue(DISCO_LED_PORT, (uint16_t)(led))
 Checks if led is on. More...
 
#define TM_DISCO_SetLed(led, state)    ((state) ? TM_DISCO_LedOn(led): TM_DISCO_LedOff(led))
 Sets led value. More...
 
#define TM_DISCO_ButtonPressed()    ((TM_GPIO_GetInputPinValue(DISCO_BUTTON_PORT, DISCO_BUTTON_PIN) == 0) != DISCO_BUTTON_PRESSED)
 Checks if user button is pressed. More...
 

Functions

void TM_DISCO_LedInit (void)
 Configures LED pins as outputs. More...
 
void TM_DISCO_ButtonInit (void)
 Configures Button pin as input. More...
 
uint8_t TM_DISCO_ButtonOnPressed (void)
 Checks if button was pressed now, but was not already pressed before. More...
 
uint8_t TM_DISCO_ButtonOnReleased (void)
 Checks if button was released now, but was already pressed before. More...
 

Detailed Description

Library Functions.

Macro Definition Documentation

#define TM_DISCO_ButtonPressed ( )    ((TM_GPIO_GetInputPinValue(DISCO_BUTTON_PORT, DISCO_BUTTON_PIN) == 0) != DISCO_BUTTON_PRESSED)

Checks if user button is pressed.

Parameters
None
Return values
Buttonstatus
  • 0: Button is not pressed
  • > 0: Button is pressed
#define TM_DISCO_LedIsOn (   led)    TM_GPIO_GetOutputPinValue(DISCO_LED_PORT, (uint16_t)(led))

Checks if led is on.

Note
STM32F4x9-Eval board uses inverse logic for leds
Parameters
ledLed you want to checking
  • LED_RED: Red led
  • LED_GREEN: Green led
  • LED_BLUE: Blue led
  • LED_ORANGE: Orange led
Return values
Ledon status:
  • 0: Led is off
  • > 0: Led is on
#define TM_DISCO_LedOff (   led)    TM_GPIO_SetPinLow(DISCO_LED_PORT, (uint16_t)(led))

Turns off LED on board.

Note
STM32F4x9-Eval board uses inverse logic for leds
Parameters
ledLED you want to turn off
  • LED_RED: Red led
  • LED_GREEN: Green led
  • LED_BLUE: Blue led
  • LED_ORANGE: Orange led
  • LED_ALL: All leds
Return values
None
#define TM_DISCO_LedOn (   led)    TM_GPIO_SetPinHigh(DISCO_LED_PORT, (uint16_t)(led))

Turns on LED on board.

Note
STM32F4x9-Eval board uses inverse logic for leds
Parameters
ledLED you want to turn on
  • LED_RED: Red led
  • LED_GREEN: Green led
  • LED_BLUE: Blue led
  • LED_ORANGE: Orange led
  • LED_ALL: All leds
Return values
None
#define TM_DISCO_LedToggle (   led)    TM_GPIO_TogglePinValue(DISCO_LED_PORT, (uint16_t)(led))

Toggles LED on board.

Parameters
ledLED you want to toggle
  • LED_RED: Red led
  • LED_GREEN: Green led
  • LED_BLUE: Blue led
  • LED_ORANGE: Orange led
  • LED_ALL: All leds
Return values
None
#define TM_DISCO_SetLed (   led,
  state 
)    ((state) ? TM_DISCO_LedOn(led): TM_DISCO_LedOff(led))

Sets led value.

Parameters
ledLED you want to set value
  • LED_RED: Red led
  • LED_GREEN: Green led
  • LED_BLUE: Blue led
  • LED_ORANGE: Orange led
  • LED_ALL: All leds
stateSet or clear led
  • 0: led is off
  • > 0: led is on
Return values
None

Function Documentation

void TM_DISCO_ButtonInit ( void  )

Configures Button pin as input.

Parameters
None
Return values
None
uint8_t TM_DISCO_ButtonOnPressed ( void  )

Checks if button was pressed now, but was not already pressed before.

Parameters
None
Return values
Buttonon pressed value
  • 0: In case that button has been already pressed on last call or was not pressed at all yet
  • > 0: Button was pressed, but state before was released
uint8_t TM_DISCO_ButtonOnReleased ( void  )

Checks if button was released now, but was already pressed before.

Parameters
None
Return values
Buttonon released value
  • 0: In case that button has been already released on last call or was not released at all yet
  • > 0: Button was released, but state before was pressed
void TM_DISCO_LedInit ( void  )

Configures LED pins as outputs.

Parameters
None
Return values
None