Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSR documentation clarification #960

Merged
merged 2 commits into from
Apr 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
461 changes: 236 additions & 225 deletions c/include/libsbp/acquisition.h

Large diffs are not rendered by default.

125 changes: 59 additions & 66 deletions c/include/libsbp/bootload.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*
* * Messages for the bootloading configuration of a Piksi 2.3.1. This message
* group does not apply to Piksi Multi.
*
*
* Note that some of these messages share the same message type ID for both the
* host request and the device response.
* \{ */
Expand All @@ -31,52 +31,40 @@

SBP_PACK_START


/** Bootloading handshake request (host => device)
*
* The handshake message request from the host establishes a
* handshake between the device bootloader and the host. The
* response from the device is MSG_BOOTLOADER_HANDSHAKE_RESP.
*/
typedef struct SBP_ATTR_PACKED {
#define SBP_MSG_BOOTLOADER_HANDSHAKE_REQ 0x00B3

#define SBP_MSG_BOOTLOADER_HANDSHAKE_REQ 0x00B3
} msg_bootloader_handshake_req_t;

#define SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_MASK \
(0xff)
#define SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_SHIFT \
(8u)
#define SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_GET( \
flags) \
(((flags) >> \
SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_SHIFT) & \
SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_MASK)
#define SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_SET( \
flags, val) \
do { \
((flags) |= \
(((val) & \
(SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_MASK)) \
<< (SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_SHIFT))); \
} while (0)

#define SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MINOR_PROTOCOL_VERSION_NUMBER_MASK \
(0xff)
#define SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MINOR_PROTOCOL_VERSION_NUMBER_SHIFT \
(0u)
#define SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MINOR_PROTOCOL_VERSION_NUMBER_GET( \
flags) \
(((flags) >> \
SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MINOR_PROTOCOL_VERSION_NUMBER_SHIFT) & \
SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MINOR_PROTOCOL_VERSION_NUMBER_MASK)
#define SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MINOR_PROTOCOL_VERSION_NUMBER_SET( \
flags, val) \
do { \
((flags) |= \
(((val) & \
(SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MINOR_PROTOCOL_VERSION_NUMBER_MASK)) \
<< (SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MINOR_PROTOCOL_VERSION_NUMBER_SHIFT))); \
} while (0)

#define SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_MASK (0xff)
#define SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_SHIFT (8u)
#define SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_GET(flags) \
(((flags) >> SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_SHIFT) \
& SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_MASK)
#define SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_SET(flags, val) \
do {((flags) |= \
(((val) & (SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_MASK)) \
<< (SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_SHIFT)));} while(0)


#define SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MINOR_PROTOCOL_VERSION_NUMBER_MASK (0xff)
#define SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MINOR_PROTOCOL_VERSION_NUMBER_SHIFT (0u)
#define SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MINOR_PROTOCOL_VERSION_NUMBER_GET(flags) \
(((flags) >> SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MINOR_PROTOCOL_VERSION_NUMBER_SHIFT) \
& SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MINOR_PROTOCOL_VERSION_NUMBER_MASK)
#define SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MINOR_PROTOCOL_VERSION_NUMBER_SET(flags, val) \
do {((flags) |= \
(((val) & (SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MINOR_PROTOCOL_VERSION_NUMBER_MASK)) \
<< (SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MINOR_PROTOCOL_VERSION_NUMBER_SHIFT)));} while(0)


/** Bootloading handshake response (host <= device)
*
Expand All @@ -87,34 +75,36 @@ typedef struct SBP_ATTR_PACKED {
* protocol version number.
*/
typedef struct SBP_ATTR_PACKED {
#define SBP_MSG_BOOTLOADER_HANDSHAKE_RESP 0x00B4

/**
* Bootloader flags
#define SBP_MSG_BOOTLOADER_HANDSHAKE_RESP 0x00B4
/**
* Bootloader flags
*/
u32 flags;

/**
* Bootloader version number
u32 flags;
/**
* Bootloader version number
*/
char version[0];

} msg_bootloader_handshake_resp_t;


/** Bootloader jump to application (host => device)
*
* The host initiates the bootloader to jump to the application.
*/
typedef struct SBP_ATTR_PACKED {
#define SBP_MSG_BOOTLOADER_JUMP_TO_APP 0x00B1

/**
* Ignored by the device
#define SBP_MSG_BOOTLOADER_JUMP_TO_APP 0x00B1
/**
* Ignored by the device
*/
u8 jump;

u8 jump;
} msg_bootloader_jump_to_app_t;


/** Read FPGA device ID over UART request (host => device)
*
* The device message from the host reads a unique device
Expand All @@ -125,10 +115,11 @@ typedef struct SBP_ATTR_PACKED {
* and not related to the Piksi's serial number.
*/
typedef struct SBP_ATTR_PACKED {
#define SBP_MSG_NAP_DEVICE_DNA_REQ 0x00DE

#define SBP_MSG_NAP_DEVICE_DNA_REQ 0x00DE
} msg_nap_device_dna_req_t;


/** Read FPGA device ID over UART response (host <= device)
*
* The device message from the host reads a unique device
Expand All @@ -139,30 +130,32 @@ typedef struct SBP_ATTR_PACKED {
* and not related to the Piksi's serial number.
*/
typedef struct SBP_ATTR_PACKED {
#define SBP_MSG_NAP_DEVICE_DNA_RESP 0x00DD

/**
* 57-bit SwiftNAP FPGA Device ID. Remaining bits are padded
* on the right.
#define SBP_MSG_NAP_DEVICE_DNA_RESP 0x00DD
/**
* 57-bit SwiftNAP FPGA Device ID. Remaining bits are padded
* on the right.
*/
u8 dna[8];

} msg_nap_device_dna_resp_t;


/** Deprecated
*
* Deprecated.
* Deprecated.
*/
typedef struct SBP_ATTR_PACKED {
#define SBP_MSG_BOOTLOADER_HANDSHAKE_DEP_A 0x00B0

/**
* Version number string (not NULL terminated)
/**
* Version number string (not NULL terminated)
*/
u8 handshake[0];

} msg_bootloader_handshake_dep_a_t;


/** \} */

SBP_PACK_END
Expand Down
Loading