gbasys

view src/comm.h @ 6:f77381b12726

palette
author John Tsiombikas <nuclear@member.fsf.org>
date Tue, 04 Sep 2012 05:05:50 +0300
parents e3dc7705ad9c
children 72c6429ae953
line source
1 /*
2 gbasys - a gameboy advance hardware abstraction library
3 Copyright (C) 2004-2012 John Tsiombikas <nuclear@member.fsf.org>
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 3 of the License, or
8 (at your option) any later version.
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.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18 #ifndef COMM_H_
19 #define COMM_H_
21 enum {
22 COMM_SIO8_MASTER,
23 COMM_SIO8_SLAVE,
24 COMM_SIO32_MASTER,
25 COMM_SIO32_SLAVE,
26 COMM_UART,
27 COMM_GPIO
28 };
30 void comm_setup(int mode);
32 /* synchronous transfer, blocks until complete */
33 void sio_transfer(void *in, const void *out);
35 /* async transfer, returns immediately, raises SIGIO when complete */
36 void sio_transfer_async(void *in, const void *out);
39 /* GPIO functions */
40 enum { GPIO_DIR_IN, GPIO_DIR_OUT };
42 void gpio_dir(int dir_so, int dir_si, int dir_sd, int dir_sc);
43 void gpio_dir_mask(unsigned char dir);
45 void gpio_set(unsigned char val);
46 unsigned char gpio_get(void);
48 #endif /* COMM_H_ */