Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4563d26a5c | ||
|
|
0b120a3286 | ||
|
|
d4200524d7 | ||
|
|
ef34094004 | ||
|
|
d2fd7bc613 |
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
|
||||
The format is loosely based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
||||
and this project adheres to the [UHK Versioning](VERSIONING.md) conventions.
|
||||
|
||||
## [2.1.0] - 2017-10-13
|
||||
|
||||
Data Model: 1.0.0 (unchanged) | USB Protocol: 1.2.0 (minor bump) | Slave Protocol: 2.1.0 (minor bump)
|
||||
|
||||
- Add jumpToSlaveBootloader USB and slave protocol command. `USBPROTOCOL:MINOR` `SLAVEPROTOCOL:MINOR`
|
||||
- Fix generic HID descriptor enumeration error.
|
||||
|
||||
## [2.0.0] - 2017-10-10
|
||||
|
||||
Data Model: 1.0.0 (unchanged) | USB Protocol: 1.1.0 (minor bump) | Slave Protocol: 2.0.0 (major bump)
|
||||
|
||||
@@ -14,6 +14,8 @@ The UHK USB protocol is used by the UHK to interact with the host system via USB
|
||||
* The minor number is bumped upon an extension of the protocol, such as adding a new protocol command ID, or utilizing a previously unutilized byte within the payload.
|
||||
* The patch number is bumped upon a protocol related implementation fix, for example adding a new validation check.
|
||||
|
||||
In order for a host application to communicate with the UHK, its major USB protocol version must match, and its minor USB protocol version must be less or equal.
|
||||
|
||||
## Slave protocol version
|
||||
|
||||
The Slave protocol is the I2C based application protocol of the UHK via which the master module (right keyboard half), and the slave modules (left keyboard half, left add-on, right add-on) communicate.
|
||||
@@ -22,6 +24,8 @@ The Slave protocol is the I2C based application protocol of the UHK via which th
|
||||
* The minor number is bumped upon an extension of the protocol, such as adding a new protocol command ID, or extending the payload.
|
||||
* The patch number is bumped upon a protocol related implementation fix, for example adding a new validation check.
|
||||
|
||||
In order for the master module to communicate with the slave modules, its major slave protocol version must match, and its minor slave protocol version must be less or equal.
|
||||
|
||||
## Data model version
|
||||
|
||||
The data model is the binary serialization format of the user configuration which includes keymaps, macros, and every other configuration item.
|
||||
@@ -30,6 +34,8 @@ The data model is the binary serialization format of the user configuration whic
|
||||
* The minor number is bumped upon an extension of the data model, such as using a previously unutilized interval of a type number to add a new item type.
|
||||
* The patch number is bumped upon a data model related implementation fix, for example adding a new validation check.
|
||||
|
||||
In order for a host application to parse the configuration of the UHK, its major data model version must match, and its minor data model version must be less or equal.
|
||||
|
||||
For the sake of completeness, it's worth mentioning that not only the (user) data model exists, but the hardware data model too which contains hardware-specific configuration items, such as ANSI vs ISO keyboard type. The hardware data model also has a version number field, but it's not expected to ever change so for the sake of simplicity, it's not included into changelog releases. The hardware configuration version is 1.0.0
|
||||
|
||||
## Firmware version
|
||||
|
||||
Submodule lib/bootloader updated: 74a37a8d9e...b754ecbe68
@@ -11,8 +11,8 @@
|
||||
"bugs": {
|
||||
"url": "https://github.com/UltimateHackingKeyboard/firmware/issues"
|
||||
},
|
||||
"version": "2.0.0",
|
||||
"version": "2.1.0",
|
||||
"dataModelVersion": "1.0.0",
|
||||
"usbProtocolVersion": "1.1.0",
|
||||
"slaveProtocolVersion": "2.0.0"
|
||||
"usbProtocolVersion": "1.2.0",
|
||||
"slaveProtocolVersion": "2.1.0"
|
||||
}
|
||||
|
||||
@@ -74,6 +74,7 @@
|
||||
<listOptionValue builtIn="false" value="../../../src/ksdk_usb"/>
|
||||
<listOptionValue builtIn="false" value="../../../src/buspal"/>
|
||||
<listOptionValue builtIn="false" value="../../../src/buspal/bm_usb"/>
|
||||
<listOptionValue builtIn="false" value="../../../../lib/bootloader/src"/>
|
||||
<listOptionValue builtIn="false" value="../../../../lib/KSDK_2.0_MK22FN512xxx12/middleware/usb_1.0.0"/>
|
||||
<listOptionValue builtIn="false" value="../../../../lib/KSDK_2.0_MK22FN512xxx12/middleware/usb_1.0.0/osa"/>
|
||||
<listOptionValue builtIn="false" value="../../../../lib/KSDK_2.0_MK22FN512xxx12/middleware/usb_1.0.0/include"/>
|
||||
@@ -214,6 +215,7 @@
|
||||
<listOptionValue builtIn="false" value="../../../src/ksdk_usb"/>
|
||||
<listOptionValue builtIn="false" value="../../../src/buspal"/>
|
||||
<listOptionValue builtIn="false" value="../../../src/buspal/bm_usb"/>
|
||||
<listOptionValue builtIn="false" value="../../../../lib/bootloader/src"/>
|
||||
<listOptionValue builtIn="false" value="../../../../lib/KSDK_2.0_MK22FN512xxx12/middleware/usb_1.0.0"/>
|
||||
<listOptionValue builtIn="false" value="../../../../lib/KSDK_2.0_MK22FN512xxx12/middleware/usb_1.0.0/osa"/>
|
||||
<listOptionValue builtIn="false" value="../../../../lib/KSDK_2.0_MK22FN512xxx12/middleware/usb_1.0.0/include"/>
|
||||
@@ -356,6 +358,7 @@
|
||||
<listOptionValue builtIn="false" value="../../../src/ksdk_usb"/>
|
||||
<listOptionValue builtIn="false" value="../../../src/buspal"/>
|
||||
<listOptionValue builtIn="false" value="../../../src/buspal/bm_usb"/>
|
||||
<listOptionValue builtIn="false" value="../../../../lib/bootloader/src"/>
|
||||
<listOptionValue builtIn="false" value="../../../../lib/KSDK_2.0_MK22FN512xxx12/middleware/usb_1.0.0"/>
|
||||
<listOptionValue builtIn="false" value="../../../../lib/KSDK_2.0_MK22FN512xxx12/middleware/usb_1.0.0/osa"/>
|
||||
<listOptionValue builtIn="false" value="../../../../lib/KSDK_2.0_MK22FN512xxx12/middleware/usb_1.0.0/include"/>
|
||||
@@ -456,11 +459,11 @@
|
||||
<resource resourceType="PROJECT" workspacePath="/uhk-right"/>
|
||||
</configuration>
|
||||
<configuration configurationName="v6-debug-srec"/>
|
||||
<configuration configurationName="v7-debug"/>
|
||||
<configuration configurationName="v6-release"/>
|
||||
<configuration configurationName="release">
|
||||
<resource resourceType="PROJECT" workspacePath="/uhk-right"/>
|
||||
</configuration>
|
||||
<configuration configurationName="v6-release"/>
|
||||
<configuration configurationName="v7-debug"/>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
|
||||
<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
|
||||
|
||||
@@ -30,6 +30,11 @@
|
||||
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
|
||||
</natures>
|
||||
<linkedResources>
|
||||
<link>
|
||||
<name>bootloader-shared</name>
|
||||
<type>2</type>
|
||||
<locationURI>virtual:/virtual</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>drivers</name>
|
||||
<type>2</type>
|
||||
@@ -60,6 +65,16 @@
|
||||
<type>2</type>
|
||||
<locationURI>virtual:/virtual</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>bootloader-shared/wormhole.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-3-PROJECT_LOC/lib/bootloader/src/bootloader/src/wormhole.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>bootloader-shared/wormhole.h</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-3-PROJECT_LOC/lib/bootloader/src/bootloader/wormhole.h</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>drivers/fsl_adc16.c</name>
|
||||
<type>1</type>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include "bus_pal_hardware.h"
|
||||
#include "bootloader_config.h"
|
||||
#include "command.h"
|
||||
#include "wormhole.h"
|
||||
#include "bootloader/wormhole.h"
|
||||
#include "eeprom.h"
|
||||
|
||||
key_matrix_t KeyMatrix = {
|
||||
|
||||
@@ -174,6 +174,19 @@ status_t UhkModuleSlaveDriver_Update(uint8_t uhkModuleDriverId)
|
||||
BoolBitsToBytes(rxMessage->data, CurrentKeyStates[slotId], uhkModuleState->features.keyCount);
|
||||
}
|
||||
status = kStatus_Uhk_NoTransfer;
|
||||
*uhkModulePhase = UhkModulePhase_JumpToBootloader;
|
||||
break;
|
||||
|
||||
// Jump to bootloader
|
||||
case UhkModulePhase_JumpToBootloader:
|
||||
if (uhkModuleState->jumpToBootloader) {
|
||||
txMessage.data[0] = SlaveCommand_JumpToBootloader;
|
||||
txMessage.length = 1;
|
||||
status = tx(i2cAddress);
|
||||
uhkModuleState->jumpToBootloader = false;
|
||||
} else {
|
||||
status = kStatus_Uhk_NoTransfer;
|
||||
}
|
||||
*uhkModulePhase = UhkModulePhase_SetTestLed;
|
||||
break;
|
||||
|
||||
|
||||
@@ -47,8 +47,9 @@
|
||||
UhkModulePhase_ProcessKeystates,
|
||||
|
||||
// Misc phases
|
||||
UhkModulePhase_SetLedPwmBrightness,
|
||||
UhkModulePhase_JumpToBootloader,
|
||||
UhkModulePhase_SetTestLed,
|
||||
UhkModulePhase_SetLedPwmBrightness,
|
||||
|
||||
} uhk_module_phase_t;
|
||||
|
||||
@@ -67,6 +68,7 @@
|
||||
uint8_t firmwareI2cAddress;
|
||||
uint8_t bootloaderI2cAddress;
|
||||
uhk_module_features_t features;
|
||||
bool jumpToBootloader;
|
||||
} uhk_module_state_t;
|
||||
|
||||
typedef struct {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "usb_descriptors/usb_descriptor_strings.h"
|
||||
#include "bootloader_config.h"
|
||||
#include "bus_pal_hardware.h"
|
||||
#include "wormhole.h"
|
||||
#include "bootloader/wormhole.h"
|
||||
|
||||
static usb_status_t UsbDeviceCallback(usb_device_handle handle, uint32_t event, void *param);
|
||||
usb_composite_device_t UsbCompositeDevice;
|
||||
|
||||
@@ -12,6 +12,6 @@
|
||||
|
||||
// Variables:
|
||||
|
||||
uint8_t UsbGenericHidReportDescriptor[USB_GENERIC_HID_REPORT_DESCRIPTOR_LENGTH];
|
||||
extern uint8_t UsbGenericHidReportDescriptor[USB_GENERIC_HID_REPORT_DESCRIPTOR_LENGTH];
|
||||
|
||||
#endif
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include "led_pwm.h"
|
||||
#include "slave_scheduler.h"
|
||||
#include "slave_drivers/uhk_module_driver.h"
|
||||
#include "wormhole.h"
|
||||
#include "bootloader/wormhole.h"
|
||||
#include "peripherals/adc.h"
|
||||
#include "eeprom.h"
|
||||
#include "keymaps.h"
|
||||
@@ -265,6 +265,18 @@ void getDebugInfo(void)
|
||||
GenericHidOutBuffer[8] = (ticks >> 56) & 0xff;
|
||||
*/}
|
||||
|
||||
void jumpToSlaveBootloader(void)
|
||||
{
|
||||
uint8_t uhkModuleDriverId = GenericHidInBuffer[1];
|
||||
|
||||
if (uhkModuleDriverId >= UHK_MODULE_MAX_COUNT) {
|
||||
setError(JumpToBootloaderError_InvalidModuleDriverId);
|
||||
return;
|
||||
}
|
||||
|
||||
UhkModuleStates[uhkModuleDriverId].jumpToBootloader = true;
|
||||
}
|
||||
|
||||
// The main protocol handler function
|
||||
|
||||
void UsbProtocolHandler(void)
|
||||
@@ -316,6 +328,9 @@ void UsbProtocolHandler(void)
|
||||
case UsbCommand_GetDebugInfo:
|
||||
getDebugInfo();
|
||||
break;
|
||||
case UsbCommand_JumpToSlaveBootloader:
|
||||
jumpToSlaveBootloader();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
UsbCommand_ReadUserConfiguration = 15,
|
||||
UsbCommand_GetKeyboardState = 16,
|
||||
UsbCommand_GetDebugInfo = 17,
|
||||
UsbCommand_JumpToSlaveBootloader = 18,
|
||||
} usb_command_t;
|
||||
|
||||
typedef enum {
|
||||
@@ -35,6 +36,10 @@
|
||||
ConfigTransferResponse_BufferOutOfBounds = 2,
|
||||
} config_transfer_response_t;
|
||||
|
||||
typedef enum {
|
||||
JumpToBootloaderError_InvalidModuleDriverId = 1,
|
||||
} jump_to_bootloader_error_t;
|
||||
|
||||
// Functions:
|
||||
|
||||
void UsbProtocolHandler(void);
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
#include "wormhole.h"
|
||||
|
||||
wormhole_t ATTR_NO_INIT Wormhole;
|
||||
@@ -1,31 +0,0 @@
|
||||
#ifndef __WORMHOLE_H__
|
||||
#define __WORMHOLE_H__
|
||||
|
||||
// Includes:
|
||||
|
||||
#include <stdint.h>
|
||||
#include "attributes.h"
|
||||
|
||||
// Macros:
|
||||
|
||||
#define WORMHOLE_MAGIC_NUMBER 0x3b04cd9e94521f9a
|
||||
|
||||
// Typedefs:
|
||||
|
||||
typedef enum {
|
||||
EnumerationMode_Bootloader,
|
||||
EnumerationMode_NormalKeyboard,
|
||||
EnumerationMode_CompatibleKeyboard,
|
||||
EnumerationMode_BusPal,
|
||||
} enumeration_mode_t;
|
||||
|
||||
typedef struct {
|
||||
uint64_t magicNumber;
|
||||
uint8_t enumerationMode;
|
||||
} wormhole_t;
|
||||
|
||||
// Variables:
|
||||
|
||||
extern wormhole_t ATTR_NO_INIT Wormhole;
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user