Rev 2 | Rev 7 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
6 | mjames | 1 | // This file deals with looking up ignition timing |
2 | mjames | 2 | |
3 | #pragma once |
||
6 | mjames | 4 | #include "stdint.h" |
2 | mjames | 5 | |
6 | mjames | 6 | static const int TIMING_SCALE = 10; |
7 | static unsigned const MAX_TIMING_POINTS = 8; |
||
8 | static unsigned const MAX_VACUUM_POINTS = 8; |
||
2 | mjames | 9 | |
10 | #if defined __cplusplus |
||
6 | mjames | 11 | extern "C" |
12 | { |
||
2 | mjames | 13 | #endif |
6 | mjames | 14 | |
15 | /// @brief Get timing adjustment value |
||
16 | /// @return Timing adjustment value |
||
17 | uint8_t getTimingAdjust(); |
||
18 | |||
19 | /// @brief Set the timing adjustment value |
||
20 | /// @param adjust Timing value |
||
21 | void setTimingAdjust(int8_t adjust); |
||
22 | |||
23 | /// @brief Get timing map RPM column heading |
||
24 | /// @param i column number |
||
25 | /// @return Value at that position |
||
26 | int16_t getRpmMap(int i); |
||
27 | |||
28 | /// @brief Set the timing map RPM column heading |
||
29 | /// @param i column number |
||
30 | /// @param value Value to place at that position |
||
31 | void setRpmMap(int i, uint16_t value); |
||
32 | |||
33 | /// @brief Set vacuum mapping column heading (row actually) |
||
34 | /// @param i row number |
||
35 | /// @param value Value to place at that position |
||
36 | void setVacuumMap(int i, uint16_t value); |
||
37 | |||
38 | /// @brief Get vacuum mapping column heading (row actually) |
||
39 | /// @param i row number |
||
40 | uint16_t getVacuumMap(int i); |
||
41 | |||
42 | /// @brief Set the timing value |
||
43 | /// @param vacuumIndex |
||
44 | /// @param rpmIndex |
||
45 | /// @param value |
||
46 | void setTiming(int vacuumIndex, int rpmIndex, uint8_t value); |
||
47 | |||
48 | /// @brief Get the timing value |
||
49 | /// @param vacuumIndex |
||
50 | /// @param rpmIndex |
||
51 | /// @return value |
||
52 | uint8_t getTiming(int vacuumIndex, int rpmIndex); |
||
53 | |||
54 | /// @brief Lookup ignition timing |
||
55 | /// @param rpm Engine Speed in RPM |
||
56 | /// @param vacuumMb Ported vacuum in millibars of vacuum |
||
57 | /// @return Vacuum advance in degrees * TIMING_SCALE; |
||
58 | int mapTiming(int rpm, int vacuumMb); |
||
2 | mjames | 59 | #if defined __cplusplus |
60 | } |
||
61 | #endif |