-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add board_comp files for RT1060 and RT1170
- Loading branch information
Showing
4 changed files
with
212 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Copyright 2022 NXP | ||
* All rights reserved. | ||
* | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
*/ | ||
|
||
/************************************************************************************ | ||
* Include | ||
************************************************************************************/ | ||
#include "board_comp.h" | ||
|
||
/************************************************************************************ | ||
************************************************************************************* | ||
* Private type definitions and macros | ||
************************************************************************************* | ||
************************************************************************************/ | ||
|
||
/************************************************************************************ | ||
************************************************************************************* | ||
* Private memory declarations | ||
************************************************************************************* | ||
************************************************************************************/ | ||
|
||
/************************************************************************************ | ||
************************************************************************************* | ||
* Public functions | ||
************************************************************************************* | ||
************************************************************************************/ | ||
|
||
/*Initialize Button*/ | ||
button_status_t BOARD_InitButton(button_handle_t ButtonHandle) | ||
{ | ||
/* Initialize Button component */ | ||
button_config_t buttonConfig; | ||
button_status_t bStatus; | ||
|
||
buttonConfig.gpio.port = BOARD_BUTTON_GPIO_PORT; | ||
buttonConfig.gpio.pin = BOARD_BUTTON_GPIO_PIN; | ||
buttonConfig.gpio.pinStateDefault = BOARD_BUTTON_GPIO_PIN_STATE_DEFAULT; | ||
buttonConfig.gpio.direction = BOARD_BUTTON_GPIO_DIRECTION; | ||
|
||
bStatus = BUTTON_Init((button_handle_t)ButtonHandle, &buttonConfig); | ||
|
||
return bStatus; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
* Copyright 2022 NXP | ||
* All rights reserved. | ||
* | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
*/ | ||
|
||
#ifndef _BOARD_COMP_H_ | ||
#define _BOARD_COMP_H_ | ||
|
||
/******************************************************************************* | ||
* Includes | ||
******************************************************************************/ | ||
#include "board.h" | ||
#include "fsl_component_button.h" | ||
|
||
/******************************************************************************* | ||
* Definitions | ||
******************************************************************************/ | ||
|
||
/* The configuration of Button component. */ | ||
|
||
#ifndef BOARD_BUTTON_GPIO_PORT | ||
#define BOARD_BUTTON_GPIO_PORT 5 | ||
#endif | ||
|
||
#ifndef BOARD_BUTTON_GPIO_PIN | ||
#define BOARD_BUTTON_GPIO_PIN BOARD_USER_BUTTON_GPIO_PIN | ||
#endif | ||
|
||
#ifndef BOARD_BUTTON_GPIO_PIN_STATE_DEFAULT | ||
#define BOARD_BUTTON_GPIO_PIN_STATE_DEFAULT 1 | ||
#endif | ||
|
||
#ifndef BOARD_BUTTON_GPIO_DIRECTION | ||
#define BOARD_BUTTON_GPIO_DIRECTION kHAL_GpioDirectionIn | ||
#endif | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/******************************************************************************* | ||
* API | ||
******************************************************************************/ | ||
|
||
/*! | ||
* @brief Initialize Button Component | ||
* | ||
* This API will initialize the button component | ||
* | ||
* @param ButtonHandle The button handle. | ||
*/ | ||
button_status_t BOARD_InitButton(button_handle_t ButtonHandle); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* _BOARD_COMP_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Copyright 2022 NXP | ||
* All rights reserved. | ||
* | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
*/ | ||
|
||
/************************************************************************************ | ||
* Include | ||
************************************************************************************/ | ||
#include "board_comp.h" | ||
|
||
/************************************************************************************ | ||
************************************************************************************* | ||
* Private type definitions and macros | ||
************************************************************************************* | ||
************************************************************************************/ | ||
|
||
/************************************************************************************ | ||
************************************************************************************* | ||
* Private memory declarations | ||
************************************************************************************* | ||
************************************************************************************/ | ||
|
||
/************************************************************************************ | ||
************************************************************************************* | ||
* Public functions | ||
************************************************************************************* | ||
************************************************************************************/ | ||
|
||
/*Initialize Button*/ | ||
button_status_t BOARD_InitButton(button_handle_t ButtonHandle) | ||
{ | ||
/* Initialize Button component */ | ||
button_config_t buttonConfig; | ||
button_status_t bStatus; | ||
|
||
buttonConfig.gpio.port = BOARD_BUTTON_GPIO_PORT; | ||
buttonConfig.gpio.pin = BOARD_BUTTON_GPIO_PIN; | ||
buttonConfig.gpio.pinStateDefault = BOARD_BUTTON_GPIO_PIN_STATE_DEFAULT; | ||
buttonConfig.gpio.direction = BOARD_BUTTON_GPIO_DIRECTION; | ||
|
||
bStatus = BUTTON_Init((button_handle_t)ButtonHandle, &buttonConfig); | ||
|
||
return bStatus; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
* Copyright 2022 NXP | ||
* All rights reserved. | ||
* | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
*/ | ||
|
||
#ifndef _BOARD_COMP_H_ | ||
#define _BOARD_COMP_H_ | ||
|
||
/******************************************************************************* | ||
* Includes | ||
******************************************************************************/ | ||
#include "board.h" | ||
#include "fsl_component_button.h" | ||
|
||
/******************************************************************************* | ||
* Definitions | ||
******************************************************************************/ | ||
|
||
/* The configuration of Button component. */ | ||
|
||
#ifndef BOARD_BUTTON_GPIO_PORT | ||
#define BOARD_BUTTON_GPIO_PORT 5 | ||
#endif | ||
|
||
#ifndef BOARD_BUTTON_GPIO_PIN | ||
#define BOARD_BUTTON_GPIO_PIN BOARD_USER_BUTTON_GPIO_PIN | ||
#endif | ||
|
||
#ifndef BOARD_BUTTON_GPIO_PIN_STATE_DEFAULT | ||
#define BOARD_BUTTON_GPIO_PIN_STATE_DEFAULT 1 | ||
#endif | ||
|
||
#ifndef BOARD_BUTTON_GPIO_DIRECTION | ||
#define BOARD_BUTTON_GPIO_DIRECTION kHAL_GpioDirectionIn | ||
#endif | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/******************************************************************************* | ||
* API | ||
******************************************************************************/ | ||
|
||
/*! | ||
* @brief Initialize Button Component | ||
* | ||
* This API will initialize the button component | ||
* | ||
* @param ButtonHandle The button handle. | ||
*/ | ||
button_status_t BOARD_InitButton(button_handle_t ButtonHandle); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* _BOARD_COMP_H_ */ |