blob: d1e54e66cd41ba14a682bfde37fa679eb6c38696 [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"
Harald Welted8a003d2017-02-27 20:31:09 +010022#include "utils.h"
Harald Welte390760a2016-02-27 16:23:46 +010023
24static const Pin pins_cardsim[] = PINS_CARDSIM;
25
26void 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
37void cardsim_gpio_init(void)
38{
39 PIO_Configure(&pins_cardsim, ARRAY_SIZE(pins_cardsim));
40}