[ASF] Unhelpful name & description: USART_CALLBACK_BUFFER_TRANSMITTED

1 post / 0 new
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Stupid forum has no ASF section for ARM - where it is most applicable.

Only for AVR - where it is largely irrelevant!




Anyhow, the name & description of USART_CALLBACK_BUFFER_TRANSMITTED are unhelpful:


USART callback enum.

Callbacks for the Asynchronous USART driver.



Callback for buffer (sic)  transmitted.




This is fine when using usart_read_buffer_job() - but what is one supposed to do when using usart_read_job() ??


We can guess that it actually applies to both - but then have to mess about with an experiment to verify the guess.


Of course, we can dig into the source code and find that usart_read_job() is just a call to _usart_read_buffer() with a length of 1 - but that's not the point.


The point is that the documentation should be clear & explicit - the user should not have to guess and/or reverse-engineer the code to make sense of it!




Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...