GadgetSeed  0.9.6
stm32f769i-disc_led.c ファイル

STM32F769I-Discovery LED ドライバ [詳解]

#include "device.h"
#include "stm32f7xx_hal.h"
#include "stm32f7xx_hal_gpio.h"
stm32f769i-disc_led.c の依存先関係図:

[ソースコード]

マクロ定義

#define GPIO_LED1   (GPIOJ)
 
#define GPIO_LED   (GPIOJ)
 
#define RCC_AHBPeriph_GPIO_LED1   (RCC_AHB1ENR_GPIOJEN)
 
#define RCC_AHBPeriph_GPIO_LED   (RCC_AHB1ENR_GPIOJEN)
 
#define LED_D1   (GPIO_PIN_13)
 
#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_LO(LED_D1) /* Active High */
 
#define LED_D1_ON()   LED1_IO_HI(LED_D1) /* Active High */
 
#define LED_OFF(x)   LED1_IO_LO(LED_D1) /* Active High */
 
#define LED_ON(x)   LED1_IO_HI(LED_D1) /* Active High */
 
#define GPIO_LED2   (GPIOJ)
 
#define RCC_AHBPeriph_GPIO_LED2   (RCC_AHB1ENR_GPIOJEN)
 
#define LED_D2   (GPIO_PIN_5)
 
#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_LO(LED_D2) /* Active High */
 
#define LED_D2_ON()   LED2_IO_HI(LED_D2) /* Active High */
 
#define GPIO_LED3   (GPIOA)
 
#define RCC_AHBPeriph_GPIO_LED3   (RCC_AHB1ENR_GPIOAEN)
 
#define LED_D3   (GPIO_PIN_12)
 
#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_LO(LED_D3) /* Active High */
 
#define LED_D3_ON()   LED3_IO_HI(LED_D3) /* Active High */
 

関数

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 int led_suspend (struct st_device *dev)
 
static int led_resume (struct st_device *dev)
 

変数

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

詳解

STM32F769I-Discovery LED ドライバ

日付
2017.01.07 Takashi SHUDO

stm32f769i-disc_led.c に定義があります。

関数詳解

◆ led_getc()

static int led_getc ( struct st_device dev,
unsigned char *  rd 
)
static

LEDの状態を取得する

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

stm32f769i-disc_led.c104 行目に定義があります。

◆ led_putc()

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

LEDの状態を設定する

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

stm32f769i-disc_led.c118 行目に定義があります。

◆ led_register()

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

LEDドライバの登録

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

stm32f769i-disc_led.c88 行目に定義があります。

変数詳解

◆ led_device

const struct st_device led_device
初期値:
= {
.name = DEF_DEV_NAME_LED,
.explan = "STM32F769I-Discovery LED",
.register_dev = led_register,
.getc = led_getc,
.putc = led_putc,
.suspend = led_suspend,
.resume = led_resume,
}
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ドライバ

stm32f769i-disc_led.c153 行目に定義があります。