nuclear@2: /* nuclear@2: gbasys - a gameboy advance hardware abstraction library nuclear@2: Copyright (C) 2005-2012 John Tsiombikas nuclear@2: nuclear@2: This program is free software: you can redistribute it and/or modify nuclear@2: it under the terms of the GNU General Public License as published by nuclear@2: the Free Software Foundation, either version 3 of the License, or nuclear@2: (at your option) any later version. nuclear@2: nuclear@2: This program is distributed in the hope that it will be useful, nuclear@2: but WITHOUT ANY WARRANTY; without even the implied warranty of nuclear@2: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the nuclear@2: GNU General Public License for more details. nuclear@2: nuclear@2: You should have received a copy of the GNU General Public License nuclear@2: along with this program. If not, see . nuclear@2: */ nuclear@2: #ifndef COMM_H_ nuclear@2: #define COMM_H_ nuclear@2: nuclear@2: enum { nuclear@2: COMM_SIO8_MASTER, nuclear@2: COMM_SIO8_SLAVE, nuclear@2: COMM_SIO32_MASTER, nuclear@2: COMM_SIO32_SLAVE, nuclear@2: COMM_UART, nuclear@2: COMM_GPIO nuclear@2: }; nuclear@2: nuclear@2: void comm_setup(int mode); nuclear@2: nuclear@2: /* synchronous transfer, blocks until complete */ nuclear@2: void sio_transfer(void *in, const void *out); nuclear@2: nuclear@2: /* async transfer, returns immediately, raises SIGIO when complete */ nuclear@2: void sio_transfer_async(void *in, const void *out); nuclear@2: nuclear@2: nuclear@2: /* GPIO functions */ nuclear@2: enum { GPIO_DIR_IN, GPIO_DIR_OUT }; nuclear@2: nuclear@2: void gpio_dir(int dir_so, int dir_si, int dir_sd, int dir_sc); nuclear@2: void gpio_dir_mask(unsigned char dir); nuclear@2: nuclear@2: void gpio_set(unsigned char val); nuclear@2: unsigned char gpio_get(void); nuclear@2: nuclear@2: #endif /* COMM_H_ */