| 97 | } |
| 98 | |
| 99 | CO_ReturnError_t |
| 100 | CO_CANrxBufferInit(CO_CANmodule_t* CANmodule, uint16_t index, uint16_t ident, uint16_t mask, bool_t rtr, void* object, |
| 101 | void (*CANrx_callback)(void* object, void* message)) { |
| 102 | CO_ReturnError_t ret = CO_ERROR_NO; |
| 103 | |
| 104 | if ((CANmodule != NULL) && (object != NULL) && (CANrx_callback != NULL) && (index < CANmodule->rxSize)) { |
| 105 | /* buffer, which will be configured */ |
| 106 | CO_CANrx_t* buffer = &CANmodule->rxArray[index]; |
| 107 | |
| 108 | /* Configure object variables */ |
| 109 | buffer->object = object; |
| 110 | buffer->CANrx_callback = CANrx_callback; |
| 111 | |
| 112 | /* CAN identifier and CAN mask, bit aligned with CAN module. Different on different microcontrollers. */ |
| 113 | buffer->ident = ident & 0x07FFU; |
| 114 | if (rtr) { |
| 115 | buffer->ident |= 0x0800U; |
| 116 | } |
| 117 | buffer->mask = (mask & 0x07FFU) | 0x0800U; |
| 118 | |
| 119 | /* Set CAN hardware module filter and mask. */ |
| 120 | if (CANmodule->useCANrxFilters) {} |
| 121 | } else { |
| 122 | ret = CO_ERROR_ILLEGAL_ARGUMENT; |
| 123 | } |
| 124 | |
| 125 | return ret; |
| 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, |
no outgoing calls
no test coverage detected