paul@38 | 1 | /* |
paul@38 | 2 | * Client functionality for keypad library access. |
paul@38 | 3 | * |
paul@153 | 4 | * Copyright (C) 2018, 2023 Paul Boddie <paul@boddie.org.uk> |
paul@38 | 5 | * |
paul@38 | 6 | * This program is free software; you can redistribute it and/or |
paul@38 | 7 | * modify it under the terms of the GNU General Public License as |
paul@38 | 8 | * published by the Free Software Foundation; either version 2 of |
paul@38 | 9 | * the License, or (at your option) any later version. |
paul@38 | 10 | * |
paul@38 | 11 | * This program is distributed in the hope that it will be useful, |
paul@38 | 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
paul@38 | 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
paul@38 | 14 | * GNU General Public License for more details. |
paul@38 | 15 | * |
paul@38 | 16 | * You should have received a copy of the GNU General Public License |
paul@38 | 17 | * along with this program; if not, write to the Free Software |
paul@38 | 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, |
paul@38 | 19 | * Boston, MA 02110-1301, USA |
paul@38 | 20 | */ |
paul@38 | 21 | |
paul@38 | 22 | #include <l4/devices/dl.h> |
paul@38 | 23 | #include "keypad.h" |
paul@38 | 24 | #include "keypad-loader.h" |
paul@38 | 25 | |
paul@153 | 26 | Keypad_generic *load_keypad() |
paul@38 | 27 | { |
paul@38 | 28 | // Load the keypad library using details in the specified file. |
paul@38 | 29 | |
paul@38 | 30 | void *(*keypad_get)(void); |
paul@38 | 31 | |
paul@38 | 32 | keypad_get = (void *(*)(void)) load_function("rom/input-keypad.txt", "keypad_get"); |
paul@38 | 33 | if (!keypad_get) return 0; |
paul@38 | 34 | |
paul@38 | 35 | // Return the keypad details. |
paul@38 | 36 | |
paul@153 | 37 | return (Keypad_generic *) keypad_get(); |
paul@38 | 38 | } |