MCPcopy Create free account
hub / github.com/CANopenNode/CANopenNode / CO_CANtxBufferInit

Function CO_CANtxBufferInit

example/CO_driver_blank.c:128–146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

126}
127
128CO_CANtx_t*
129CO_CANtxBufferInit(CO_CANmodule_t* CANmodule, uint16_t index, uint16_t ident, bool_t rtr, uint8_t noOfBytes,
130 bool_t syncFlag) {
131 CO_CANtx_t* buffer = NULL;
132
133 if ((CANmodule != NULL) && (index < CANmodule->txSize)) {
134 /* get specific buffer */
135 buffer = &CANmodule->txArray[index];
136
137 /* CAN identifier, DLC and rtr, bit aligned with CAN module transmit buffer, microcontroller specific. */
138 buffer->ident = ((uint32_t)ident & 0x07FFU) | ((uint32_t)(((uint32_t)noOfBytes & 0xFU) << 11U))
139 | ((uint32_t)(rtr ? 0x8000U : 0U));
140
141 buffer->bufferFull = false;
142 buffer->syncFlag = syncFlag;
143 }
144
145 return buffer;
146}
147
148CO_ReturnError_t
149CO_CANsend(CO_CANmodule_t* CANmodule, CO_CANtx_t* buffer) {

Callers 15

CO_SRDO_configFunction · 0.85
CO_GFC_initFunction · 0.85
CO_LSSslave_initFunction · 0.85
CO_LSSmaster_initFunction · 0.85
CO_NMT_Heartbeat.cFile · 0.85
OD_write_1014Function · 0.85
CO_Emergency.cFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected