Lines Matching refs:buffer
92 CO_CANrx_t *buffer; in canopen_rx_callback() local
100 buffer = &CANmodule->rx_array[i]; in canopen_rx_callback()
102 if (buffer->filter_id == -ENOSPC || buffer->pFunct == NULL) { in canopen_rx_callback()
106 if (((frame->id ^ buffer->ident) & buffer->mask) == 0U) { in canopen_rx_callback()
108 if (buffer->rtr && ((frame->flags & CAN_FRAME_RTR) == 0U)) { in canopen_rx_callback()
115 buffer->pFunct(buffer->object, &rxMsg); in canopen_rx_callback()
148 CO_CANtx_t *buffer; in canopen_tx_retry() local
157 buffer = &CANmodule->tx_array[i]; in canopen_tx_retry()
158 if (buffer->bufferFull) { in canopen_tx_retry()
159 frame.id = buffer->ident; in canopen_tx_retry()
160 frame.dlc = buffer->DLC; in canopen_tx_retry()
161 frame.flags |= (buffer->rtr ? CAN_FRAME_RTR : 0); in canopen_tx_retry()
162 memcpy(frame.data, buffer->data, buffer->DLC); in canopen_tx_retry()
177 buffer->bufferFull = false; in canopen_tx_retry()
310 CO_CANrx_t *buffer; in CO_CANrxBufferInit() local
323 buffer = &CANmodule->rx_array[index]; in CO_CANrxBufferInit()
324 buffer->object = object; in CO_CANrxBufferInit()
325 buffer->pFunct = pFunct; in CO_CANrxBufferInit()
326 buffer->ident = ident; in CO_CANrxBufferInit()
327 buffer->mask = mask; in CO_CANrxBufferInit()
337 buffer->rtr = rtr; in CO_CANrxBufferInit()
344 if (buffer->filter_id != -ENOSPC) { in CO_CANrxBufferInit()
345 can_remove_rx_filter(CANmodule->dev, buffer->filter_id); in CO_CANrxBufferInit()
348 buffer->filter_id = can_add_rx_filter(CANmodule->dev, in CO_CANrxBufferInit()
351 if (buffer->filter_id == -ENOSPC) { in CO_CANrxBufferInit()
365 CO_CANtx_t *buffer; in CO_CANtxBufferInit() local
378 buffer = &CANmodule->tx_array[index]; in CO_CANtxBufferInit()
379 buffer->ident = ident; in CO_CANtxBufferInit()
380 buffer->rtr = rtr; in CO_CANtxBufferInit()
381 buffer->DLC = noOfBytes; in CO_CANtxBufferInit()
382 buffer->bufferFull = false; in CO_CANtxBufferInit()
383 buffer->syncFlag = syncFlag; in CO_CANtxBufferInit()
385 return buffer; in CO_CANtxBufferInit()
388 CO_ReturnError_t CO_CANsend(CO_CANmodule_t *CANmodule, CO_CANtx_t *buffer) in CO_CANsend() argument
394 if (!CANmodule || !CANmodule->dev || !buffer) { in CO_CANsend()
402 if (buffer->bufferFull) { in CO_CANsend()
405 CO_EMC_CAN_OVERRUN, buffer->ident); in CO_CANsend()
407 buffer->bufferFull = false; in CO_CANsend()
411 frame.id = buffer->ident; in CO_CANsend()
412 frame.dlc = buffer->DLC; in CO_CANsend()
413 frame.flags = (buffer->rtr ? CAN_FRAME_RTR : 0); in CO_CANsend()
414 memcpy(frame.data, buffer->data, buffer->DLC); in CO_CANsend()
419 buffer->bufferFull = true; in CO_CANsend()
435 CO_CANtx_t *buffer; in CO_CANclearPendingSyncPDOs() local
445 buffer = &CANmodule->tx_array[i]; in CO_CANclearPendingSyncPDOs()
446 if (buffer->bufferFull && buffer->syncFlag) { in CO_CANclearPendingSyncPDOs()
447 buffer->bufferFull = false; in CO_CANclearPendingSyncPDOs()