• Sourcy

    Sourcy - 2014-06-15


    Is there any documentation on the lib_io code. Documentation for the serial and so on. Would make my life alot easier if there was documentation instead of reading through the code to understand how tk use it.

  • Sourcy

    Sourcy - 2014-06-15

    I was wondering if there is a callback implementation of the serial drivers

  • Phillip Stevens

    Phillip Stevens - 2014-06-16

    Hi Sourcy,
    no there isn't a callback implementation for the USART drivers.

    The lib_io code is pretty self explanatory. There are many comments in the header files, and the simple example projects show how to use the code.

    First, the servoPWM code is not well developed. It was designed to drive the retrograde clock project servos, and so is not general purpose. You probably want to build your own version, if you have servos to drive.

    The SPI code is pretty solid, and the multi-byte code option is about as fast as SPI can be on an AVR. Again, almost every example uses this code, so the usage is pretty straight forward and easy to follow from the examples.

    The I2C code has been integrated from the two demonstration examples given by AVR, and therefore is pretty well described. Have a look at the AVR I2C documents and you'll find examples for Master and Slave usage. My code puts both capabilities into one code base. I use I2C to communicate between two AVR MCU (in the Peggy examples), so I needed to have both alternatives in one code base.

    The USART code was originally derived from example routines provided by freeRTOS using the Queue mechanism. When I converted them to use fast ring buffers I didn't change the calling mechanism, because I have too many projects using the existing calling standards. One key thing is NOT to use the avrSerial code when the freeRTOS scheduler is running. It uses polling and will disrupt proper operation. Always use the xSerial code for normal operations. Again the code is pretty simple to use, follow the simple examples to see the calling conventions.

    Good luck.

    Last edit: Phillip Stevens 2014-06-16

Log in to post a comment.