OXYGENHUB
◆ riscv-1 x16-emulator / src / serial.h
531 B · Objective-C · last changed chore(): initial commit 15 days ago source blame history raw
03a3459e Andy McCall 1
// Commander X16 Emulator
2
// Copyright (c) 2022 Michael Steil
3
// All rights reserved. License: 2-clause BSD
4
5
#ifndef SERIAL_H
6
#define SERIAL_H
7
8
#include <stdint.h>
9
10
#define SERIAL_ATNIN_MASK   (1<<3)
11
#define SERIAL_CLOCKIN_MASK (1<<4)
12
#define SERIAL_DATAIN_MASK  (1<<5)
13
14
typedef struct {
15
	struct {
16
		int atn;
17
		int clk;
18
		int data;
19
	} in;
20
	struct {
21
		int clk;
22
		int data;
23
	} out;
24
} serial_port_t;
25
26
extern serial_port_t serial_port;
27
28
void serial_step(int clocks);
29
30
bool serial_port_read_clk();
31
bool serial_port_read_data();
32
33
#endif