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