Peripheral Drivers(Non Autosar)

ADC peripheral software stack explanation using NXP S32K144 MCU

Overview and motive

  1. To get to know what ADC driver and its features is is.
  2. To Understand How to use ADC Driver (software environment setup and chronology in software configuration)).
  3. ADC Driver GUI explanation for configuring ADC Peripheral.
  4. Relation of functions of ADC Driver functions via ADC peripheral features/registers.
  5. In Depth Understanding of ADC driver functions/data types, with questions like What and why?
  6. Chronology of APIs for using basic features of ADC Peripheral for doing CAN communication (How and When?)

By basic features we mean the ADC conversion using Software trigger through interrupts.

What is ADC Driver

ADC Driver are set of libraries which are used for using ADC peripheral to do Analog to Digital values conversion via NXP S32K1xx Microcontrollers. Here by library, we mean a set of .h and .c files written in c language.

These set of ADC libraries are:

  1. Library of ADC Peripheral Hardware registers.
  2. Library for ADC Peripheral Interrupt Handlers.
  3. Library for ADC peripheral API’s.
  4. Miscellaneous files for ADC.

The first one contains the function and data types through which different features of FlexCAN peripheral are used. Features like of sending data, receiving data, configuring message id filter table and etc. It contains functions like: FlexCAN_IP_Send(). FlexCAN_IP_receive, FlexCAN_IP_RXFIFO and etc.

The Second one also contains the functions and data types through which FlexCAN Peripheral registers. Are accessed. Kind of like Bare Metal codes of FlexCAN peripheral are written in this files. And the Functions of this file are used by FlexCAN_Ip.h/.c files.

Third one contains the function definition and data types for for IRQ handler of FlexCAN Peripheral

And the last one contains the misceeleneours Data types and macros for using flexCAN peripheral.

In our application code, we are just going to add FlexCAN_Ip.h header file to access the FlexCAN Driver in our code.

And these files are located in the root directory of S32 DS where software installtion of RTD package takes place.

ADC Driver and Code Configuratin tool relation

Software to install to use FlexCAN Peripheral Driver

To use ADC Peripheral Driver, we need to install following things in your Host Desktop/PC:

  1. S32 Design Studio IDE 3.4 or 3.5 (any will work though here; we are going to use S32 Design Studio 3.4)
  2. S32K1 Real Time Drivers Version 1.0.0

S32 Design Studio 3.4

 

S32K1 Real Time Drivers Version 1.0.0

S32K1 RTD V1.0.0 is Software Stack for using NXP S32K1xx microcontrollers. It Contains Peripheral Driver library files for using the S32K1xx microcontroller peripherals. It supports all peripherals of S32K1xx MCU’s.  This Software Stack contains 2 packages:

  1. Autosaur MCAL layer complaint and standard based peripheral driver files for S32K1xx MCU’s. It is Autosar 4.4.0 complaint.
  2. Non-Autosar based peripheral driver files for S32K1xx MCU’s.  It is a collection of peripheral drivers designed to simplify and accelerate application development on NXP microcontrollers.

From Learning point of view and long-term skill development, having handson with Autosaur MCAL layer based peripheral driver file would be a good starting point. But as a fresher it might be more challenging to start with autosar standard. So 

In this blog, we are going to explore Non-Autosar based peripheral driver for FlexCAN module.  Further once having basic Handson with Non-Autosar, will explore Autosar MCAL layer based peripheral driver.

Refer to this blog/video to get to know how to install S32 Design Studio 3.4 and Install S32K1 Real Time Drivers v1.0.0. Also it is recommended to explore Code Configuration Tool and Project Creation Modules of S32 Design Studio IDE, so as to get understanding how to use S32 Design Studio throughout the learning cycle.

How to use ADC Peripheral Driver

GUI Configuration of FlexCAN Peripheral Driver

ADC Important API's

  • Adc_Ip_Init():
  • Adc_Ip_DoCalibration():
  • Adc_Ip_StartConversion():
  • Adc_Ip_GetConvActiveFlag():
  • Adc_Ip_GetConvCompleteFlag():
  • Adc_Ip_GetConvData():
  • Adc_0_Isr ():
  • ADC_CallBack()
Kunal Gupta
Author: Kunal Gupta

Author

Kunal Gupta

Leave a comment

Stay Updated With Us

Error: Contact form not found.

      Blog