Arm Community
Arm Community
  • Site
  • User
  • Site
  • Search
  • User
  • Groups
    • Arm Research
    • DesignStart
    • Education Hub
    • Graphics and Gaming
    • High Performance Computing
    • Innovation
    • Multimedia
    • Open Source Software and Platforms
    • Physical
    • Processors
    • Security
    • System
    • Software Tools
    • TrustZone for Armv8-M
    • 中文社区
  • Blog
    • Artificial Intelligence
    • Automotive
    • Healthcare
    • HPC
    • Infrastructure
    • Innovation
    • Internet of Things
    • Machine Learning
    • Mobile
    • Smart Homes
    • Wearables
  • Forums
    • All developer forums
    • IP Product forums
    • Tool & Software forums
    • Pelion IoT Platform
  • Activity
  • Support
    • Open a support case
    • Documentation
    • Downloads
    • Training
    • Arm Approved program
    • Arm Design Reviews
  • More
  • Cancel
System
  • Developer Community
  • IP Products
  • System
  • Jump...
  • Cancel
System
Embedded blog PSoC 6 Components and PDL Drivers
  • Blogs
  • Forums
  • Videos & Files
  • Mentions
  • Sub-Groups
  • Tags
  • Jump...
  • Cancel
  • New
More blogs in System
  • Embedded blog

  • SoC Design blog

Tags
  • cypress
Actions
  • RSS
  • More
  • Cancel
Related blog posts
Related forum threads

PSoC 6 Components and PDL Drivers

Mark Saunders
Mark Saunders
June 16, 2017

[re-printed from Cypress Developer Community by Jim Trudeau - to learn more about PSoC 6 join the Cypress PSoC 6 EAP Community]

In this article I want to go a bit deeper into the difference between using a PSoC Creator component, and using the PDL directly. Most PSoC 6 peripherals have a corresponding PSoC Creator Component. You drag the Component into your design and configure it inside PSoC Creator. Based on your design and configuration, PSoC Creator generates the code required to configure the peripheral. It generates an API for that specific component. All of this is unchanged for PSoC 6 and the PDL.

Here's what's new. The PSoC 6 Component is built on top of the PDL.

In the past, the Component API was the only option. For PSoC 6, the Component API uses the PDL. PDL 3.0 is a separate entity. That means you have a choice. You can use the Component API, or you can use the PDL API directly. The PDL is designed to work with, or without, PSoC Creator.

Here’s an example. Your PSoC Creator design might include a PWM component, which you could name “MyPWM.” You would at some point write code modify the compare value in the PWM to change the duty cycle. Here’s the Component API code that sets the compare value for that Component.

Notice that the generated Component API calls the PDL API. Let’s start with the PDL API call. This function has three parameters. The first is the base hardware address for the peripheral. (Read PDL 3.0 - Designed for Flexibility to learn about base hardware addresses.) Because the PWM actually has multiple counters, you also specify which counter to use. And of course there is the actual compare value.

By contrast, the Component API call has only one simple parameter: the value. That’s because PSoC Creator “knows” which base hardware address to use, and which counter, based on the system design and pin assignments you set up in the tool.

These two APIs, Component and PDL, are fully compatible. You can mix and match as you see fit. The Component API is often simpler, but adds a level of indirection (a function call to make a function call). In many cases the overhead is trivial or non-existent, and might even be optimized away. In other cases it might be more significant.

The table summarizes some of the key differences.

There is absolutely no requirement to use PSoC Creator. If you do not use PSoC Creator, then you make PDL API function calls directly, providing all parameters. You get the Component API whenever you use PSoC Creator to generate code. You can use it even if you import the code into your preferred IDE.

One neat thing about the Component API in the generated code is that it is often just a wrapper on top of the PDL API. Even if you don’t want to use PSoC Creator as a production tool, you can use it as a learning tool. You will be able to explore the generated code to see how it makes PDL function calls, and learn how to use the PDL effectively.

Anonymous
Embedded blog
  • Embedded blog: Development of Arm based systems with Synopsys Virtual Prototyping: Anytime, Anywhere!

    Jason Andrews
    Jason Andrews
    Find out more about virtual prototyping from Synopsys as thousands of engineers around the world have been asked to work from home.
    • May 5, 2020
  • Embedded blog: Accelerating Innovation for Safety Systems with Arm Flexible Access

    Chet Babla
    Chet Babla
    Arm is proud to announce the addition of Arm Safety Packages for select IP within Arm Flexible Access, with the goal to make it easier for developers in the automotive and other safety-related industries…
    • February 19, 2020
  • Embedded blog: Functional Safety on Arm – Beyond Automotive

    Antonio Priore
    Antonio Priore
    Arm has moved a long way from the days where our only ‘safety’ requirement was to provide ECC or parity protections on CPU RAMs and we are now able to offer a number of System IP, GPUs, ISPs and NPUs as…
    • December 13, 2019