Kévin Redon | 9a12d68 | 2018-07-08 13:21:16 +0200 | [diff] [blame^] | 1 | /* Card simulator specific functions |
Harald Welte | 390760a | 2016-02-27 16:23:46 +0100 | [diff] [blame] | 2 | * |
Kévin Redon | 9a12d68 | 2018-07-08 13:21:16 +0200 | [diff] [blame^] | 3 | * (C) 2015-2017 by Harald Welte <hwelte@hmw-consulting.de> |
Harald Welte | 390760a | 2016-02-27 16:23:46 +0100 | [diff] [blame] | 4 | * |
Kévin Redon | 9a12d68 | 2018-07-08 13:21:16 +0200 | [diff] [blame^] | 5 | * This program is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation; either version 2 of the License, or |
| 8 | * (at your option) any later version. |
Harald Welte | 390760a | 2016-02-27 16:23:46 +0100 | [diff] [blame] | 9 | * |
Kévin Redon | 9a12d68 | 2018-07-08 13:21:16 +0200 | [diff] [blame^] | 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
Harald Welte | 390760a | 2016-02-27 16:23:46 +0100 | [diff] [blame] | 14 | * |
Kévin Redon | 9a12d68 | 2018-07-08 13:21:16 +0200 | [diff] [blame^] | 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program; if not, write to the Free Software |
| 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA |
Harald Welte | 390760a | 2016-02-27 16:23:46 +0100 | [diff] [blame] | 18 | */ |
| 19 | |
| 20 | #include "chip.h" |
| 21 | #include "board.h" |
Harald Welte | d8a003d | 2017-02-27 20:31:09 +0100 | [diff] [blame] | 22 | #include "utils.h" |
Harald Welte | 390760a | 2016-02-27 16:23:46 +0100 | [diff] [blame] | 23 | |
| 24 | static const Pin pins_cardsim[] = PINS_CARDSIM; |
| 25 | |
| 26 | void cardsim_set_simpres(uint8_t slot, int present) |
| 27 | { |
| 28 | if (slot > 1) |
| 29 | return; |
| 30 | |
| 31 | if (present) |
| 32 | PIO_Set(&pins_cardsim[slot]); |
| 33 | else |
| 34 | PIO_Clear(&pins_cardsim[slot]); |
| 35 | } |
| 36 | |
| 37 | void cardsim_gpio_init(void) |
| 38 | { |
| 39 | PIO_Configure(&pins_cardsim, ARRAY_SIZE(pins_cardsim)); |
| 40 | } |