1 /* Copyright 2018 SiFive, Inc */
2 /* SPDX-License-Identifier: Apache-2.0 */
4 #include <metal/button.h>
5 #include <metal/machine.h>
7 struct metal_button* metal_button_get (char *label)
10 struct metal_button *button;
12 if ((__METAL_DT_MAX_BUTTONS == 0) || (label == NULL)) {
16 for (i = 0; i < __METAL_DT_MAX_BUTTONS; i++) {
17 button = (struct metal_button*)__metal_button_table[i];
18 if (button->vtable->button_exist(button, label)) {
25 extern __inline__ struct metal_interrupt*
26 metal_button_interrupt_controller(struct metal_button *button);
27 extern __inline__ int metal_button_get_interrupt_id(struct metal_button *button);