annotate Scan/UARTConnect/capabilities.kll @ 307:ecd2ae35d25c

Initial commit for UARTConnect module * Keyboard interconnect using two uarts * Supports daisy chain addressing using a master/slave direction communication scheme - Still needs more testing - Functions have been tested alone to be generally working
author Jacob Alexander <haata@kiibohd.com>
date Sun, 15 Mar 2015 16:58:01 -0700
parents
children 136e47478441
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
ecd2ae35d25c Initial commit for UARTConnect module
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
29 UARTConnectBaud = 26;
ecd2ae35d25c Initial commit for UARTConnect module
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
30 UARTConnectBaudFine = 0x02;
ecd2ae35d25c Initial commit for UARTConnect module
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
31