0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

2019-10-06 LPC > LPCXpresso54628 > fsl_gpio.hがないけれどいいの? > board.hからインクルードしているから不要

Last updated at Posted at 2019-10-05
動作環境
OS: Ubuntu 18.04 LTS
基板: LPCXpresso54628
IDE: MCUXpresso IDE v11.0.1 [Build 2563] [2019-09-01]

関連

疑問点

  • #include "fsl_gpio.h"があるプロジェクトとないプロジェクトがある
    • ある: import SDK example(s)...で生成したプロジェクト
    • ない: 新規プロジェクト
  • ない方であっても、GPIO_PortInit()などの関数を使用してもエラーにはならない
    • どこからインクルードしているのだろう

fsl_gpio.hをインクルードしているファイル

プロジェクトのトップフォルダに移動し、下記を実行した。

$ grep -r fsl_gpio.h | grep include
source/gpio_led_output.c:#include "fsl_gpio.h"
drivers/fsl_gpio.c:#include "fsl_gpio.h"
board/board.h:#include "fsl_gpio.h"

board.hからインクルードされている。
このファイルは上記の二者ともにインクルードしている。

SDK exampleの#include "fsl_gpio.h"はなくても動く。明示的にしておきたかったのかも。

関連

1.) The wizzard asks for driver inclusion. Why aren't the chosen drivers not automatically included, e.g. #include "fsl_gpio.h" in main.c when I chose the GPIO driver in the wizzard?

答え: board.hからインクルードされているから不要
ということなのかもしれない。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?