-
Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy pathUART.java
More file actions
56 lines (47 loc) · 1.05 KB
/
UART.java
File metadata and controls
56 lines (47 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/**
* Java Grinder
* Author: Michael Kohn
* Email: mike@mikekohn.net
* Web: https://www.mikekohn.net/
* License: GPL
*
* Copyright 2014-2022 by Michael Kohn
*
*/
package net.mikekohn.java_grinder;
abstract public class UART
{
// These constants assume specific baud rates. This makes the
// generated code cleaner and simpler, but kind of makes it limiting.
// This can be fixed later.
public static final int BAUD_1200 = 0;
public static final int BAUD_2400 = 1;
public static final int BAUD_9600 = 2;
public static final int BAUD_19200 = 3;
public static final int BAUD_38400 = 4;
public static final int BAUD_57600 = 5;
protected UART()
{
}
public static void init(int baud_rate)
{
}
/** send a byte to UART */
public static void send(int c)
{
System.out.println("Sent char " + c);
}
/** read a byte from UART */
public static int read()
{
return 0;
}
public static boolean isDataAvailable()
{
return false;
}
public static boolean isSendReady()
{
return false;
}
}