metaonly module ti.mcu.msp430.driverlib.product.DriverLib

MSP430 Low-Level Peripheral Driver Support Library

DriverLib provides low-level peripheral functions that enables simple and efficient control of peripherals found on the MSP430. The functions are provided in source form to allow maximum reuse in a variety of development environments. [ more ... ]
Configuration settings sourced in ti/mcu/msp430/driverlib/product/DriverLib.xdc
var DriverLib = xdc.useModule('ti.mcu.msp430.driverlib.product.DriverLib');
module-wide functions
 
DETAILS
DriverLib provides low-level peripheral functions that enables simple and efficient control of peripherals found on the MSP430. The functions are provided in source form to allow maximum reuse in a variety of development environments.
This module provides the "home page" for DriverLib within the Grace graphical configuration editor. This enables projects that support graphical configuration to easily integrate with DriverLib. In particular, for these projects
  • DriverLib sources are automatically compiled for your specific device
  • compiler and linker options are automatically added, and
  • you can easily switch between different versions of DriverLib on a per-project basis
This support makes it simple to create Code Composer Studio (CCS) projects that enable you to easily build and manage specific versions of pre-built DriveLib libraries. These pre-built libraries can then be referenced by one or more of your existing projects.
USING DRIVERLIB
Using DriverLib is a simple three step process.
  1. modify your .c sources to include the appropriate peripheral header file and call the desired function.
  2. modify your compiler project options to include the directory containing the DriverLib product's root directory.
  3. modify your linker project options to include the path to a pre-built library of the appropriate DriverLib sources.
Suppose, for example, you want to use the WDT_A watchdog timer functions of DriverLib. Your source might be modified to look like the following:
      #include <driverlib/MSP430FR57xx/wdt_a.h>     // include header for the WDT_A peripheral

      int main(void) {
          WDT_A_hold(__MSP430_BASEADDRESS_WDT_A__); // disable the WDT_A watchdog timer
             :
          return (0);
      }
If you're using Code Composer Studio (CCS), DriverLib automatically defines a "macro", named ${MSP430_DRIVERLIB_ROOT}, that should be used to specify include paths. This ensures that your projects are portable among users that may have different installation directories. In this case, your compiler include options should include:
      -I ${MSP430_DRIVERLIB_ROOT}
Finally, suppose you're created a project named driverlib_5739 which contains a pre-built DriverLib library for the MSP430FR5739. Your linker options should include:
      -l "${workspace_loc:/driverlib_5739/src/driverlib/driverlib.lib}"
where, ${workspace_loc: ...} is an Eclipse/CCS macro that expands to an absolute path to the file src/driverlib/driverlib.lib located in the project named driverlib_5739. Again, using the Eclipse ${...} macros enables projects to be directly imported by other developers even if they have different workspace or product installation paths.
BUILDING DRIVERLIB
If you are using Code Composer Studio (CCS), it is easy to build a library for a specific device.
  1. Create a new project: File -> New -> CCS Project
  2. Select a device and a project name, say MSP430FR5739 and "driverlib_5739"
  3. In the "Project templates and examples" selection box, select the "Configurable DriverLib Example" template under the "MSP430 DriverLib" heading. If you don't see this heading, the device you selected is not supported by DriverLib.
  4. Click the "Finish" button. A new project named driverlib_5739 will be created and added to your workspace.
  5. Build the project: Project -> Build Project
Once the project is finished building, a complete DriverLib library, named driverlib.lib, will exist in the ./src/driverlib folder of the project and can be referenced by any other project in your workspace via the Eclipse/CCS macro:
      ${workspace_loc:/driverlib_5739/src/driverlib/driverlib.lib}
 
DriverLib.getFamilyPath()  // module-wide

Given a device name, return the path to the device family's sources

Configuration settings
DriverLib.getFamilyPath(String deviceName) returns String
 
DETAILS
This function returns a path relative to the DriverLib source repository containing the DriverLib sources. For example, if deviceName is "MSP430FR5969", this function returns "driverlib/MSP430FR5xx_6xx".
The string returned by this function can be used with getSrcRepo to obtain the absolute path to the sources for the DriverLib family that supports the device deviceName.
SEE
 
DriverLib.getSrcRepo()  // module-wide

Given a family path, return the path to it's source repository

Configuration settings
DriverLib.getSrcRepo(String familyPath) returns String
 
DETAILS
This function returns an absolute path to the repository containing the DriverLib sources for the specified device family.
SEE
generated on Thu, 27 Feb 2020 18:39:55 GMT