| 126 | } |
| 127 | |
| 128 | CO_CANtx_t* |
| 129 | CO_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 | |
| 148 | CO_ReturnError_t |
| 149 | CO_CANsend(CO_CANmodule_t* CANmodule, CO_CANtx_t* buffer) { |
no outgoing calls
no test coverage detected