clang-format: ReflowComments: true
This commit is contained in:
parent
b87fad2195
commit
f46f1e2733
14 changed files with 201 additions and 196 deletions
|
|
@ -135,7 +135,7 @@ PenaltyIndentedWhitespace: 0
|
|||
PointerAlignment: Left
|
||||
PPIndentWidth: -1
|
||||
ReferenceAlignment: Pointer
|
||||
ReflowComments: false
|
||||
ReflowComments: true
|
||||
RemoveBracesLLVM: false
|
||||
SeparateDefinitionBlocks: Always
|
||||
ShortNamespaceLines: 1
|
||||
|
|
|
|||
|
|
@ -210,7 +210,8 @@ extern "C" {
|
|||
#define CO_EM_10_unused 0x10U /**< 0x10 communication critical (unused) */
|
||||
#define CO_EM_11_unused 0x11U /**< 0x11 communication critical (unused) */
|
||||
#define CO_EM_CAN_TX_BUS_OFF 0x12U /**< 0x12 communication critical CAN transmit bus is off */
|
||||
#define CO_EM_CAN_RXB_OVERFLOW 0x13U /**< 0x13 communication critical CAN module receive buffer has overflowed */
|
||||
#define CO_EM_CAN_RXB_OVERFLOW 0x13U /**< 0x13 communication critical CAN module receive buffer has overflowed \
|
||||
*/
|
||||
#define CO_EM_CAN_TX_OVERFLOW 0x14U /**< 0x14 communication critical CAN transmit buffer has overflowed */
|
||||
#define CO_EM_TPDO_OUTSIDE_WINDOW 0x15U /**< 0x15 communication critical TPDO is outside SYNC window */
|
||||
#define CO_EM_16_unused 0x16U /**< 0x16 communication critical (unused) */
|
||||
|
|
@ -221,7 +222,8 @@ extern "C" {
|
|||
#define CO_EM_HEARTBEAT_CONSUMER 0x1BU /**< 0x1B communication critical Heartbeat consumer timeout */
|
||||
#define CO_EM_HB_CONSUMER_REMOTE_RESET \
|
||||
0x1CU /**< 0x1C communication critical Heartbeat consumer detected remote node reset */
|
||||
#define CO_EM_SRDO_CONFIGURATION 0x1DU /**< 0x1D communication critical Error in SRDO configuration parameters. */
|
||||
#define CO_EM_SRDO_CONFIGURATION 0x1DU /**< 0x1D communication critical Error in SRDO configuration parameters. \
|
||||
*/
|
||||
#define CO_EM_1E_unused 0x1EU /**< 0x1E communication critical (unused) */
|
||||
#define CO_EM_1F_unused 0x1FU /**< 0x1F communication critical (unused) */
|
||||
|
||||
|
|
@ -233,9 +235,11 @@ extern "C" {
|
|||
#define CO_EM_24_unused 0x24U /**< 0x24 generic info (unused) */
|
||||
#define CO_EM_25_unused 0x25U /**< 0x25 generic info (unused) */
|
||||
#define CO_EM_26_unused 0x26U /**< 0x26 generic info (unused) */
|
||||
#define CO_EM_NON_VOLATILE_AUTO_SAVE 0x27U /**< 0x27 generic info Automatic store to non-volatile memory failed */
|
||||
#define CO_EM_NON_VOLATILE_AUTO_SAVE 0x27U /**< 0x27 generic info Automatic store to non-volatile memory failed \
|
||||
*/
|
||||
|
||||
#define CO_EM_WRONG_ERROR_REPORT 0x28U /**< 0x28 generic critical Wrong parameters to CO_errorReport() function*/
|
||||
#define CO_EM_WRONG_ERROR_REPORT 0x28U /**< 0x28 generic critical Wrong parameters to CO_errorReport() \
|
||||
function*/
|
||||
#define CO_EM_ISR_TIMER_OVERFLOW 0x29U /**< 0x29 generic critical Timer task has overflowed */
|
||||
#define CO_EM_MEMORY_ALLOCATION_ERROR 0x2AU /**< 0x2A generic critical Unable to allocate memory for objects */
|
||||
#define CO_EM_GENERIC_ERROR 0x2BU /**< 0x2B generic critical Generic error test usage */
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ typedef enum {
|
|||
/**
|
||||
* @defgroup CO_NMT_control_t NMT control bitfield for NMT internal state.
|
||||
* @{
|
||||
*
|
||||
*
|
||||
*
|
||||
* Variable of this type is passed to @ref CO_NMT_init() function. It
|
||||
* controls behavior of the @ref CO_NMT_internalState_t of the device according
|
||||
|
|
|
|||
|
|
@ -133,8 +133,8 @@ typedef enum {
|
|||
*/
|
||||
typedef enum {
|
||||
/* !!!! WARNING !!!!
|
||||
* If changing these values, change also OD_getSDOabCode() function!
|
||||
*/
|
||||
* If changing these values, change also OD_getSDOabCode() function!
|
||||
*/
|
||||
/** Read/write is only partial, make more calls */
|
||||
ODR_PARTIAL = -1,
|
||||
/** SDO abort 0x00000000 - Read/write successfully finished */
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ CO_SDOclient_receive(void* object, void* msg) {
|
|||
CO_FLAG_SET(SDO_C->CANrxNew);
|
||||
#if ((CO_CONFIG_SDO_CLI)&CO_CONFIG_FLAG_CALLBACK_PRE) != 0
|
||||
/* Optional signal to RTOS, which can resume task, which handles
|
||||
* SDO client processing. */
|
||||
* SDO client processing. */
|
||||
if (SDO_C->pFunctSignal != NULL) {
|
||||
SDO_C->pFunctSignal(SDO_C->functSignalObject);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ CO_SDO_receive(void* object, void* msg) {
|
|||
SDO->block_seqno = seqno;
|
||||
|
||||
/* Copy data. There is always enough space in buffer,
|
||||
* because block_blksize was calculated before */
|
||||
* because block_blksize was calculated before */
|
||||
(void)memcpy(SDO->buf + SDO->bufOffsetWr, &data[1], 7);
|
||||
SDO->bufOffsetWr += 7;
|
||||
SDO->sizeTran += 7;
|
||||
|
|
|
|||
|
|
@ -97,224 +97,224 @@ extern "C" {
|
|||
*/
|
||||
typedef enum {
|
||||
/**
|
||||
* - SDO client may start new download to or upload from specified node,
|
||||
* specified index and specified subindex. It can start normal or block
|
||||
* communication.
|
||||
* - SDO server is waiting for client request. */
|
||||
* - SDO client may start new download to or upload from specified node,
|
||||
* specified index and specified subindex. It can start normal or block
|
||||
* communication.
|
||||
* - SDO server is waiting for client request. */
|
||||
CO_SDO_ST_IDLE = 0x00U,
|
||||
/**
|
||||
* - SDO client or server may send SDO abort message in case of error:
|
||||
* - byte 0: @b 10000000 binary.
|
||||
* - byte 1..3: Object index and subIndex.
|
||||
* - byte 4..7: #CO_SDO_abortCode_t. */
|
||||
* - SDO client or server may send SDO abort message in case of error:
|
||||
* - byte 0: @b 10000000 binary.
|
||||
* - byte 1..3: Object index and subIndex.
|
||||
* - byte 4..7: #CO_SDO_abortCode_t. */
|
||||
CO_SDO_ST_ABORT = 0x01U,
|
||||
|
||||
/**
|
||||
* - SDO client: Node-ID of the SDO server is the same as node-ID of this node,
|
||||
* SDO client is the same device as SDO server. Transfer data directly without
|
||||
* communication on CAN.
|
||||
* - SDO server does not use this state. */
|
||||
* - SDO client: Node-ID of the SDO server is the same as node-ID of this node,
|
||||
* SDO client is the same device as SDO server. Transfer data directly without
|
||||
* communication on CAN.
|
||||
* - SDO server does not use this state. */
|
||||
CO_SDO_ST_DOWNLOAD_LOCAL_TRANSFER = 0x10U,
|
||||
/**
|
||||
* - SDO client initiates SDO download:
|
||||
* - byte 0: @b 0010nnes binary: (nn: if e=s=1, number of data bytes, that do
|
||||
* @b not contain data; e=1 for expedited transfer; s=1 if data size is
|
||||
* indicated.)
|
||||
* - byte 1..3: Object index and subIndex.
|
||||
* - byte 4..7: If e=1, expedited data are here. If e=0 s=1, size of data for
|
||||
* segmented transfer is indicated here.
|
||||
* - SDO server is in #CO_SDO_ST_IDLE state and waits for client request. */
|
||||
* - SDO client initiates SDO download:
|
||||
* - byte 0: @b 0010nnes binary: (nn: if e=s=1, number of data bytes, that do
|
||||
* @b not contain data; e=1 for expedited transfer; s=1 if data size is
|
||||
* indicated.)
|
||||
* - byte 1..3: Object index and subIndex.
|
||||
* - byte 4..7: If e=1, expedited data are here. If e=0 s=1, size of data for
|
||||
* segmented transfer is indicated here.
|
||||
* - SDO server is in #CO_SDO_ST_IDLE state and waits for client request. */
|
||||
CO_SDO_ST_DOWNLOAD_INITIATE_REQ = 0x11U,
|
||||
/**
|
||||
* - SDO client waits for response.
|
||||
* - SDO server responses:
|
||||
* - byte 0: @b 01100000 binary.
|
||||
* - byte 1..3: Object index and subIndex.
|
||||
* - byte 4..7: Reserved.
|
||||
* - In case of expedited transfer communication ends here. */
|
||||
* - SDO client waits for response.
|
||||
* - SDO server responses:
|
||||
* - byte 0: @b 01100000 binary.
|
||||
* - byte 1..3: Object index and subIndex.
|
||||
* - byte 4..7: Reserved.
|
||||
* - In case of expedited transfer communication ends here. */
|
||||
CO_SDO_ST_DOWNLOAD_INITIATE_RSP = 0x12U,
|
||||
/**
|
||||
* - SDO client sends SDO segment:
|
||||
* - byte 0: @b 000tnnnc binary: (t: toggle bit, set to 0 in first segment;
|
||||
* nnn: number of data bytes, that do @b not contain data; c=1 if this is the
|
||||
* last segment).
|
||||
* - byte 1..7: Data segment.
|
||||
* - SDO server waits for segment. */
|
||||
* - SDO client sends SDO segment:
|
||||
* - byte 0: @b 000tnnnc binary: (t: toggle bit, set to 0 in first segment;
|
||||
* nnn: number of data bytes, that do @b not contain data; c=1 if this is the
|
||||
* last segment).
|
||||
* - byte 1..7: Data segment.
|
||||
* - SDO server waits for segment. */
|
||||
CO_SDO_ST_DOWNLOAD_SEGMENT_REQ = 0x13U,
|
||||
/**
|
||||
* - SDO client waits for response.
|
||||
* - SDO server responses:
|
||||
* - byte 0: @b 001t0000 binary: (t: toggle bit, set to 0 in first segment).
|
||||
* - byte 1..7: Reserved.
|
||||
* - If c was set to 1, then communication ends here. */
|
||||
* - SDO client waits for response.
|
||||
* - SDO server responses:
|
||||
* - byte 0: @b 001t0000 binary: (t: toggle bit, set to 0 in first segment).
|
||||
* - byte 1..7: Reserved.
|
||||
* - If c was set to 1, then communication ends here. */
|
||||
CO_SDO_ST_DOWNLOAD_SEGMENT_RSP = 0x14U,
|
||||
|
||||
/**
|
||||
* - SDO client: Node-ID of the SDO server is the same as node-ID of this node,
|
||||
* SDO client is the same device as SDO server. Transfer data directly without
|
||||
* communication on CAN.
|
||||
* - SDO server does not use this state. */
|
||||
* - SDO client: Node-ID of the SDO server is the same as node-ID of this node,
|
||||
* SDO client is the same device as SDO server. Transfer data directly without
|
||||
* communication on CAN.
|
||||
* - SDO server does not use this state. */
|
||||
CO_SDO_ST_UPLOAD_LOCAL_TRANSFER = 0x20U,
|
||||
/**
|
||||
* - SDO client initiates SDO upload:
|
||||
* - byte 0: @b 01000000 binary.
|
||||
* - byte 1..3: Object index and subIndex.
|
||||
* - byte 4..7: Reserved.
|
||||
* - SDO server is in #CO_SDO_ST_IDLE state and waits for client request. */
|
||||
* - SDO client initiates SDO upload:
|
||||
* - byte 0: @b 01000000 binary.
|
||||
* - byte 1..3: Object index and subIndex.
|
||||
* - byte 4..7: Reserved.
|
||||
* - SDO server is in #CO_SDO_ST_IDLE state and waits for client request. */
|
||||
CO_SDO_ST_UPLOAD_INITIATE_REQ = 0x21U,
|
||||
/**
|
||||
* - SDO client waits for response.
|
||||
* - SDO server responses:
|
||||
* - byte 0: @b 0100nnes binary: (nn: if e=s=1, number of data bytes, that do
|
||||
* @b not contain data; e=1 for expedited transfer; s=1 if data size is
|
||||
* indicated).
|
||||
* - byte 1..3: Object index and subIndex.
|
||||
* - byte 4..7: If e=1, expedited data are here. If e=0 s=1, size of data for
|
||||
* segmented transfer is indicated here.
|
||||
* - In case of expedited transfer communication ends here. */
|
||||
* - SDO client waits for response.
|
||||
* - SDO server responses:
|
||||
* - byte 0: @b 0100nnes binary: (nn: if e=s=1, number of data bytes, that do
|
||||
* @b not contain data; e=1 for expedited transfer; s=1 if data size is
|
||||
* indicated).
|
||||
* - byte 1..3: Object index and subIndex.
|
||||
* - byte 4..7: If e=1, expedited data are here. If e=0 s=1, size of data for
|
||||
* segmented transfer is indicated here.
|
||||
* - In case of expedited transfer communication ends here. */
|
||||
CO_SDO_ST_UPLOAD_INITIATE_RSP = 0x22U,
|
||||
/**
|
||||
* - SDO client requests SDO segment:
|
||||
* - byte 0: @b 011t0000 binary: (t: toggle bit, set to 0 in first segment).
|
||||
* - byte 1..7: Reserved.
|
||||
* - SDO server waits for segment request. */
|
||||
* - SDO client requests SDO segment:
|
||||
* - byte 0: @b 011t0000 binary: (t: toggle bit, set to 0 in first segment).
|
||||
* - byte 1..7: Reserved.
|
||||
* - SDO server waits for segment request. */
|
||||
CO_SDO_ST_UPLOAD_SEGMENT_REQ = 0x23U,
|
||||
/**
|
||||
* - SDO client waits for response.
|
||||
* - SDO server responses with data:
|
||||
* - byte 0: @b 000tnnnc binary: (t: toggle bit, set to 0 in first segment;
|
||||
* nnn: number of data bytes, that do @b not contain data; c=1 if this is the
|
||||
* last segment).
|
||||
* - byte 1..7: Data segment.
|
||||
* - If c is set to 1, then communication ends here. */
|
||||
* - SDO client waits for response.
|
||||
* - SDO server responses with data:
|
||||
* - byte 0: @b 000tnnnc binary: (t: toggle bit, set to 0 in first segment;
|
||||
* nnn: number of data bytes, that do @b not contain data; c=1 if this is the
|
||||
* last segment).
|
||||
* - byte 1..7: Data segment.
|
||||
* - If c is set to 1, then communication ends here. */
|
||||
CO_SDO_ST_UPLOAD_SEGMENT_RSP = 0x24U,
|
||||
|
||||
/**
|
||||
* - SDO client initiates SDO block download:
|
||||
* - byte 0: @b 11000rs0 binary: (r=1 if client supports generating CRC on
|
||||
* data; s=1 if data size is indicated.)
|
||||
* - byte 1..3: Object index and subIndex.
|
||||
* - byte 4..7: If s=1, then size of data for block download is indicated here.
|
||||
* - SDO server is in #CO_SDO_ST_IDLE state and waits for client request. */
|
||||
* - SDO client initiates SDO block download:
|
||||
* - byte 0: @b 11000rs0 binary: (r=1 if client supports generating CRC on
|
||||
* data; s=1 if data size is indicated.)
|
||||
* - byte 1..3: Object index and subIndex.
|
||||
* - byte 4..7: If s=1, then size of data for block download is indicated here.
|
||||
* - SDO server is in #CO_SDO_ST_IDLE state and waits for client request. */
|
||||
CO_SDO_ST_DOWNLOAD_BLK_INITIATE_REQ = 0x51U,
|
||||
/**
|
||||
* - SDO client waits for response.
|
||||
* - SDO server responses:
|
||||
* - byte 0: @b 10100r00 binary: (r=1 if server supports generating CRC on
|
||||
* data.)
|
||||
* - byte 1..3: Object index and subIndex.
|
||||
* - byte 4: blksize: Number of segments per block that shall be used by the
|
||||
* client for the following block download with 0 < blksize < 128.
|
||||
* - byte 5..7: Reserved. */
|
||||
* - SDO client waits for response.
|
||||
* - SDO server responses:
|
||||
* - byte 0: @b 10100r00 binary: (r=1 if server supports generating CRC on
|
||||
* data.)
|
||||
* - byte 1..3: Object index and subIndex.
|
||||
* - byte 4: blksize: Number of segments per block that shall be used by the
|
||||
* client for the following block download with 0 < blksize < 128.
|
||||
* - byte 5..7: Reserved. */
|
||||
CO_SDO_ST_DOWNLOAD_BLK_INITIATE_RSP = 0x52U,
|
||||
/**
|
||||
* - SDO client sends 'blksize' segments of data in sequence:
|
||||
* - byte 0: @b cnnnnnnn binary: (c=1 if no more segments to be downloaded,
|
||||
* enter SDO block download end phase; nnnnnnn is sequence number of segment,
|
||||
* 1..127.
|
||||
* - byte 1..7: At most 7 bytes of segment data to be downloaded.
|
||||
* - SDO server reads sequence of 'blksize' blocks. */
|
||||
* - SDO client sends 'blksize' segments of data in sequence:
|
||||
* - byte 0: @b cnnnnnnn binary: (c=1 if no more segments to be downloaded,
|
||||
* enter SDO block download end phase; nnnnnnn is sequence number of segment,
|
||||
* 1..127.
|
||||
* - byte 1..7: At most 7 bytes of segment data to be downloaded.
|
||||
* - SDO server reads sequence of 'blksize' blocks. */
|
||||
CO_SDO_ST_DOWNLOAD_BLK_SUBBLOCK_REQ = 0x53U,
|
||||
/**
|
||||
* - SDO client waits for response.
|
||||
* - SDO server responses:
|
||||
* - byte 0: @b 10100010 binary.
|
||||
* - byte 1: ackseq: sequence number of last segment that was received
|
||||
* successfully during the last block download. If ackseq is set to 0 the
|
||||
* server indicates the client that the segment with the sequence number 1
|
||||
* was not received correctly and all segments shall be retransmitted by the
|
||||
* client.
|
||||
* - byte 2: Number of segments per block that shall be used by the client for
|
||||
* the following block download with 0 < blksize < 128.
|
||||
* - byte 3..7: Reserved.
|
||||
* - If c was set to 1, then communication enters SDO block download end phase.
|
||||
*/
|
||||
* - SDO client waits for response.
|
||||
* - SDO server responses:
|
||||
* - byte 0: @b 10100010 binary.
|
||||
* - byte 1: ackseq: sequence number of last segment that was received
|
||||
* successfully during the last block download. If ackseq is set to 0 the
|
||||
* server indicates the client that the segment with the sequence number 1
|
||||
* was not received correctly and all segments shall be retransmitted by the
|
||||
* client.
|
||||
* - byte 2: Number of segments per block that shall be used by the client for
|
||||
* the following block download with 0 < blksize < 128.
|
||||
* - byte 3..7: Reserved.
|
||||
* - If c was set to 1, then communication enters SDO block download end phase.
|
||||
*/
|
||||
CO_SDO_ST_DOWNLOAD_BLK_SUBBLOCK_RSP = 0x54U,
|
||||
/**
|
||||
* - SDO client sends SDO block download end:
|
||||
* - byte 0: @b 110nnn01 binary: (nnn: number of data bytes, that do @b not
|
||||
* contain data)
|
||||
* - byte 1..2: 16 bit CRC for the data set, if enabled by client and server.
|
||||
* - byte 3..7: Reserved.
|
||||
* - SDO server waits for client request. */
|
||||
* - SDO client sends SDO block download end:
|
||||
* - byte 0: @b 110nnn01 binary: (nnn: number of data bytes, that do @b not
|
||||
* contain data)
|
||||
* - byte 1..2: 16 bit CRC for the data set, if enabled by client and server.
|
||||
* - byte 3..7: Reserved.
|
||||
* - SDO server waits for client request. */
|
||||
CO_SDO_ST_DOWNLOAD_BLK_END_REQ = 0x55U,
|
||||
/**
|
||||
* - SDO client waits for response.
|
||||
* - SDO server responses:
|
||||
* - byte 0: @b 10100001 binary.
|
||||
* - byte 1..7: Reserved.
|
||||
* - Block download successfully ends here.
|
||||
*/
|
||||
* - SDO client waits for response.
|
||||
* - SDO server responses:
|
||||
* - byte 0: @b 10100001 binary.
|
||||
* - byte 1..7: Reserved.
|
||||
* - Block download successfully ends here.
|
||||
*/
|
||||
CO_SDO_ST_DOWNLOAD_BLK_END_RSP = 0x56U,
|
||||
|
||||
/**
|
||||
* - SDO client initiates SDO block upload:
|
||||
* - byte 0: @b 10100r00 binary: (r=1 if client supports generating CRC on
|
||||
* data.)
|
||||
* - byte 1..3: Object index and subIndex.
|
||||
* - byte 4: blksize: Number of segments per block with 0 < blksize < 128.
|
||||
* - byte 5: pst - protocol switch threshold. If pst > 0 and size of the data
|
||||
* in bytes is less or equal pst, then the server may switch to the SDO
|
||||
* upload protocol #CO_SDO_ST_UPLOAD_INITIATE_RSP.
|
||||
* - byte 6..7: Reserved.
|
||||
* - SDO server is in #CO_SDO_ST_IDLE state and waits for client request. */
|
||||
* - SDO client initiates SDO block upload:
|
||||
* - byte 0: @b 10100r00 binary: (r=1 if client supports generating CRC on
|
||||
* data.)
|
||||
* - byte 1..3: Object index and subIndex.
|
||||
* - byte 4: blksize: Number of segments per block with 0 < blksize < 128.
|
||||
* - byte 5: pst - protocol switch threshold. If pst > 0 and size of the data
|
||||
* in bytes is less or equal pst, then the server may switch to the SDO
|
||||
* upload protocol #CO_SDO_ST_UPLOAD_INITIATE_RSP.
|
||||
* - byte 6..7: Reserved.
|
||||
* - SDO server is in #CO_SDO_ST_IDLE state and waits for client request. */
|
||||
CO_SDO_ST_UPLOAD_BLK_INITIATE_REQ = 0x61U,
|
||||
/**
|
||||
* - SDO client waits for response.
|
||||
* - SDO server responses:
|
||||
* - byte 0: @b 11000rs0 binary: (r=1 if server supports generating CRC on
|
||||
* data; s=1 if data size is indicated. )
|
||||
* - byte 1..3: Object index and subIndex.
|
||||
* - byte 4..7: If s=1, then size of data for block upload is indicated here.
|
||||
* - If enabled by pst, then server may alternatively response with
|
||||
* #CO_SDO_ST_UPLOAD_INITIATE_RSP */
|
||||
* - SDO client waits for response.
|
||||
* - SDO server responses:
|
||||
* - byte 0: @b 11000rs0 binary: (r=1 if server supports generating CRC on
|
||||
* data; s=1 if data size is indicated. )
|
||||
* - byte 1..3: Object index and subIndex.
|
||||
* - byte 4..7: If s=1, then size of data for block upload is indicated here.
|
||||
* - If enabled by pst, then server may alternatively response with
|
||||
* #CO_SDO_ST_UPLOAD_INITIATE_RSP */
|
||||
CO_SDO_ST_UPLOAD_BLK_INITIATE_RSP = 0x62U,
|
||||
/**
|
||||
* - SDO client sends second initiate for SDO block upload:
|
||||
* - byte 0: @b 10100011 binary.
|
||||
* - byte 1..7: Reserved.
|
||||
* - SDO server waits for client request. */
|
||||
* - SDO client sends second initiate for SDO block upload:
|
||||
* - byte 0: @b 10100011 binary.
|
||||
* - byte 1..7: Reserved.
|
||||
* - SDO server waits for client request. */
|
||||
CO_SDO_ST_UPLOAD_BLK_INITIATE_REQ2 = 0x63U,
|
||||
/**
|
||||
* - SDO client reads sequence of 'blksize' blocks.
|
||||
* - SDO server sends 'blksize' segments of data in sequence:
|
||||
* - byte 0: @b cnnnnnnn binary: (c=1 if no more segments to be uploaded,
|
||||
* enter SDO block upload end phase; nnnnnnn is sequence number of segment,
|
||||
* 1..127.
|
||||
* - byte 1..7: At most 7 bytes of segment data to be uploaded. */
|
||||
* - SDO client reads sequence of 'blksize' blocks.
|
||||
* - SDO server sends 'blksize' segments of data in sequence:
|
||||
* - byte 0: @b cnnnnnnn binary: (c=1 if no more segments to be uploaded,
|
||||
* enter SDO block upload end phase; nnnnnnn is sequence number of segment,
|
||||
* 1..127.
|
||||
* - byte 1..7: At most 7 bytes of segment data to be uploaded. */
|
||||
CO_SDO_ST_UPLOAD_BLK_SUBBLOCK_SREQ = 0x64U,
|
||||
/**
|
||||
* - SDO client responses:
|
||||
* - byte 0: @b 10100010 binary.
|
||||
* - byte 1: ackseq: sequence number of last segment that was received
|
||||
* successfully during the last block upload. If ackseq is set to 0 the
|
||||
* client indicates the server that the segment with the sequence number 1
|
||||
* was not received correctly and all segments shall be retransmitted by the
|
||||
* server.
|
||||
* - byte 2: Number of segments per block that shall be used by the server for
|
||||
* the following block upload with 0 < blksize < 128.
|
||||
* - byte 3..7: Reserved.
|
||||
* - SDO server waits for response.
|
||||
* - If c was set to 1 and all segments were successfull received, then
|
||||
* communication enters SDO block upload end phase. */
|
||||
* - SDO client responses:
|
||||
* - byte 0: @b 10100010 binary.
|
||||
* - byte 1: ackseq: sequence number of last segment that was received
|
||||
* successfully during the last block upload. If ackseq is set to 0 the
|
||||
* client indicates the server that the segment with the sequence number 1
|
||||
* was not received correctly and all segments shall be retransmitted by the
|
||||
* server.
|
||||
* - byte 2: Number of segments per block that shall be used by the server for
|
||||
* the following block upload with 0 < blksize < 128.
|
||||
* - byte 3..7: Reserved.
|
||||
* - SDO server waits for response.
|
||||
* - If c was set to 1 and all segments were successfull received, then
|
||||
* communication enters SDO block upload end phase. */
|
||||
CO_SDO_ST_UPLOAD_BLK_SUBBLOCK_CRSP = 0x65U,
|
||||
/**
|
||||
* - SDO client waits for server request.
|
||||
* - SDO server sends SDO block upload end:
|
||||
* - byte 0: @b 110nnn01 binary: (nnn: number of data bytes, that do @b not
|
||||
* contain data)
|
||||
* - byte 1..2: 16 bit CRC for the data set, if enabled by client and server.
|
||||
* - byte 3..7: Reserved. */
|
||||
* - SDO client waits for server request.
|
||||
* - SDO server sends SDO block upload end:
|
||||
* - byte 0: @b 110nnn01 binary: (nnn: number of data bytes, that do @b not
|
||||
* contain data)
|
||||
* - byte 1..2: 16 bit CRC for the data set, if enabled by client and server.
|
||||
* - byte 3..7: Reserved. */
|
||||
CO_SDO_ST_UPLOAD_BLK_END_SREQ = 0x66U,
|
||||
/**
|
||||
* - SDO client responses:
|
||||
* - byte 0: @b 10100001 binary.
|
||||
* - byte 1..7: Reserved.
|
||||
* - SDO server waits for response.
|
||||
* - Block download successfully ends here. Note that this communication ends
|
||||
* with client response. Client may then start next SDO communication
|
||||
* immediately.
|
||||
*/
|
||||
* - SDO client responses:
|
||||
* - byte 0: @b 10100001 binary.
|
||||
* - byte 1..7: Reserved.
|
||||
* - SDO server waits for response.
|
||||
* - Block download successfully ends here. Note that this communication ends
|
||||
* with client response. Client may then start next SDO communication
|
||||
* immediately.
|
||||
*/
|
||||
CO_SDO_ST_UPLOAD_BLK_END_CRSP = 0x67U,
|
||||
} CO_SDO_state_t;
|
||||
|
||||
|
|
|
|||
|
|
@ -453,10 +453,11 @@ size_t CO_fifo_readB642a(CO_fifo_t* fifo, char* buf, size_t count, bool_t end);
|
|||
/**
|
||||
* @defgroup uint8_t Bitfields for status argument from CO_fifo_cpyTok2U8 function and similar
|
||||
* @{
|
||||
*/
|
||||
*/
|
||||
#define CO_fifo_st_closed 0x01U /**< Bit is set, if command delimiter is reached in src */
|
||||
#define CO_fifo_st_partial \
|
||||
0x02U /**< Bit is set, if copy was partial and more data are available. If unset and no error, then all data was successfully copied. */
|
||||
0x02U /**< Bit is set, if copy was partial and more data are available. If unset and no error, then all data was \
|
||||
successfully copied. */
|
||||
#define CO_fifo_st_errTok 0x10U /**< Bit is set, if no valid token found */
|
||||
#define CO_fifo_st_errVal 0x20U /**< Bit is set, if value is not valid or out of limits */
|
||||
#define CO_fifo_st_errBuf 0x40U /**< Bit is set, if destination buffer is to small */
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ extern "C" {
|
|||
/**
|
||||
* @defgroup CO_LED_BITFIELD_t Bitfield for combining with red or green led
|
||||
* @{
|
||||
*
|
||||
*
|
||||
*/
|
||||
#define CO_LED_flicker 0x01U /**< LED flickering 10Hz */
|
||||
#define CO_LED_blink 0x02U /**< LED blinking 2,5Hz */
|
||||
|
|
|
|||
|
|
@ -780,7 +780,7 @@ CO_SRDO_process(CO_SRDO_t* SRDO, uint32_t timeDifference_us, uint32_t* timerNext
|
|||
}
|
||||
|
||||
/* Set stream.dataOffset to zero, perform OD_IO.read()
|
||||
* and store mappedLength back to stream.dataOffset */
|
||||
* and store mappedLength back to stream.dataOffset */
|
||||
stream->dataOffset = 0;
|
||||
OD_size_t countRd;
|
||||
OD_IO->read(stream, dataSRDOCopy, ODdataLength, &countRd);
|
||||
|
|
@ -905,7 +905,7 @@ CO_SRDO_process(CO_SRDO_t* SRDO, uint32_t timeDifference_us, uint32_t* timerNext
|
|||
ODdataLength = CO_SRDO_MAX_SIZE;
|
||||
}
|
||||
/* Prepare data for writing into OD variable. If mappedLength
|
||||
* is smaller than ODdataLength, then use auxiliary buffer */
|
||||
* is smaller than ODdataLength, then use auxiliary buffer */
|
||||
uint8_t buf[CO_SRDO_MAX_SIZE];
|
||||
uint8_t* dataOD;
|
||||
if (ODdataLength > mappedLength) {
|
||||
|
|
@ -930,7 +930,7 @@ CO_SRDO_process(CO_SRDO_t* SRDO, uint32_t timeDifference_us, uint32_t* timerNext
|
|||
#endif
|
||||
|
||||
/* Set stream.dataOffset to zero, perform OD_IO.write()
|
||||
* and store mappedLength back to stream.dataOffset */
|
||||
* and store mappedLength back to stream.dataOffset */
|
||||
*dataOffset = 0;
|
||||
OD_size_t countWritten;
|
||||
OD_IO->write(&OD_IO->stream, dataOD, ODdataLength, &countWritten);
|
||||
|
|
|
|||
|
|
@ -47,10 +47,10 @@ extern "C" {
|
|||
* @ingroup CO_CANopen_304
|
||||
* @{
|
||||
* Safety Related Data Object protocol is specified by standard EN 50325-5:2010 (formerly CiA304).
|
||||
* Its functionality is very similar to that of the PDOs. The main differences is every message is send and received twice.
|
||||
* The second message must be bitwise inverted. The delay between the two messages and between each message pair is monitored.
|
||||
* The distinction between sending and receiving SRDO is made at runtime (for PDO it is compile time).
|
||||
* If the security protocol is used, at least one SRDO is mandatory.
|
||||
* Its functionality is very similar to that of the PDOs. The main differences is every message is send and received
|
||||
* twice. The second message must be bitwise inverted. The delay between the two messages and between each message pair
|
||||
* is monitored. The distinction between sending and receiving SRDO is made at runtime (for PDO it is compile time). If
|
||||
* the security protocol is used, at least one SRDO is mandatory.
|
||||
*
|
||||
* If there is erroneous structure of OD entries for SRDO parameters, then @CO_SRDO_init() function
|
||||
* returns error and CANopen device doesn't work. It is necessary to repair Object Dictionary and reprogram the device.
|
||||
|
|
@ -65,8 +65,8 @@ extern "C" {
|
|||
*
|
||||
* @CO_SRDO_process() must be executed cyclically, similar as PDO processing. Function is fast, no time consuming tasks.
|
||||
* Function returns @CO_SRDO_state_t value, which may be used to determine working-state or safe-state of safety related
|
||||
* device. If return values from all SRDO objects are >= CO_SRDO_state_communicationEstablished, then working state is allowed.
|
||||
* Otherwise SR device must be in safe state.
|
||||
* device. If return values from all SRDO objects are >= CO_SRDO_state_communicationEstablished, then working state is
|
||||
* allowed. Otherwise SR device must be in safe state.
|
||||
*
|
||||
* Requirement for mapped objects:
|
||||
* - @OD_attributes_t must have set bit ODA_RSRDO or ODA_RSRDO or ODA_TRSRDO (by CANopenEditor).
|
||||
|
|
|
|||
|
|
@ -109,9 +109,9 @@ typedef struct {
|
|||
uint8_t fsBitChecked; /**< Current scan bit position */
|
||||
uint32_t fsIdNumber; /**< Current scan result */
|
||||
|
||||
volatile void*
|
||||
CANrxNew; /**< Indication if new LSS message is received from CAN bus. It needs to be cleared when received message is completely processed. */
|
||||
uint8_t CANrxData[8]; /**< 8 data bytes of the received message */
|
||||
volatile void* CANrxNew; /**< Indication if new LSS message is received from CAN bus. It needs to be cleared when
|
||||
received message is completely processed. */
|
||||
uint8_t CANrxData[8]; /**< 8 data bytes of the received message */
|
||||
#if (((CO_CONFIG_LSS)&CO_CONFIG_FLAG_CALLBACK_PRE) != 0) || defined CO_DOXYGEN
|
||||
void (*pFunctSignal)(void* object); /**< From CO_LSSmaster_initCallbackPre() or NULL */
|
||||
void* functSignalObject; /**< Pointer to object */
|
||||
|
|
|
|||
|
|
@ -274,7 +274,7 @@ CO_LSSslave_process(CO_LSSslave_t* LSSslave) {
|
|||
switch (LSSslave->service) {
|
||||
case CO_LSS_SWITCH_STATE_GLOBAL: {
|
||||
/* Node-Id was unconfigured before, now it is configured,
|
||||
* enter the NMT Reset communication autonomously. */
|
||||
* enter the NMT Reset communication autonomously. */
|
||||
resetCommunication = true;
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -591,8 +591,8 @@ CO_GTWA_process(CO_GTWA_t* gtwa, bool_t enable, uint32_t timeDifference_us, uint
|
|||
}
|
||||
|
||||
/***************************************************************************
|
||||
* COMMAND PARSER
|
||||
***************************************************************************/
|
||||
* COMMAND PARSER
|
||||
***************************************************************************/
|
||||
/* if idle, search for new command, skip comments or empty lines */
|
||||
while (CO_fifo_CommSearch(>wa->commFifo, false) && (gtwa->state == CO_GTWA_ST_IDLE)) {
|
||||
char tok[20];
|
||||
|
|
@ -1531,8 +1531,8 @@ CO_GTWA_process(CO_GTWA_t* gtwa, bool_t enable, uint32_t timeDifference_us, uint
|
|||
} /* while CO_GTWA_ST_IDLE && CO_fifo_CommSearch */
|
||||
|
||||
/***************************************************************************
|
||||
* STATE MACHINE
|
||||
***************************************************************************/
|
||||
* STATE MACHINE
|
||||
***************************************************************************/
|
||||
/* If error, generate error response */
|
||||
if (err) {
|
||||
if (respErrorCode == CO_GTWA_respErrorNone) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue