Jump to main content

##

# 1.2 System Service Libraries

MPLAB Harmony provides system service libraries to support common functionality and manage resources that are shared by multiple drivers, libraries, and other modules.

A system service encapsulates code that manages a shared resource or implements a common capability in a single location so that it does not need to be replicated by individual drivers and libraries. This feature eliminates duplicated code and creates consistency across all modules, and also helps to eliminate potential conflicts and complex configuration issues and runtime interactions, resulting in a smaller and simpler overall solution.

System services may directly manage one or more peripherals or core processor capabilities by utilizing peripheral libraries, special function registers, special CPU instructions, or coprocessor registers. Some system services may utilize drivers, other system services, or even entire middleware stacks to share or emulate a common resource.

System services may be implemented statically (possibly generated by the MPLAB Harmony Configurator (MHC)) or dynamically to support multiple channels and instances like a driver. However, system services will not normally provide common Open and Close functions like a driver.

In general, the distinguishing feature of a system service is that it implements a common capability that would otherwise "cut horizontally" across multiple modules in a system, causing interoperability and compatibility conflicts if the capability were implemented by other libraries.

System service functions use the following naming convention:

SYS_<module-abbreviation>_<operation>

Where,

- SYS_ indicates that this is a system service function

- <module-abbreviation> is the abbreviated name of the system service module to which this function belongs

- is an optional short (or shortened) name that identifies the feature of the associated system service module to which this function refers. The feature short name will appear in the name of all functions that interact with or provide access to that particular feature.

- <operation> is a verb that identifies the action taken by the function.

For example, SYS_TIME_TimerStart, where:

- <module-abbreviation> = TIME, which indicates that this is a Time System Service function

- <feature-short-name> = Timer, which indicates that this function controls the Time feature of the Timer System Service

- <operation> = Start, which indicates that this function starts the software timer created with Time System Service.

Below are the System Service libraries that are available in MPLAB Harmony 3 Core