Skip to content

Commit

Permalink
xap specs: 0.3.0: add return/request structs
Browse files Browse the repository at this point in the history
  • Loading branch information
KarlK90 committed Apr 14, 2024
1 parent d0dc18e commit 35c6908
Showing 1 changed file with 119 additions and 176 deletions.
295 changes: 119 additions & 176 deletions xap-specs/specs/xap/xap_0.3.0.hjson
Original file line number Diff line number Diff line change
@@ -1,6 +1,117 @@
{
version: 0.3.0

type_definitions: {
backlight_config: {
name: Lighting Config
description: Config for lighting subsystem
type: struct
struct_length: 3
struct_members: [
{
type: u8
name: enable
},
{
type: u8
name: mode
},
{
type: u8
name: val
},
]
}

rgb_light_config: {
name: RGB Light Config
description: RGB config for RGB lighting subsystem
type: struct
struct_length: 6
struct_members: [
{
type: u8
name: enable
},
{
type: u8
name: mode
},
{
type: u8
name: hue
},
{
type: u8
name: sat
},
{
type: u8
name: val
},
{
type: u8
name: speed
},
]
}

rgb_matrix_config : {
name: RGB Matrix Config
description: RGB config for RGB matrix subsystem
type: struct
struct_length: 7
struct_members: [
{
type: u8
name: enable
},
{
type: u8
name: mode
},
{
type: u8
name: hue
},
{
type: u8
name: sat
},
{
type: u8
name: val
},
{
type: u8
name: speed
},
{
type: u8
name: flags
},
]
}

audio_config: {
name: Audio Config
description: Config for audio subsystem
type: struct
struct_length: 2
struct_members: [
{
type: u8
name: enable
},
{
type: u8
name: clicky_enable
},
]
}
}


routes: {

0x06: {
Expand Down Expand Up @@ -41,45 +152,15 @@
name: Get Config
define: GET_CONFIG
description: Query the current config.
return_type: struct
return_struct_length: 3
return_struct_members: [
{
type: u8
name: enable
},
{
type: u8
name: mode
},
{
type: u8
name: val
},
]
return_type: backlight_config
return_execute: get_backlight_config
}
0x04: {
type: command
name: Set Config
define: SET_CONFIG
description: Set the current config.
request_type: struct
request_struct_length: 3
request_struct_members: [
{
type: u8
name: enable
},
{
type: u8
name: mode
},
{
type: u8
name: val
},
]
request_type: backlight_config
return_execute: set_backlight_config
}
0x05: {
Expand Down Expand Up @@ -127,69 +208,15 @@
name: Get Config
define: GET_CONFIG
description: Query the current config.
return_type: struct
return_struct_length: 6
return_struct_members: [
{
type: u8
name: enable
},
{
type: u8
name: mode
},
{
type: u8
name: hue
},
{
type: u8
name: sat
},
{
type: u8
name: val
},
{
type: u8
name: speed
},
]
return_type: rgb_light_config
return_execute: get_rgblight_config
}
0x04: {
type: command
name: Set Config
define: SET_CONFIG
description: Set the current config.
request_type: struct
request_struct_length: 6
request_struct_members: [
{
type: u8
name: enable
},
{
type: u8
name: mode
},
{
type: u8
name: hue
},
{
type: u8
name: sat
},
{
type: u8
name: val
},
{
type: u8
name: speed
},
]
request_type: rgb_light_config
return_execute: set_rgblight_config
}
0x05: {
Expand Down Expand Up @@ -237,77 +264,15 @@
name: Get Config
define: GET_CONFIG
description: Query the current config.
return_type: struct
return_struct_length: 7
return_struct_members: [
{
type: u8
name: enable
},
{
type: u8
name: mode
},
{
type: u8
name: hue
},
{
type: u8
name: sat
},
{
type: u8
name: val
},
{
type: u8
name: speed
},
{
type: u8
name: flags
},
]
return_type: rgb_matrix_config
return_execute: get_rgb_matrix_config
}
0x04: {
type: command
name: Set Config
define: SET_CONFIG
description: Set the current config.
request_type: struct
request_struct_length: 7
request_struct_members: [
{
type: u8
name: enable
},
{
type: u8
name: mode
},
{
type: u8
name: hue
},
{
type: u8
name: sat
},
{
type: u8
name: val
},
{
type: u8
name: speed
},
{
type: u8
name: flags
},
]
request_type: rgb_matrix_config
return_execute: set_rgb_matrix_config
}
0x05: {
Expand Down Expand Up @@ -350,37 +315,15 @@
name: Get Config
define: GET_CONFIG
description: Query the current config.
return_type: struct
return_struct_length: 2
return_struct_members: [
{
type: u8
name: enable
},
{
type: u8
name: clicky_enable
},
]
return_type: audio_config
return_execute: get_audio_config
}
0x04: {
type: command
name: Set Config
define: SET_CONFIG
description: Set the current config.
request_type: struct
request_struct_length: 2
request_struct_members: [
{
type: u8
name: enable
},
{
type: u8
name: clicky_enable
},
]
request_type: audio_config
return_execute: set_audio_config
}
0x05: {
Expand Down

0 comments on commit 35c6908

Please sign in to comment.