Rev 2 | Rev 7 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 2 | Rev 6 | ||
|---|---|---|---|
| Line 1... | Line 1... | ||
| 1 | // This file deals with looking up ignition timing |
1 | // This file deals with looking up ignition timing |
| 2 | - | ||
| 3 | - | ||
| 4 | 2 | ||
| 5 | #pragma once |
3 | #pragma once |
| - | 4 | #include "stdint.h" |
|
| 6 | 5 | ||
| 7 | #define TIMING_SCALE 10 |
6 | static const int TIMING_SCALE = 10; |
| - | 7 | static unsigned const MAX_TIMING_POINTS = 8; |
|
| - | 8 | static unsigned const MAX_VACUUM_POINTS = 8; |
|
| 8 | 9 | ||
| 9 | #if defined __cplusplus |
10 | #if defined __cplusplus |
| 10 | extern "C" { |
11 | extern "C" |
| - | 12 | { |
|
| 11 | #endif |
13 | #endif |
| - | 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 | ||
| 12 | /// @brief Lookup ignition timing |
54 | /// @brief Lookup ignition timing |
| 13 | /// @param rpm Engine Speed in RPM |
55 | /// @param rpm Engine Speed in RPM |
| 14 | /// @param vacuumMb Ported vacuum in millibars of vacuum |
56 | /// @param vacuumMb Ported vacuum in millibars of vacuum |
| 15 | /// @return Vacuum advance in degrees * TIMING_SCALE; |
57 | /// @return Vacuum advance in degrees * TIMING_SCALE; |
| 16 | int mapTiming(int rpm, int vacuumMb); |
58 | int mapTiming(int rpm, int vacuumMb); |
| 17 | #if defined __cplusplus |
59 | #if defined __cplusplus |
| 18 | } |
60 | } |
| 19 | #endif |
61 | #endif |