GadgetSeed  0.9.6
32f469i-disc_led.c ファイル

32F469IDISCOVERY LEDドライバ [詳解]

#include "device.h"
#include "stm32f4xx_hal.h"
#include "stm32f4xx_hal_gpio.h"
32f469i-disc_led.c の依存先関係図:

[ソースコード]

マクロ定義

#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 */
 

関数

static void LED_Configuration (void)
 
static int led_register (struct st_device *dev, char *param)
 LEDドライバの登録 [詳解]
 
static int led_getc (struct st_device *dev, unsigned char *rd)
 LEDの状態を取得する [詳解]
 
static int led_putc (struct st_device *dev, unsigned char ch)
 LEDの状態を設定する [詳解]
 

変数

static unsigned char led_stat
 
const struct st_device led_device
 LEDドライバ [詳解]
 

詳解

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の状態を取得する

引数
[out]rdLEDデータポインタ
戻り値
!=0:データあり 0:データ無し

32f469i-disc_led.c117 行目に定義があります。

◆ led_putc()

static int led_putc ( struct st_device dev,
unsigned char  ch 
)
static

LEDの状態を設定する

引数
[out]chLEDデータポインタ
戻り値
1:正常終了,!=0:エラー

32f469i-disc_led.c131 行目に定義があります。

◆ led_register()

static int led_register ( struct st_device dev,
char *  param 
)
static

LEDドライバの登録

引数
[in]param未使用
戻り値
!=0:エラー

32f469i-disc_led.c101 行目に定義があります。

変数詳解

◆ led_device

const struct st_device led_device
初期値:
= {
.name = DEF_DEV_NAME_LED,
.explan = "32F469I-Discovery LED",
.register_dev = led_register,
.getc = led_getc,
.putc = led_putc,
}
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.c162 行目に定義があります。