This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

what is the difference between utils and driverlib?

I saw this code

#include <stdint.h>
#include <stdbool.h>
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "driverlib/gpio.h"
#include "drivers/pinout.h"
#include "driverlib/pin_map.h"
#include "driverlib/rom.h"
#include "driverlib/rom_map.h"
#include "driverlib/sysctl.h"
#include "driverlib/uart.h"
#include "utils/uartstdio.h"

there is utils.uart and driverlib/uart can any one tell me the difference?

Thanks

Shan

  • Shan Cao said:
    there is utils.uart and driverlib/uart can any one tell me the difference?

    There is "utils/uartstdio.c" (and not "utils/uart.c") and "driverlib/uart.c".

    From what I understand:

    - "driverlib/uart.c" contains basic and simple functions to drive the UART (like to configure it, to enable/disable it, to verify when it's busy or not, ...).

    Often, the tasks of these functions consist only in reading and writing certain registers in "direct access mode", using the "HWREG" macro.

    - "utils/uartstdio.c" contains more complex functions to provide simple console functions.

    Often, these functions contains (in their bodies) "driverlib/uart.c" simpler functions, and never the opposite.

  • @Rainbow,

    That's quite a good summary - poster should be pleased.
    Perhaps we should add that this vendor is quite good in supplying (almost always) the "full source code" for each function. Poster's review of that source code will answer many of his current (and future) questions - and provide greater insights into, "What's inside the tech box."