KM3NeT CLB
2.0
KM3NeT CLB v2 Embedded Software
|
Defines all remote commands. More...
Go to the source code of this file.
Macros | |
#define | MSG_GROUP_SHIFT 6 |
Group bit shift. | |
#define | MSG_TYPE(GROUP, ID) ( ( ( GROUP ) << ( MSG_GROUP_SHIFT ) ) | ( ID ) ) |
Creates a message type. | |
#define | MSG_EVENTS MSG_SYS_EVENTS |
List containing all events. | |
#define | MSG_COMMANDS |
List containing all commands. More... | |
Debug Group | |
Defines the debug commands. These commands are only used for debugging and should not be used during normal operation. | |
#define | GROUP_DEBUG 0x01 |
debugging commands group identifier | |
#define | MSG_DBG_BUS_READ MSG_TYPE(GROUP_DEBUG, 0x01) |
Read & Write Bus commands. | |
#define | MSG_DBG_BUS_WRITE MSG_TYPE(GROUP_DEBUG, 0x02) |
#define | MSG_DBG_BUS_RMW MSG_TYPE(GROUP_DEBUG, 0x03) |
#define | MSG_DBG_I2C_READ MSG_TYPE(GROUP_DEBUG, 0x04) |
Read & Write I2C (not implemented yet) | |
#define | MSG_DBG_I2C_WRITE MSG_TYPE(GROUP_DEBUG, 0x05) |
#define | MSG_DBG_UART_TX MSG_TYPE(GROUP_DEBUG, 0x06) |
#define | MSG_DBG_UART_RX MSG_TYPE(GROUP_DEBUG, 0x07) |
#define | MSG_DBG_FLASH_READ MSG_TYPE(GROUP_DEBUG, 0x08) |
#define | MSG_DBG_RXPKTLOG_READ MSG_TYPE(GROUP_DEBUG, 0x09) |
#define | MSG_DBG_RXPKTLOG_RESET MSG_TYPE(GROUP_DEBUG, 0x0A) |
#define | MSG_DBG_COMMANDS |
Define all messages in a list, including function prototype suffix. More... | |
System Group | |
Defines the system group commands. System group commands are not specific to the functionality of the software, but general. For example, version information is generic, system load values etc. | |
#define | GROUP_SYS 0x02 |
#define | MSG_SYS_PING MSG_TYPE(GROUP_SYS, 0x01) |
Ping command. | |
#define | MSG_SYS_DATEREV MSG_TYPE(GROUP_SYS, 0x02) |
Date and Revision Information. | |
#define | MSG_SYS_EVT_TARGET MSG_TYPE(GROUP_SYS, 0x03) |
Sets the sender as the event target, after this all events, will be send to this target. | |
#define | MSG_SYS_RESET MSG_TYPE(GROUP_SYS, 0x04) |
Resets the board. | |
#define | MSG_SYS_UPDATE_START MSG_TYPE(GROUP_SYS, 0x05) |
Command required for starting an update. | |
#define | EVT_SYS_UPDATE MSG_TYPE(GROUP_SYS, 0x06) |
Event emitted to update a part of a firmware image (broadcast) | |
#define | MSG_SYS_UPDATE MSG_TYPE(GROUP_SYS, 0x06) |
Command to update a part of a firmware image(unicast) | |
#define | MSG_SYS_UPDATE_END MSG_TYPE(GROUP_SYS, 0x07) |
Command to end the update procedure. | |
#define | MSG_SYS_VERIFY MSG_TYPE(GROUP_SYS, 0x08) |
Command to verify image data on the flash. | |
#define | MSG_SYS_BOOT MSG_TYPE(GROUP_SYS, 0x09) |
Command to issue boot of specific image. | |
#define | MSG_SYS_GOLDEN_STOP MSG_TYPE(GROUP_SYS, 0x0A) |
Command to stop the golden image for proceeding and booting the main image. More... | |
#define | MSG_SYS_GOLDEN_UNLOCK MSG_TYPE(GROUP_SYS, 0x0B) |
Unlocks the golden image for writing. | |
#define | MSG_SYS_LOG_GET MSG_TYPE(GROUP_SYS, 0x0C) |
Get the last live log lines. | |
#define | MSG_SYS_P_LOG_GET MSG_TYPE(GROUP_SYS, 0x0D) |
Get the last persistent log lines. More... | |
#define | MSG_SYS_IMG_GET MSG_TYPE(GROUP_SYS, 0x0E) |
Returns information on the images in the current CLB. More... | |
#define | MSG_SYS_COREDUMP_CLR MSG_TYPE(GROUP_SYS, 0x0F) |
Command to issue boot of specific image. | |
#define | MSG_SYS_CONTUN_INIT MSG_TYPE(GROUP_SYS, 0x10) |
Initialize/uninitialize console tunnel. More... | |
#define | MSG_SYS_CONTUN_SEND MSG_TYPE(GROUP_SYS, 0x11) |
Send one or more characters to a console. More... | |
#define | EVT_SYS_CONTUN_RECV MSG_TYPE(GROUP_SYS, 0x12) |
Event when character data is available on any of the consoles. More... | |
#define | MSG_SYS_RT_CONFIG MSG_TYPE(GROUP_SYS, 0x18) |
Gets/Sets the runtime configuration. More... | |
#define | MSG_SYS_COMMANDS |
Define all messages in a list, including function prototype suffix. More... | |
#define | MSG_SYS_EVENTS |
Define all events which can be received. More... | |
CLB Group | |
Defines commands in the CLB group. The CLB group contains commands which are not tied to a specific peripheral. For example, state change commands, configuration commands, or generic status requests should be in this group. | |
#define | GROUP_CLB 0x03 |
#define | MSG_CLB_GET_STATE MSG_TYPE(GROUP_CLB, 0x01) |
#define | MSG_CLB_EVENT MSG_TYPE(GROUP_CLB, 0x02) |
#define | EVT_CLB_STATE MSG_TYPE(GROUP_CLB, 0x03) |
#define | EVT_CLB_UPDATE MSG_TYPE(GROUP_CLB, 0x04) |
#define | MSG_CLB_ACTIVATE_CFG MSG_TYPE(GROUP_CLB, 0x05) |
#define | MSG_CLB_STORE_CFG MSG_TYPE(GROUP_CLB, 0x06) |
#define | MSG_CLB_GET_VARS MSG_TYPE(GROUP_CLB, 0x07) |
#define | MSG_CLB_SET_VARS MSG_TYPE(GROUP_CLB, 0x08) |
#define | MSG_CLB_SUB_VARS MSG_TYPE(GROUP_CLB, 0x09) |
#define | MSG_CLB_UNSUB_VARS MSG_TYPE(GROUP_CLB, 0x10) |
#define | EVT_CLB_UPDATE_VARS MSG_TYPE(GROUP_CLB, 0x11) |
#define | MSG_CLB_EXT_UPDATE MSG_TYPE(GROUP_CLB, 0x12) |
#define | MSG_CLB_CLR_ERR_STATE MSG_TYPE(GROUP_CLB, 0x13) |
Clear the error state. More... | |
#define | MSG_CLB_SUB_VARSRATE MSG_TYPE(GROUP_CLB, 0x14) |
Subscribes to one or more variables with a specific rate. More... | |
#define | MSG_CLB_COMMANDS |
Define all messages in a list, including function prototype suffix. More... | |
Network Group | |
Defines all commands for network configuration. | |
#define | GROUP_NET 0x04 |
#define | MSG_NET_MUX_DEST MSG_TYPE(GROUP_NET, 0x01) |
#define | MSG_NET_WL_TUNE_INFO MSG_TYPE(GROUP_NET, 0x02) |
Gets wavelength tuning info. More... | |
#define | MSG_NET_WL_TUNE_SET MSG_TYPE(GROUP_NET, 0x03) |
Set wavelength tuning word. More... | |
#define | MSG_NET_WL_TUNE_ACK MSG_TYPE(GROUP_NET, 0x04) |
Send ACK, to confirm tuning. More... | |
#define | MSG_NET_COMMANDS |
Define all messages in a list, including function prototype suffix. More... | |
OPT Group | |
#define | GROUP_OPT 0x05 |
#define | MSG_OPT_COMMANDS |
Define all messages in a list, including function prototype suffix. More... | |
Acoustics Group | |
Description not yet written | |
#define | GROUP_ACS 0x06 |
#define | MSG_ACS_COMMANDS |
Define all messages in a list, including function prototype suffix. More... | |
Instrumetnation group | |
This group contains peripherals that do not require a lot of commands. | |
#define | GROUP_INS 0x08 |
#define | MSG_INS_AHRS_SET_REG MSG_TYPE(GROUP_INS, 0x01) |
#define | MSG_INS_AHRS_GET_REG MSG_TYPE(GROUP_INS, 0x02) |
#define | MSG_INS_AHRS_GET_REG_EX MSG_TYPE(GROUP_INS, 0x03) |
#define | MSG_INS_COMMANDS |
Define all messages in a list, including function prototype suffix. More... | |
#define | GROUP_BSE 0x07 |
#define | MSG_BSE_CONFIGURE MSG_TYPE(GROUP_BSE, 0x01) |
#define | MSG_BSE_RESET MSG_TYPE(GROUP_BSE, 0x02) |
#define | MSG_BSE_EDFA_DBG_CMD MSG_TYPE(GROUP_BSE, 0x11) |
#define | MSG_BSE_EDFA_DBG_CMDRPLY MSG_TYPE(GROUP_BSE, 0x12) |
#define | MSG_BSE_BPS_DBG_CMDRPLY MSG_TYPE(GROUP_BSE, 0x13) |
BSP Debug Command/Reply. More... | |
#define | MSG_BSE_COMMANDS |
Define all messages in a list, including function prototype suffix. More... | |
Defines all remote commands.
A command belongs to a group. Each group has a unique identifier. To add a command first find the correct group, and then add your command ID by defining a new type identifier:
#define MSG_{group_name}_{cmd_name} MSG_TYPE({group_id}, {#id})
For example, the reset command would be in the system group, with ID is defined as follows:
Then a link must be made to the actual command. This can be done with the MSG_CMD({type}, {function suffix}) macro, which should be inside the MSG_<group>_COMMANDS list:
Now the message module (msg.h) will generate a function prototype:
You must then fill in the body of this function. Please see msg.h for more details.
Definition in file cfg_msg.h.
#define EVT_SYS_CONTUN_RECV MSG_TYPE(GROUP_SYS, 0x12) |
#define MSG_ACS_COMMANDS |
#define MSG_BSE_BPS_DBG_CMDRPLY MSG_TYPE(GROUP_BSE, 0x13) |
BSP Debug Command/Reply.
Command: u8 cmdCode BPS command code u8 rplCode Expected BPS reply code u8 rplNData Expected number of returned bytes u8 cmdNData Number of command bytes u8[cmdNData] cmdData Command data
Reply: u8 rplNData Number of returned bytes u8[rplNData] rplData Reply data u8 cmdCode* Command which caused the reply u8 rplCode* Reply code
#define MSG_BSE_COMMANDS |
Define all messages in a list, including function prototype suffix.
#define MSG_CLB_CLR_ERR_STATE MSG_TYPE(GROUP_CLB, 0x13) |
#define MSG_CLB_COMMANDS |
Define all messages in a list, including function prototype suffix.
#define MSG_CLB_SUB_VARSRATE MSG_TYPE(GROUP_CLB, 0x14) |
#define MSG_COMMANDS |
List containing all commands.
#define MSG_DBG_COMMANDS |
Define all messages in a list, including function prototype suffix.
#define MSG_INS_COMMANDS |
Define all messages in a list, including function prototype suffix.
#define MSG_NET_COMMANDS |
Define all messages in a list, including function prototype suffix.
#define MSG_NET_WL_TUNE_ACK MSG_TYPE(GROUP_NET, 0x04) |
#define MSG_NET_WL_TUNE_INFO MSG_TYPE(GROUP_NET, 0x02) |
Gets wavelength tuning info.
REQUEST:
Emtpy
RESPONSE:
Off Len Type Description
0 1 U8 WL Tuning vendor procedure where 0 - Not supported 1 - EOPTOLINK procedure (Tuning word must be -80 to 80) 2 - OESolutions procedure (Tuning word must be 0-65536) 3..255 - Reserved 1 1 U8 Status bit field Bits 2..0: State (enumeration) 0 - Idle 1 - Busy 2 - Waiting for ACK 7 - Reserved Bit 3 : Last ACK failed, laser reset 2 2 U16 Value from the Optional Laser Wavelength (SFP+ Addr A2, 106-107) or 0x0000 if not implemented. 4 4 I32 Current Tuning word value (must in in range of procedure)
#define MSG_NET_WL_TUNE_SET MSG_TYPE(GROUP_NET, 0x03) |
#define MSG_OPT_COMMANDS |
#define MSG_SYS_COMMANDS |
Define all messages in a list, including function prototype suffix.
#define MSG_SYS_CONTUN_INIT MSG_TYPE(GROUP_SYS, 0x10) |
Initialize/uninitialize console tunnel.
When provided with a 32-bit integer + 16 bit port number tunneling is configured. If the both numbers are zero, the sender IP and PORT are used.
When provided with no arguments tunneling is uninitialized. It is custom to do this before disconnecting. Otherwise stale packets will be send.
#define MSG_SYS_CONTUN_SEND MSG_TYPE(GROUP_SYS, 0x11) |
#define MSG_SYS_EVENTS |
Define all events which can be received.
#define MSG_SYS_GOLDEN_STOP MSG_TYPE(GROUP_SYS, 0x0A) |
#define MSG_SYS_IMG_GET MSG_TYPE(GROUP_SYS, 0x0E) |
Returns information on the images in the current CLB.
Off Len Type Description 0 1 U8 Number of positions, N, let n = { 0 .. N-1 } 9n + 1 4 U32 Firmware version / date 9n + 5 4 U32 Software version / date 9n + 9 1 I8 The image type, where -1: No image 0: Uknown image (there is an image, but there is no meta-data) 1: Golden 2: Runtime 3: Base 4: Calibration
#define MSG_SYS_P_LOG_GET MSG_TYPE(GROUP_SYS, 0x0D) |
Get the last persistent log lines.
Oldest first.
Call first with an 32 bit integer, for the number of log-lines.
The returned message contains a batch of strings.
Call the function again but w/o the 32 bit integer to continue to read the next log lines.
Call as long as the last string as not empty. Once you read an empty line the output is at an end.
#define MSG_SYS_RT_CONFIG MSG_TYPE(GROUP_SYS, 0x18) |
Gets/Sets the runtime configuration.
When queried with no payload, the runtime configuration is returned.
The runtime configuration can also be set if put into the payload of the request.
Off Len Type Description 0 1 U8 Version (must be 1 when setting) 1 1 U8 Runtime image number to start after golden (1..3)