rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
rusefi_types.h
Go to the documentation of this file.
1/**
2 * @file rusefi_types.h
3 *
4 * @date Jan 12, 2015
5 * @author Andrey Belomutskiy, (c) 2012-2020
6 */
7
8#pragma once
9
10#include <string.h>
11#include <stdbool.h>
12#include <float.h>
13#include <stdint.h>
14#include <sys/types.h>
15
16#include <board_types.h>
17#include <rusefi/rusefi_time_types.h>
19#include "rusefi_enums.h"
20#include "firing_order.h"
21
22#if __cplusplus
23#include "efi_scaled_channel.h"
24#endif
25
26#define TWO_STROKE_CYCLE_DURATION 360
27#define FOUR_STROKE_CYCLE_DURATION 720
28
29// gasoline E0
30// todo: some usages should be migrated to getStoichiometricRatio()
31#define STOICH_RATIO 14.7f
32#define CONST_PI 3.14159265358979323846
33
34/**
35 * integer time in milliseconds (1/1_000 of a second)
36 * 32 bit 4B / 1000 = 4M seconds = 1111.11 hours = 23(or46?) days.
37 * Please restart your ECU every 23(or46?) days? :) See issue https://github.com/rusefi/rusefi/issues/4554 tag#4554
38 * See getTimeNowUs()
39 */
40using efitimems_t = uint32_t;
41
42using efidur_t = efitick_t;
43
44// date-time struct a la ctime struct tm
46 uint32_t year{};
47 uint8_t month{};
48 uint8_t day{};
49 uint8_t hour{};
50 uint8_t minute{};
51 uint8_t second{};
52 // uint16_t millisecond;
53};
54
55using angle_t = float;
56
57using engineSyncCam_e = uint8_t;
58
59// mass in grams
60using mass_t = float;
61
62// temperature, in Celsius
66
67/**
68 * numeric value from 0 to 100
69 */
71
72using lua_script_t = char[LUA_SCRIPT_SIZE];
73
74using warning_message_t = char[WARNING_BUFFER_SIZE];
75
76using vehicle_info_t = char[VEHICLE_INFO_SIZE];
77
78using vin_number_t = char[VIN_NUMBER_SIZE];
79
80using gppwm_note_t = char[GPPWM_NOTE_SIZE];
81
83
84using egt_cs_array_t = brain_pin_e[EGT_CHANNEL_COUNT];
85
86using pwm_freq_t = int16_t;
87
88// special type to represent voltage as if it was readed by 10bit ADC with 5V reference
89// also see convertVoltageTo10bitADC()
90using tps_limit_t = int16_t;
91
93
Fundamental rusEFI enumerable types live here.
Gpio brain_pin_e
uint32_t efitimems_t
int16_t pwm_freq_t
float floatms_t
uint8_t engineSyncCam_e
efitick_t efidur_t
float mass_t
char[LUA_SCRIPT_SIZE] lua_script_t
char[VIN_NUMBER_SIZE] vin_number_t
char[WARNING_BUFFER_SIZE] warning_message_t
float angle_t
char[VEHICLE_INFO_SIZE] vehicle_info_t
int16_t tps_limit_t
float percent_t
brain_pin_e[EGT_CHANNEL_COUNT] egt_cs_array_t
char[GPPWM_NOTE_SIZE] gppwm_note_t
float temperature_t
uint32_t year