32F469IDISCOVERY LEDドライバ
[詳解]
#include "device.h"
#include "stm32f4xx_hal.h"
#include "stm32f4xx_hal_gpio.h"
[ソースコード]
|
#define | GPIO_LED1 (GPIOG) |
|
#define | RCC_AHBPeriph_GPIO_LED1 (RCC_AHB1ENR_GPIOGEN) |
|
#define | LED_D1 (GPIO_PIN_6) |
|
#define | LED1_IO_HI(x) (((GPIO_LegacyTypeDef *)GPIO_LED1)->BSRR = x) |
|
#define | LED1_IO_LO(x) (((GPIO_LegacyTypeDef *)GPIO_LED1)->BRR = x) |
|
#define | LED_D1_OFF() LED1_IO_HI(LED_D1) /* Active Low */ |
|
#define | LED_D1_ON() LED1_IO_LO(LED_D1) /* Active Low */ |
|
#define | GPIO_LED2 (GPIOD) |
|
#define | RCC_AHBPeriph_GPIO_LED2 (RCC_AHB1ENR_GPIODEN) |
|
#define | LED_D2 (GPIO_PIN_4) |
|
#define | LED2_IO_HI(x) (((GPIO_LegacyTypeDef *)GPIO_LED2)->BSRR = x) |
|
#define | LED2_IO_LO(x) (((GPIO_LegacyTypeDef *)GPIO_LED2)->BRR = x) |
|
#define | LED_D2_OFF() LED2_IO_HI(LED_D2) /* Active Low */ |
|
#define | LED_D2_ON() LED2_IO_LO(LED_D2) /* Active Low */ |
|
#define | GPIO_LED3 (GPIOD) |
|
#define | RCC_AHBPeriph_GPIO_LED3 (RCC_AHB1ENR_GPIODEN) |
|
#define | LED_D3 (GPIO_PIN_5) |
|
#define | LED3_IO_HI(x) (((GPIO_LegacyTypeDef *)GPIO_LED3)->BSRR = x) |
|
#define | LED3_IO_LO(x) (((GPIO_LegacyTypeDef *)GPIO_LED3)->BRR = x) |
|
#define | LED_D3_OFF() LED3_IO_HI(LED_D3) /* Active Low */ |
|
#define | LED_D3_ON() LED3_IO_LO(LED_D3) /* Active Low */ |
|
#define | GPIO_LED4 (GPIOK) |
|
#define | RCC_AHBPeriph_GPIO_LED4 (RCC_AHB1ENR_GPIOKEN) |
|
#define | LED_D4 (GPIO_PIN_3) |
|
#define | LED4_IO_HI(x) (((GPIO_LegacyTypeDef *)GPIO_LED4)->BSRR = x) |
|
#define | LED4_IO_LO(x) (((GPIO_LegacyTypeDef *)GPIO_LED4)->BRR = x) |
|
#define | LED_D4_OFF() LED4_IO_HI(LED_D4) /* Active Low */ |
|
#define | LED_D4_ON() LED4_IO_LO(LED_D4) /* Active Low */ |
|
32F469IDISCOVERY LEDドライバ
- 日付
- 2018.08.15
- 著者
- Takashi SHUDO
LD1(Green) PG6 LD2(Orange) PD4 LD3(Red) PD5 LD4(Blue) PK3
32f469i-disc_led.c に定義があります。
◆ led_getc()
static int led_getc |
( |
struct st_device * |
dev, |
|
|
unsigned char * |
rd |
|
) |
| |
|
static |
◆ led_putc()
static int led_putc |
( |
struct st_device * |
dev, |
|
|
unsigned char |
ch |
|
) |
| |
|
static |
◆ led_register()
static int led_register |
( |
struct st_device * |
dev, |
|
|
char * |
param |
|
) |
| |
|
static |
◆ led_device
初期値:= {
.name = DEF_DEV_NAME_LED,
.explan = "32F469I-Discovery LED",
}
static int led_putc(struct st_device *dev, unsigned char ch)
LEDの状態を設定する
static int led_getc(struct st_device *dev, unsigned char *rd)
LEDの状態を取得する
static int led_register(struct st_device *dev, char *param)
LEDドライバの登録
LEDドライバ
32f469i-disc_led.c の 162 行目に定義があります。