Introduction
This is the introduction for CC26xx.
The CC26xx peripheral driver library from Texas Instruments® is a set of drivers for accessing the peripherals found on the CC26xx family of ARM® Cortex™-M3 based devices. While they are not drivers in the pure operating system sense (that is, they do not have a common interface and do not connect into a global device driver infrastructure), they do provide a mechanism that makes it easy to use the peripherals of the device.
The capabilities and organization of the drivers are governed by the following design goals:
- They are written entirely in C language except where absolutely not possible.
- They demonstrate how to use the peripheral in its common mode of operation.
- They are easy to understand.
- They are reasonably efficient in terms of memory and processor usage.
- They are as self-contained as possible.
- Where possible, computations that can be performed at compile time are done there instead of at run time.
- They can be built with more than one tool chain.
Some consequences of these design goals are:
- The drivers are not necessarily as efficient as they could be (from a code size and/or execution speed point of view). While the most efficient piece of code for operating a peripheral would be written in assembly language and custom tailored to the specific requirements of the application, further size optimizations of the drivers would make them more difficult to understand.
- The drivers do not support the full capabilities of the hardware. Some of the peripherals provide complex capabilities which cannot be used by the drivers in this library, though the existing code can be used as a reference upon which to add support for the additional features.
- The APIs have a means of removing all error-checking code. Because the error checking is usually useful only during initial program development, it can be removed to improve code size and speed.
For many applications the drivers can be used as is. But in some cases the drivers must be enhanced or rewritten to meet the functionality, memory, or processing requirements of the application. If so, the existing driver can be used as a reference on how to operate the peripheral.
The driver library includes drivers for all devices in the CC26xx family.
Source Code Overview
A brief overview of the organization of the peripheral driver library source code follows:
driverlib/
- This directory contains the source code for the drivers. The API of each module consists of a .c file and a .h file.
inc/
- This directory contains the header files used for the direct register access programming model. The hw_*.h header files, one per peripheral, describe all the registers and the bit fields within those registers for each peripheral. These header files are used by the drivers to directly access a peripheral, and can be used by application code to bypass the peripheral driver library API.