Skip to content

Commit

Permalink
Revert "SSR documentation clarification (#960)"
Browse files Browse the repository at this point in the history
This reverts commit 85d0ae2.
  • Loading branch information
woodfell committed Apr 26, 2021
1 parent 85d0ae2 commit f3863aa
Show file tree
Hide file tree
Showing 92 changed files with 29,630 additions and 21,070 deletions.
461 changes: 225 additions & 236 deletions c/include/libsbp/acquisition.h

Large diffs are not rendered by default.

125 changes: 66 additions & 59 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,40 +31,52 @@

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

} msg_bootloader_handshake_req_t;
#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 @@ -75,35 +87,33 @@ 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;

} 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;

} msg_bootloader_jump_to_app_t;
u8 jump;

} msg_bootloader_jump_to_app_t;

/** Read FPGA device ID over UART request (host => device)
*
Expand All @@ -115,10 +125,9 @@ 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

} msg_nap_device_dna_req_t;
#define SBP_MSG_NAP_DEVICE_DNA_REQ 0x00DE

} msg_nap_device_dna_req_t;

/** Read FPGA device ID over UART response (host <= device)
*
Expand All @@ -130,31 +139,29 @@ 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;

} 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;

} msg_bootloader_handshake_dep_a_t;

/** \} */

Expand Down
Loading

0 comments on commit f3863aa

Please sign in to comment.