fork of PCE focusing on macplus, supporting DaynaPort SCSI network emulation
at master 71 lines 2.3 kB view raw
1/***************************************************************************** 2 * pce * 3 *****************************************************************************/ 4 5/***************************************************************************** 6 * File name: src/arch/macplus/serial.h * 7 * Created: 2007-12-19 by Hampa Hug <hampa@hampa.ch> * 8 * Copyright: (C) 2007-2020 Hampa Hug <hampa@hampa.ch> * 9 *****************************************************************************/ 10 11/***************************************************************************** 12 * This program is free software. You can redistribute it and / or modify it * 13 * under the terms of the GNU General Public License version 2 as published * 14 * by the Free Software Foundation. * 15 * * 16 * This program is distributed in the hope that it will be useful, but * 17 * WITHOUT ANY WARRANTY, without even the implied warranty of * 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General * 19 * Public License for more details. * 20 *****************************************************************************/ 21 22 23#ifndef PCE_MACPLUS_SERIAL_H 24#define PCE_MACPLUS_SERIAL_H 1 25 26 27#include <chipset/e8530.h> 28#include <drivers/char/char.h> 29 30 31#define MAC_SER_BUF 256 32 33 34typedef struct { 35 e8530_t *scc; 36 37 unsigned chn; 38 39 unsigned long bps; 40 unsigned parity; 41 unsigned bpc; 42 unsigned stop; 43 44 int dtr; 45 int rts; 46 47 unsigned inp_idx; 48 unsigned inp_cnt; 49 unsigned char inp_buf[MAC_SER_BUF]; 50 51 unsigned out_idx; 52 unsigned out_cnt; 53 unsigned char out_buf[MAC_SER_BUF]; 54 55 char_drv_t *cdrv; 56} mac_ser_t; 57 58 59void mac_ser_init (mac_ser_t *ser); 60void mac_ser_free (mac_ser_t *ser); 61 62void mac_ser_set_scc (mac_ser_t *ser, e8530_t *scc, unsigned chn); 63 64int mac_ser_set_driver (mac_ser_t *ser, const char *name); 65 66int mac_ser_set_file (mac_ser_t *ser, const char *fname); 67 68void mac_ser_process (mac_ser_t *ser); 69 70 71#endif