michallenc opened a new pull request, #12656:
URL: https://github.com/apache/nuttx/pull/12656

   ## Summary
   
   ### can: enhance API to allow better CAN FD handling
   
   This commit moves `can_bytes2dlc` and `can_dlc2bytes` from kernel internal 
functions to API. These functions are necessary to convert bytes to dlc for CAN 
FD frames and has to be accessible from the application since `can_hdr_s` does 
not store message length in bytes but directly in dlc.
   
   ### can: enhance bit timing ioctl to set both nominal and data bit timing 
   
   This adds field type to `canioc_bittiming_s` structure that allows to 
set/obtain bit timing for both CAN CC and CAN FD. `CANIOC_GET_BITTIMING` is now 
bidirectional: user specifies type field and gets other fields from the 
controller.
   
   The commit also updates current CAN FD capable controllers using the ioctl. 
The type is not checked for classical CAN only controllers and nominal bit 
timing is returned regardless of type value. 
   
   ### samv7: fix CAN FD configuration
   
   Larger RX/TX buffers might be required for both FD and FD_BSW modes. Default 
bit timing values are also changed since the original ones did not provide 
correct results for default SAMv7 board clock selection (150 MHz clock 
frequency). The current values provide correct bit timing with sample point as 
close to 87.5 %.
   
   ## Testing
   
   Tested on SAMv7 custom board against SocketCAN Linux stack and RTEMS CAN FD 
stack.  CAN FD frames both with and without bit rate switch now works on SAMv7.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to