annotate Scan/UARTConnect/capabilities.kll @ 360:dbefb68411e1

Initial UARTConnect scancode support - Still some issues - Will require some changes to MatrixARM and PartialMap * Currently state information is passed around too frequently * Needs to be reduced to state changes only
author Jacob Alexander <haata@kiibohd.com>
date Sun, 09 Aug 2015 00:20:41 -0700
parents 136e47478441
children fc2c2a1e9615
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
307
ecd2ae35d25c Initial commit for UARTConnect module
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
1 Name = UARTConnectCapabilities;
ecd2ae35d25c Initial commit for UARTConnect module
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
2 Version = 0.1;
ecd2ae35d25c Initial commit for UARTConnect module
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
3 Author = "HaaTa (Jacob Alexander) 2015";
ecd2ae35d25c Initial commit for UARTConnect module
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
4 KLL = 0.3a;
ecd2ae35d25c Initial commit for UARTConnect module
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
5
ecd2ae35d25c Initial commit for UARTConnect module
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
6 # Modified Date
ecd2ae35d25c Initial commit for UARTConnect module
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
7 Date = 2015-03-15;
ecd2ae35d25c Initial commit for UARTConnect module
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
8
ecd2ae35d25c Initial commit for UARTConnect module
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
9 # UART Buffer Size
ecd2ae35d25c Initial commit for UARTConnect module
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
10 # Number of bytes to reserve for each side of UARTConnect
ecd2ae35d25c Initial commit for UARTConnect module
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
11 # For true NKRO support must be at least: <# of Keys> x 3 + 5
ecd2ae35d25c Initial commit for UARTConnect module
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
12 UARTConnectBufSize => UARTConnectBufSize_define;
ecd2ae35d25c Initial commit for UARTConnect module
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
13 UARTConnectBufSize = 128; # MDErgo1 requires at least a 119 byte buffer
ecd2ae35d25c Initial commit for UARTConnect module
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
14
ecd2ae35d25c Initial commit for UARTConnect module
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
15 # UART Speed
ecd2ae35d25c Initial commit for UARTConnect module
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
16 # *NOTE* This must be changed on every device in the chain or else UARTConnect will not work
ecd2ae35d25c Initial commit for UARTConnect module
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
17 # The faster the speed, the lower the latency, but higher chance for an error
ecd2ae35d25c Initial commit for UARTConnect module
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
18 UARTConnectBaud => UARTConnectBaud_define;
ecd2ae35d25c Initial commit for UARTConnect module
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
19 UARTConnectBaudFine => UARTConnectBaudFine_define;
ecd2ae35d25c Initial commit for UARTConnect module
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
20 # Generally, leave BaudFine at zero unless trying to tune the link to an external UART
ecd2ae35d25c Initial commit for UARTConnect module
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
21 # You'll want to look at the specific chip datasheet for the exact equation
ecd2ae35d25c Initial commit for UARTConnect module
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
22 #
ecd2ae35d25c Initial commit for UARTConnect module
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
23 # Example of 115200 Baud using a 48 MHz clock (mk20dx128vlf5)
ecd2ae35d25c Initial commit for UARTConnect module
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
24 # 48 MHz / ( 16 * Baud ) = BDH/L
ecd2ae35d25c Initial commit for UARTConnect module
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
25 # Baud: 115200 -> 48 MHz / ( 16 * 115200 ) = 26.0416667
ecd2ae35d25c Initial commit for UARTConnect module
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
26 # Thus baud setting = 26
ecd2ae35d25c Initial commit for UARTConnect module
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
27 # NOTE: If finer baud adjustment is needed see UARTx_C4 -> BRFA in the datasheet
ecd2ae35d25c Initial commit for UARTConnect module
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
28 # Baud fine setting = 0x02
347
136e47478441 UARTConnect enumeration working!
Jacob Alexander <haata@kiibohd.com>
parents: 307
diff changeset
29 UARTConnectBaud = 1; # 4.5 Mbps @ 72 MHz
136e47478441 UARTConnect enumeration working!
Jacob Alexander <haata@kiibohd.com>
parents: 307
diff changeset
30 UARTConnectBaudFine = 0x0;
307
ecd2ae35d25c Initial commit for UARTConnect module
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
31
347
136e47478441 UARTConnect enumeration working!
Jacob Alexander <haata@kiibohd.com>
parents: 307
diff changeset
32 # Cable Check Command Length
136e47478441 UARTConnect enumeration working!
Jacob Alexander <haata@kiibohd.com>
parents: 307
diff changeset
33 # This defines the length of the cable command
136e47478441 UARTConnect enumeration working!
Jacob Alexander <haata@kiibohd.com>
parents: 307
diff changeset
34 # 0xD2 11010010 is used for each check byte
136e47478441 UARTConnect enumeration working!
Jacob Alexander <haata@kiibohd.com>
parents: 307
diff changeset
35 #
136e47478441 UARTConnect enumeration working!
Jacob Alexander <haata@kiibohd.com>
parents: 307
diff changeset
36 # For example:
136e47478441 UARTConnect enumeration working!
Jacob Alexander <haata@kiibohd.com>
parents: 307
diff changeset
37 # Length: 4
136e47478441 UARTConnect enumeration working!
Jacob Alexander <haata@kiibohd.com>
parents: 307
diff changeset
38 # Args: 0xD2 0xD2 0xD2 0xD2
136e47478441 UARTConnect enumeration working!
Jacob Alexander <haata@kiibohd.com>
parents: 307
diff changeset
39 UARTConnectCableCheckLength => UARTConnectCableCheckLength_define;
136e47478441 UARTConnect enumeration working!
Jacob Alexander <haata@kiibohd.com>
parents: 307
diff changeset
40 UARTConnectCableCheckLength = 2;
136e47478441 UARTConnect enumeration working!
Jacob Alexander <haata@kiibohd.com>
parents: 307
diff changeset
41
360
dbefb68411e1 Initial UARTConnect scancode support
Jacob Alexander <haata@kiibohd.com>
parents: 347
diff changeset
42 # Connect Enable
dbefb68411e1 Initial UARTConnect scancode support
Jacob Alexander <haata@kiibohd.com>
parents: 347
diff changeset
43 # Define used to indicate to non-connect modules that support should be compiled in
dbefb68411e1 Initial UARTConnect scancode support
Jacob Alexander <haata@kiibohd.com>
parents: 347
diff changeset
44 ConnectEnabled => ConnectEnabled_define;
dbefb68411e1 Initial UARTConnect scancode support
Jacob Alexander <haata@kiibohd.com>
parents: 347
diff changeset
45 ConnectEnabled = 1;
dbefb68411e1 Initial UARTConnect scancode support
Jacob Alexander <haata@kiibohd.com>
parents: 347
diff changeset
46