Rev 7 | 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" |
| 12 | mjames | 5 | #include "libIgnTiming/basemap.h" |
| 2 | mjames | 6 | |
| 7 | #if defined __cplusplus |
||
| 6 | mjames | 8 | extern "C" |
| 9 | { |
||
| 2 | mjames | 10 | #endif |
| 6 | mjames | 11 | |
| 12 | mjames | 12 | |
| 6 | mjames | 13 | /// @brief Get timing adjustment value |
| 14 | /// @return Timing adjustment value |
||
| 15 | uint8_t getTimingAdjust(); |
||
| 16 | |||
| 17 | /// @brief Set the timing adjustment value |
||
| 18 | /// @param adjust Timing value |
||
| 19 | void setTimingAdjust(int8_t adjust); |
||
| 20 | |||
| 21 | /// @brief Get timing map RPM column heading |
||
| 22 | /// @param i column number |
||
| 23 | /// @return Value at that position |
||
| 7 | mjames | 24 | int16_t getRpmMap(unsigned int i); |
| 6 | mjames | 25 | |
| 26 | /// @brief Set the timing map RPM column heading |
||
| 27 | /// @param i column number |
||
| 28 | /// @param value Value to place at that position |
||
| 7 | mjames | 29 | void setRpmMap(unsigned int i, uint16_t value); |
| 6 | mjames | 30 | |
| 31 | /// @brief Set vacuum mapping column heading (row actually) |
||
| 32 | /// @param i row number |
||
| 33 | /// @param value Value to place at that position |
||
| 7 | mjames | 34 | void setVacuumMap(unsigned int i, uint16_t value); |
| 6 | mjames | 35 | |
| 36 | /// @brief Get vacuum mapping column heading (row actually) |
||
| 37 | /// @param i row number |
||
| 7 | mjames | 38 | uint16_t getVacuumMap(unsigned int i); |
| 6 | mjames | 39 | |
| 40 | /// @brief Set the timing value |
||
| 41 | /// @param vacuumIndex |
||
| 42 | /// @param rpmIndex |
||
| 43 | /// @param value |
||
| 12 | mjames | 44 | void setTiming(unsigned int vacuumIndex, unsigned int rpmIndex, uint8_t value); |
| 6 | mjames | 45 | |
| 46 | /// @brief Get the timing value |
||
| 47 | /// @param vacuumIndex |
||
| 48 | /// @param rpmIndex |
||
| 49 | /// @return value |
||
| 7 | mjames | 50 | uint8_t getTiming(unsigned int vacuumIndex, unsigned int rpmIndex); |
| 6 | mjames | 51 | |
| 52 | /// @brief Lookup ignition timing |
||
| 53 | /// @param rpm Engine Speed in RPM |
||
| 12 | mjames | 54 | /// @param vacuumMb Ported vacuum in millibars of vacuum : between about 0 and 700 usually |
| 6 | mjames | 55 | /// @return Vacuum advance in degrees * TIMING_SCALE; |
| 56 | int mapTiming(int rpm, int vacuumMb); |
||
| 12 | mjames | 57 | |
| 58 | /// @brief Set the base timing map |
||
| 59 | /// @param map Pointer to timing map table |
||
| 60 | void setBaseMap(timingTable_t *map); |
||
| 61 | |||
| 2 | mjames | 62 | #if defined __cplusplus |
| 63 | } |
||
| 64 | #endif |