AutoSAR Series Explanation (Introduction) 4.2-BSW I/O Function

1. Architecture and Terminology Explanation


This is mainly about the I/O function, and some modules will be used in it. The modules I will use in the following way are highlighted, and enlarged to the right to show the sub-modules (this sub-module is the BSW in the The smallest unit, such as the ADC sub-module). The point to be emphasized here is: I/O is not the GPIO we often say, the I/O here includes DIO (digital input and output, which is equivalent to GPIO on the microcontroller), ADC and PWM

 

Below I will explain in detail the functions of the above sub-modules:

  • I/O Signal Interface: preliminary processing of input data, such as input debounce
  • Driver for ext. ADC ASIC: External ADC driver, for example, when there is an external ADC sampling chip, the data is transmitted to the main chip through SPI communication. Here you need a driver module for external ADC processing
  • Driver for ext. I/O ASIC: Same as above, but here is I/O
  • SPI Handler: SPI processing driver, which encapsulates the SPI in the hardware into an API for upper layer calls (some use I2C, which will not be listed separately here, just change the SPI in the figure to I2C)
  • ADC PWM DIO: The driver in MCAL encapsulates the ADC, PWM, and DIO in the hardware into APIs for upper layer calls
  • SPI ADC PWM DIO (Hardware): refers to these functional modules in the chip

It is worth mentioning that I/OHwAb requires handwritten code (of course, it can also be generated by Matlab. The handwritten code here refers to non-AutoSAR code, which needs to be added by ourselves). In DaVinci, you can apply for a SWC declaration as IOHwAb as A c file, add code in it (to put it bluntly, it is used as SWC).

Two, give an example


For example: the process of sending temperature data from the temperature sensor in the car and being processed by the ECU


In the picture above:

  • Adc_ReadGroup is an API function that MCAL opens to the upper layer. Read is the ADC sampling value (for example, the maximum precision of 12 bits is 4095)
  • Get_SensorValue is a service function written in IoHwAb, Sensor

        SWC and IoHwAb are connected through C/S, Sensor
        SWC can call the whole function through Rte_Call_Get_<port>_SensorValue. The main function of this function is to calculate the actual sensor resistance (how many ohms) through the ADC sampling value

  • Send_Temperature is to pass the tree in Sensor SWC to App SWC, in Sensor

        Ohm values ​​can be calculated into actual temperature values ​​in SWC. In this way, the final App
        SWC gets the actual temperature value

Guess you like

Origin blog.csdn.net/qq_42700289/article/details/131474363