OSS-ECAL stands for Open Source Software for Electronic Components Abstraction Layer. OSS-ECAL is a software layer aimed at streamlining software development for electronic components and improving the availability of electronic components, and is equipped with a software interface tailored to the characteristics of electronic components.
The programming language of OSS-ECAL is C.
Definition of Terms
Term | Definition |
---|---|
ABC | Temporary name of electronic component |
API | Application interface |
COMMAND | Tentative name of command Name after “eCMD_” declared in etCMD Rename member names to match electronic components |
e (prefix) | Enumerated type member-name |
et (prefix) | Enumerated type tag-name |
etCMD | Enumerated type definition for commands Rename member names to match electronic components |
etSTS | Enumerated type definition for status |
f | Floating-point |
HAL | Hardware Abstraction Layer (AUTOSAR MCAL) |
HALNAME | Tentative name of HAL For HALNAME, please refer to HAL Support. |
i | Integer Fixed-point (prefix) #define immediate |
oABC | API Function Name (Type of command passed as parameter) Rename member names to match electronic components |
oABC_COMMAND | API Function Name Rename member names to match electronic components |
OSS-ECAL | Open Source Software for Electronic Components Abstraction Layer |
READ | Reading from electronic components (receiving, in the case of communication) |
st (prefix) | Struct type tag-name |
stABC_I | Tentative name for argument types of API function inputs |
stABC_O | Tentative name for argument types of API function outputs |
WRITE | Writing to electronic components (send) |
WRITE_READ | 1. Writing to electronic components (send) 2. Read from electronic components (receive) |
API Function
In order to realize standard interfaces for electronic components and interfaces tailored to the characteristics of each electronic component, the API provides the following two types of API functions.
etSTS oABC( etCMD cmd, stABC_I dat, stABC_O* rlt )
This API function type passes commands as parameters.
Function name | oABC | API function name of ABC |
Return value | etSTS | OSS-ECAL status code |
Parameter IN | etCMD cmd | OSS-ECAL command code |
stABC_I dat | In data of ABC function | |
Parameter OUT | stABC_O* &rlt | Out data of ABC function |
Exe : Temperature sensor AD22100A manufactured by ROHM. ADC type
etSTS oAD22100A( etCMD, float32* );
void function(void)
{
float32 rlt; // Temperature[degrees Celsius]
// Output voltage of AD22100A is converted to AD and the result of temperature conversion is
// read into vgPHY (READ command)
etSTS sts = oAD22100A( eCMD_START_READ, &rlt );
}
etSTS oAD22100A( etCMD cmd, float32* rlt )
Return value | etSTS | OSS-ECAL status code | |
eSTS_FIN | Completed successfully | ||
eSTS_ERR_MIN | Minimum temperature error (rlt is minimum temperature) | ||
eSTS_ERR_MAX | Maximum temperature error (rlt is maximum temperature) | ||
eSTS_ERR_HAL_ADC | HAL ADC Error | ||
eSTS_ERR_COMMAND_CODE | Command selection error | ||
eSTS_ERR_OTHERS_RUN | Other components are executing the process | ||
eSTS_ERR_HAL_OTHERS_RUN | Other application is running HAL | ||
eSTS_ERR_ADC_OBJECT | AD conversion object selection error | ||
Parameter IN | etCMD cmd | OSS-ECAL command code | |
eCMD_START | Command to start AD conversion. | ||
eCMD_READ | Command that reads the AD conversion value, converts the AD conversion value to a characteristic Temperature, and stores the Temperature in rlt. AD conversion value to temperature conversion equation Voltage value = (AD conversion value × VDD) / ( 2AD bit ) Temperature = ((voltage value – voltage offset value) / gain) + Temperature offset value (Min, Max Limit) | ||
eCMD_START_READ | Command that starts AD conversion, waits for AD conversion to finish, reads out the AD conversion value, converts the AD conversion value to a characteristic Temperature, and stores the Temperature in rlt. AD conversion value to temperature conversion equation Voltage value = (AD conversion value × VDD) / ( 2AD bit ) Temperature = ((voltage value – voltage offset value) / gain) + Temperature offset value (Min, Max Limit) | ||
Parameter OUT | float32* rlt | Temperature -40 to 85 [°C] |
Command Correspondence Table by HAL
Arduino | eCMD_START_READ |
ARM Mbed | eCMD_START_READ |
AUTOSAR | – |
Debian(Linux) | eCMD_START_READ |
Infineon ModusToolbox | eCMD_START_READ |
NXP MCUXpresso MXRT1051B_1052B | eCMD_START eCMD_READ eCMD_START_READ |
Renesas SSP | eCMD_START eCMD_READ eCMD_START_READ |
STM STM32Cube FW_F4 | eCMD_START eCMD_READ eCMD_START_READ |
etSTS oABC_COMMAND( stABC_I dat, stABC_O* rlt )
This API function type specifies a command by function name. (Command API function)
Function name | oABC | API function name of ABC |
Return value | etSTS | OSS-ECAL status code |
Parameter IN | stABC_I dat | In data of ABC function |
Parameter OUT | stABC_O* rlt | Out data of ABC function |
Exe : Temperature sensor BD1020HFV manufactured by ROHM. ADC type
etSTS oAD22100A_READ( float32* );
void function(void)
{
float32 rlt; // Temperature[degrees Celsius]
// Output voltage of AD22100A is converted to AD and the result of temperature conversion is
// read into vgPHY (READ command)
etSTS sts = oAD22100A_READ( &rlt );
}
etSTS oAD22100A_READ( float32* rlt )
The oAD22100A_READ function is an API function that checks for the end of AD conversion, reads the AD conversion value, converts the AD conversion value to a characteristic temperature, and stores the temperature in rlt.
AD conversion value to temperature conversion equation
Voltage value = (AD conversion value × VDD) / ( 2AD bit )
Temperature = ((voltage value – voltage offset value) / gain) + Temperature offset value (Min, Max Limit)
Return value | etSTS | OSS-ECAL status code | |
eSTS_FIN | Completed successfully | ||
eSTS_ERR_MIN | Minimum temperature error (rlt is minimum temperature) | ||
eSTS_ERR_MAX | Maximum temperature error (rlt is maximum temperature) | ||
eSTS_ERR_HAL_ADC | HAL ADC Error | ||
eSTS_ERR_TIMEOUT | ADC Timeout error (AUTOSAR only) | ||
eSTS_ERR_OTHERS_RUN | Other components are executing the process | ||
eSTS_ERR_ADC_OBJECT | AD conversion object selection error | ||
Parameter OUT | float32* rlt | Temperature -40 to 85 [°C] |
Function Correspondence Table by HAL
Arduino | – | |
ARM Mbed | – | |
AUTOSAR | X | Time-out time ADC_TIMEOUT [us] setting |
Debian(Linux) | – | |
Infineon ModusToolbox | – | |
NXP MCUXpresso MXRT1051B_1052B | X | |
Renesas SSP | X | |
STM STM32Cube FW_F4 | X | Time-out time HAL_MAX_DELAY |
Files
The file structure of OSS-ECAL is as follows. The structure differs depending on the HAL, so please check the OSS-ECAL page for each electronic component.
Folder* | File | Summary |
---|---|---|
ABC_HALNAME_VERSION/sample | sample.c (.cpp) | Sample Application Program |
sample.h | Sample Application Header | |
ABC_HALNAME_VERSION | oABC.c (.cpp) | OSS-ECAL Program for ABC |
oABC.h | OSS-ECAL Header for ABC | |
ABC_ARDUINO.ino | Sample application programs for Arduino | |
oss_ecal.h | OSS-ECAL Common Header (Ver 01.00.00 or later, AUTOSAR is Ver 01.01.07 or later) | |
oTypes.h | Typedef header file for AUTOSAR | |
user_setting.c (.cpp) | Const and Table of User setting | |
user_setting.h | Header of User setting | |
readme.md | Readme | |
OSS-ECAL Terms of Use.txt | OSS-ECAL Terms of Use |
HAL Support
OSS-ECAL HAL support is as follows (expanding sequentially). Please check each electronic components OSS-ECAL page for HAL support.
HAL | MCU* | Development environment* | HALNAME |
---|---|---|---|
Arduino 1.8.6 | ATmega2560 ATmega328P | Mega 2560 Rev3 Arduino Pro Mini 3.3V | ARDUINO |
ARM Mbed 6.17.0 | STM32F401RE | STM32 Nucleo-64 boards | MBED |
AUTOSAR 4.4 (MCAL) | S32K144 | S32K144EVB-Q100 | MCAL |
Infineon ModusToolbox HAL Cat1 2.4.3 | CYBLE-416045-02 | CY8CPROTO-063-BLE PSoC 6 BLE Prototyping Kit | ModusToolbox |
NXP MCUXpresso SDK iMXRT1051B_1052B ksdk2_0 | MIMXRT1052DVL6A | IMXRT1050-EVKB | iMXRT1051B1052B |
Renesas SSP 2.4.0 | R7FS7G27H3A01CFC | S7G2 SK | SSP |
STM STM32Cube FW_F4 V1.27.1 | STM32F401RE | STM32 Nucleo-64 boards | STM32F4 |
Debian(Linux) v2022.04 | TI AM335x | BeagleBone Black – Rev C | Linux |
* MCU and development environment at the time of development. Even if the same HAL is used, different MCUs and development environments may not work together.
Built-in How to
How to incorporate OSS-ECAL into user programs
How to incorporate multiple OSS-ECALs in a user program (same MCU function)
How to incorporate multiple OSS-ECALs in a user program (different MCU function)
How to incorporate multiple identical electronic components into a user program
How to reduce the impact on user programs by replacing electronic components