Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
88cf441bbThis file is pinned to the selected release. Download the original to open it in your design tool.
syntax = "proto3";
import "nanopb.proto";
package PB;
message SplitflapState {
message ModuleState {
enum State {
// Keep in sync with splitflap_module_data.h!
NORMAL = 0;
LOOK_FOR_HOME = 1;
SENSOR_ERROR = 2;
PANIC = 3;
STATE_DISABLED = 4;
}
State state = 1;
uint32 flap_index = 2 [(nanopb).int_size = IS_8];
bool moving = 3;
bool home_state = 4;
uint32 count_unexpected_home = 5 [(nanopb).int_size = IS_8];
uint32 count_missed_home = 6 [(nanopb).int_size = IS_8];
}
repeated ModuleState modules = 1 [(nanopb).max_count = 255];
bool loopbacks_ok = 2;
}
message Log {
string msg = 1 [(nanopb).max_length = 255];
}
message Ack {
uint32 nonce = 1;
}
/** Chainlink Base state -- only reported by Chainlink Base firmware, NOT standard Chainlink firmware */
message SupervisorState {
enum State {
UNKNOWN = 0;
STARTING_VERIFY_PSU_OFF = 1;
STARTING_VERIFY_VOLTAGES = 2;
STARTING_ENABLE_CHANNELS = 3;
NORMAL = 4;
FAULT = 5;
}
message PowerChannelState {
float voltage_volts = 1;
float current_amps = 2;
bool on = 3;
}
message FaultInfo {
enum FaultType {
UNKNOWN = 0;
NONE = 1;
INRUSH_CURRENT_NOT_SETTLED = 2;
SPLITFLAP_SHUTDOWN = 3;
OUT_OF_RANGE = 4;
OVER_CURRENT = 5;
UNEXPECTED_POWER = 6;
}
FaultType type = 1;
string msg = 2 [(nanopb).max_length = 255];
uint32 ts_millis = 3;
}
uint32 uptime_millis = 1;
State state = 2;
repeated PowerChannelState power_channels = 3 [(nanopb).max_count = 5];
FaultInfo fault_info = 4;
}
/** Chainlink general state, reported infrequently -- only reported by standard Chainlink firmware, NOT Chainlink Base firmware */
message GeneralState {
uint32 serial_protocol_version = 1 [(nanopb).int_size = IS_16];
uint32 uptime_millis = 2;
message BuildInfo {
string git_hash = 1 [(nanopb).max_length = 90];
string build_date = 2 [(nanopb).max_length = 12];
string build_os = 3 [(nanopb).max_length = 12];
}
BuildInfo build_info = 3;
bytes flap_character_set = 4 [(nanopb).max_size = 80];
// TODO: Flap layout? (share with display code?)
// TODO: Wifi status?
}
message FromSplitflap {
oneof payload {
SplitflapState splitflap_state = 1;
Log log = 2;
Ack ack = 3;
SupervisorState supervisor_state = 4;
GeneralState general_state = 5;
}
}
message SplitflapCommand {
message ModuleCommand {
enum Action {
NO_OP = 0;
GO_TO_FLAP = 1;
RESET_AND_HOME = 2;
INCREASE_OFFSET_TENTH = 90;
INCREASE_OFFSET_HALF = 91;
SET_OFFSET = 92;
}
Action action = 1;
uint32 param = 2 [(nanopb).int_size = IS_8];
}
repeated ModuleCommand modules = 2 [(nanopb).max_count = 255];
bool save_all_offsets = 3;
}
message SplitflapConfig {
message ModuleConfig {
uint32 target_flap_index = 1 [(nanopb).int_size = IS_8];
/**
* Value that triggers a movement upon change. If unused, only changes to target_flap_index
* will trigger a movement. This can be used to trigger a full revolution back to the *same*
* flap index.
*
* NOTE: Must be < 256
*/
uint32 movement_nonce = 2 [(nanopb).int_size = IS_8];
/**
* Value that triggers a reset (clear error counters, re-home) upon change. If unused,
* module will only re-home upon recoverable errors, and error counters will continue
* to increase until overflow.
*
* NOTE: Must be < 256
*/
uint32 reset_nonce = 3 [(nanopb).int_size = IS_8];
}
repeated ModuleConfig modules = 1 [(nanopb).max_count = 255];
}
message RequestState {}
message ToSplitflap {
uint32 nonce = 1;
oneof payload {
SplitflapCommand splitflap_command = 2;
SplitflapConfig splitflap_config = 3;
RequestState request_state = 4;
}
}
/** Non-volatile on-device storage schema */
message PersistentConfiguration {
uint32 version = 1;
uint32 num_flaps = 2;
repeated uint32 module_offset_steps = 3 [(nanopb).max_count = 255, (nanopb).int_size = IS_16];
}