gbasys

annotate src/comm.h @ 3:06726f0b8cd3

foo
author John Tsiombikas <nuclear@member.fsf.org>
date Thu, 08 Mar 2012 14:37:17 +0200
parents e3dc7705ad9c
children 72c6429ae953
rev   line source
nuclear@2 1 /*
nuclear@2 2 gbasys - a gameboy advance hardware abstraction library
nuclear@3 3 Copyright (C) 2004-2012 John Tsiombikas <nuclear@member.fsf.org>
nuclear@2 4
nuclear@2 5 This program is free software: you can redistribute it and/or modify
nuclear@2 6 it under the terms of the GNU General Public License as published by
nuclear@2 7 the Free Software Foundation, either version 3 of the License, or
nuclear@2 8 (at your option) any later version.
nuclear@2 9
nuclear@2 10 This program is distributed in the hope that it will be useful,
nuclear@2 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
nuclear@2 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
nuclear@2 13 GNU General Public License for more details.
nuclear@2 14
nuclear@2 15 You should have received a copy of the GNU General Public License
nuclear@2 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
nuclear@2 17 */
nuclear@2 18 #ifndef COMM_H_
nuclear@2 19 #define COMM_H_
nuclear@2 20
nuclear@2 21 enum {
nuclear@2 22 COMM_SIO8_MASTER,
nuclear@2 23 COMM_SIO8_SLAVE,
nuclear@2 24 COMM_SIO32_MASTER,
nuclear@2 25 COMM_SIO32_SLAVE,
nuclear@2 26 COMM_UART,
nuclear@2 27 COMM_GPIO
nuclear@2 28 };
nuclear@2 29
nuclear@2 30 void comm_setup(int mode);
nuclear@2 31
nuclear@2 32 /* synchronous transfer, blocks until complete */
nuclear@2 33 void sio_transfer(void *in, const void *out);
nuclear@2 34
nuclear@2 35 /* async transfer, returns immediately, raises SIGIO when complete */
nuclear@2 36 void sio_transfer_async(void *in, const void *out);
nuclear@2 37
nuclear@2 38
nuclear@2 39 /* GPIO functions */
nuclear@2 40 enum { GPIO_DIR_IN, GPIO_DIR_OUT };
nuclear@2 41
nuclear@2 42 void gpio_dir(int dir_so, int dir_si, int dir_sd, int dir_sc);
nuclear@2 43 void gpio_dir_mask(unsigned char dir);
nuclear@2 44
nuclear@2 45 void gpio_set(unsigned char val);
nuclear@2 46 unsigned char gpio_get(void);
nuclear@2 47
nuclear@2 48 #endif /* COMM_H_ */