miniFOC 1.0.3
This open-source project aims to accomplish a FOC(Field Oriented Control) scheme that is operatable with minimum costs in China.
Macros
led.h File Reference

this file contains macros for LED initialization and related IO port operations. More...

Go to the source code of this file.

Macros

#define led_on()   gpio_bit_reset(GPIOB, GPIO_PIN_5)
 turn on LED More...
 
#define led_off()   gpio_bit_set(GPIOB, GPIO_PIN_5)
 turn off LED More...
 
#define led_toggle()   gpio_bit_write(GPIOB, GPIO_PIN_5, !gpio_output_bit_get(GPIOB, GPIO_PIN_5))
 flip the LED pin level More...
 
#define led_config()
 configure led periph and its gpios More...
 

Detailed Description

this file contains macros for LED initialization and related IO port operations.

Author
Lao·Zhu
Version
V1.0.1
Date
10. October 2021

Definition in file led.h.

Macro Definition Documentation

◆ led_config

#define led_config ( )
Value:
rcu_periph_clock_enable(RCU_GPIOB);\
gpio_mode_set(GPIOB, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, GPIO_PIN_5);\
gpio_output_options_set(GPIOB, GPIO_OTYPE_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_5);\
led_off()

configure led periph and its gpios

Definition at line 30 of file led.h.

◆ led_off

#define led_off ( )    gpio_bit_set(GPIOB, GPIO_PIN_5)

turn off LED

Definition at line 20 of file led.h.

◆ led_on

#define led_on ( )    gpio_bit_reset(GPIOB, GPIO_PIN_5)

turn on LED

Definition at line 15 of file led.h.

◆ led_toggle

#define led_toggle ( )    gpio_bit_write(GPIOB, GPIO_PIN_5, !gpio_output_bit_get(GPIOB, GPIO_PIN_5))

flip the LED pin level

Definition at line 25 of file led.h.