Product Overview
OpenECU and OpenECU-FS Developer Platform C-API, including a library and all of the software environment to develop C applications, to be built and run on OpenECU Hardware. Our C-API enables you to access all the functionality of the ECU. It also enables you to integrate your own existing code. Available for all 32-bit OpenECUs.
- Program your application in C
- Integrate your legacy code
- Define your scheduling on our RTOS
- Generate strategy and calibration files with one command.
- Execute and tune
All interactions with the ECU are performed using a simple API in C. Such interactions include:
- Reading inputs:
- Analog
- Digital
- Frequency
- PWM
- Inertial sensors
- Setting outputs:
- Analog
- Digital
- PWM
- Complex drivers (peak and hold, saturating, constant current, etc.)
- Send and recieve messages over CAN
- Store or retrieve data from non-volatile memory
All memory management, and real-time task scheduling is handled by the OpenECU and OpenECU-FS operating system.
Interactions with with the OpenECU and OpenECU-FS developer platform are shown in the following examples.
H-bridge output example:
/* Drive the hbridge. */ a30_a1_rc = pdx_hbridge_output(PIO_HBOT_A30_A1, mbec_hbridge_mode, mbec_hbridge_freq_A30_A1, mbec_hbridge_dc_A30_A1, &hbridge_last_mode, FALSE);
Analog input example:
S16 raw_adc;
/* Read the raw state of the analog input channel. Ignore the * return code. */ (void) pax_adc_input(PIO_AIN_A19, &raw_adc, FALSE);
/* store the analog input to the control software variable */ mbe_ai_a19 = raw_adc * ADC_COUNTS_TO_VOLTS;
Much like low-level drivers, controls engineers would be better served by not having to worry about legislated diagnostic services. The OpenECU optional OBD feature provides a turn-key solution for legislated OBD fault management and service tool communication. Using simple APIs, the OpenECU OBD library handles faults, in-use performance ratios, parameter and test reporting, routine control, and many other features of the OBD standards, including standard communication protocols.
OBD example:
/* Set the DTC as active */ pdtc_update_iso_dtc(&dtc_a_j1939_1234_iso_x1234, PDTC_STATE_ACTIVE);
/* Update the engine RPM PID */ ppid_update_pid(pid_engine_rpm_hdl, (U8*) &stp_eng_rpm_meas_integer);
/* Update counters */
/* Warm-up TRUE */ pdtc_plat_obd_update_wup_count(TRUE); / Update denominator ppr_update_gen_denominator(TRUE);
/* Determine if a $31 diagnostic routine has been requested */ rc = pdg_get_routine_rqst(pdg_routine1_hdl, &routine_rqst, options);