1
0
mirror of https://github.com/jscrane/r65emu.git synced 2024-07-20 12:28:59 +00:00
r65emu/acia.h

41 lines
1.2 KiB
C
Raw Normal View History

2014-11-10 14:16:45 +00:00
#ifndef __ACIA_H__
#define __ACIA_H__
2014-10-18 11:33:48 +00:00
struct acia {
2014-11-10 14:16:45 +00:00
// status bits returned by operator byte
//
static const byte rdrf = 1 << 0;
static const byte tdre = 1 << 1;
static const byte dcd = 1 << 2;
static const byte cts = 1 << 3;
static const byte fe = 1 << 4;
static const byte ovrn = 1 << 5;
static const byte pc = 1 << 6;
static const byte irq = 1 << 7;
2014-10-18 11:33:48 +00:00
2014-11-10 14:16:45 +00:00
// control operations (four combinable groups)
//
static const byte cd1 = 0x00; // divide by 1
static const byte cd16 = 0x01; // divide by 16
static const byte cd64 = 0x02; // divide by 64
static const byte reset = 0x03; // master reset
2014-10-18 11:33:48 +00:00
2014-11-10 14:16:45 +00:00
static const byte ws7e2 = 0 << 2; // parity
static const byte ws7o2 = 1 << 2;
static const byte ws7e1 = 2 << 2;
static const byte ws7o1 = 3 << 2;
static const byte ws8n2 = 4 << 2;
static const byte ws8n1 = 5 << 2;
static const byte ws8e1 = 6 << 2;
static const byte ws8o1 = 7 << 2;
2014-10-18 11:33:48 +00:00
2018-08-10 10:13:45 +00:00
static const byte lrts_dti = 0 << 5; // /rts, disable trans irq
2014-11-10 14:16:45 +00:00
static const byte lrts_eti = 1 << 5; // /rts, enable
static const byte hrts_dti = 2 << 5; // rts, disable
static const byte lrts_dti_brk = 3 << 5; // /rts, disable, send brk
2014-10-18 11:33:48 +00:00
2014-11-10 14:16:45 +00:00
static const byte eri = 1 << 7; // enable receive interrupt
2014-10-18 11:33:48 +00:00
};
2014-11-10 14:16:45 +00:00
#endif