55#define VIA_REG_ORB_IRB 0x0
56#define VIA_REG_ORA_IRA 0x1
57#define VIA_REG_DDRB 0x2
58#define VIA_REG_DDRA 0x3
59#define VIA_REG_T1_C_LO 0x4
60#define VIA_REG_T1_C_HI 0x5
61#define VIA_REG_T1_L_LO 0x6
62#define VIA_REG_T1_L_HI 0x7
63#define VIA_REG_T2_C_LO 0x8
64#define VIA_REG_T2_C_HI 0x9
66#define VIA_REG_ACR 0xb
67#define VIA_REG_PCR 0xc
68#define VIA_REG_IFR 0xd
69#define VIA_REG_IER 0xe
70#define VIA_REG_ORA_IRA_NH 0xf
73#define VIA_IER_CA2 0x01
74#define VIA_IER_CA1 0x02
75#define VIA_IER_SR 0x04
76#define VIA_IER_CB2 0x08
77#define VIA_IER_CB1 0x10
78#define VIA_IER_T2 0x20
79#define VIA_IER_T1 0x40
80#define VIA_IER_CTRL 0x80
83#define VIA_ACR_T2_COUNTPULSES 0x20
84#define VIA_ACR_T1_FREERUN 0x40
85#define VIA_ACR_T1_OUTENABLE 0x80
102static const char * VIAREG2STR[] = {
"ORB_IRB",
"ORA_IRA",
"DDRB",
"DDRA",
"T1_C_LO",
"T1_C_HI",
"T1_L_LO",
"T1_L_HI",
"T2_C_LO",
"T2_C_HI",
"SR",
"ACR",
"PCR",
"IFR",
"IER",
"ORA_IRA_NH" };
118 void setCallbacks(
void * context, PortInputCallback portIn, PortOutputCallback portOut) {
126 void writeReg(
int reg,
int value);
127 int readReg(
int reg);
129 bool tick(
int cycles);
132 uint8_t PA() {
return m_PA; }
133 void setPA(
int value);
134 void setBitPA(
int bit,
bool value);
135 void openBitPA(
int bit);
138 uint8_t PB() {
return m_PB; }
139 void setPB(
int value);
140 void setBitPB(
int bit,
bool value);
141 void openBitPB(
int bit);
143 uint8_t CA1() {
return m_CA1; }
144 void setCA1(
int value) { m_CA1_prev = m_CA1; m_CA1 = value; }
146 uint8_t CA2() {
return m_CA2; }
147 void setCA2(
int value) { m_CA2_prev = m_CA2; m_CA2 = value; }
149 uint8_t CB1() {
return m_CB1; }
150 void setCB1(
int value) { m_CB1_prev = m_CB1; m_CB1 = value; }
152 uint8_t CB2() {
return m_CB2; }
153 void setCB2(
int value) { m_CB2_prev = m_CB2; m_CB2 = value; }
155 uint8_t DDRA() {
return m_DDRA; }
157 uint8_t DDRB() {
return m_DDRB; }
159 uint8_t tag() {
return m_tag; }
168 uint16_t m_timer1Latch;
170 uint8_t m_timer2Latch;
171 bool m_timer1Triggered;
172 bool m_timer2Triggered;
204 PortInputCallback m_portIn;
205 PortOutputCallback m_portOut;
This file is the all in one include file. Application can just include this file to use FabGL library...