Speeduino
Loading...
Searching...
No Matches
pages.h
Go to the documentation of this file.
1#pragma once
2#include <Arduino.h>
3#include "table3d.h"
4
9
14
15// These are the page numbers that the Tuner Studio serial protocol uses to transverse the different map and config pages.
16#define veMapPage 2
17#define veSetPage 1 //Note that this and the veMapPage were swapped in Feb 2019 as the 'algorithm' field must be declared in the ini before it's used in the fuel table
18#define ignMapPage 3
19#define ignSetPage 4//Config Page 2
20#define afrMapPage 5
21#define afrSetPage 6//Config Page 3
22#define boostvvtPage 7
23#define seqFuelPage 8
24#define canbusPage 9//Config Page 9
25#define warmupPage 10 //Config Page 10
26#define fuelMap2Page 11
27#define wmiMapPage 12
28#define progOutsPage 13
29#define ignMap2Page 14
30#define boostvvtPage2 15
31
32// ============================== Per-byte page access ==========================
33
37byte getPageValue( byte pageNum,
39 );
40
44void setPageValue( byte pageNum,
46 byte value
47 );
48
49// ============================== Page Iteration ==========================
50
51// A logical TS page is actually multiple in memory entities. Allow iteration
52// over those entities.
53
54// Type of entity
56 Raw, // A block of memory
57 Table, // A 3D table
58 NoEntity, // No entity, but a valid offset
59 End // The offset was past any known entity for the page
60};
61
62// A entity on a logical page.
64 void *pData;
66 uint8_t page; // The page the entity belongs to
67 uint16_t start; // The start position of the entity, in bytes, from the start of the page
68 uint16_t size; // Size of the entity in bytes
70};
71
77
82
87
92
97
Iterate over table axis elements.
Definition table3d_axes.h:28
Iterate through a tables values, row by row.
Definition table3d_values.h:82
static uint32_t rshift(uint32_t a)
Bitwise right shift - generic, unoptimized, case.
Definition bit_shifts.h:349
table_type_t
Table type identifiers. Limited compile time RTTI.
Definition table3d.h:69
table_axis_iterator y_begin(const page_iterator_t &it)
Definition pages.cpp:482
page_iterator_t page_begin(byte pageNum)
Definition pages.cpp:445
table_value_iterator rows_begin(const page_iterator_t &it)
Definition pages.cpp:458
uint16_t getPageSize(byte pageNum)
Definition pages.cpp:424
page_iterator_t advance(const page_iterator_t &it)
Definition pages.cpp:450
entity_type
Definition pages.h:55
@ Raw
Definition pages.h:56
@ End
Definition pages.h:59
@ NoEntity
Definition pages.h:58
@ Table
Definition pages.h:57
table_axis_iterator x_begin(const page_iterator_t &it)
Definition pages.cpp:466
table_axis_iterator x_rbegin(const page_iterator_t &it)
Definition pages.cpp:474
uint8_t getPageCount(void)
Definition pages.cpp:419
byte getPageValue(byte pageNum, uint16_t offset)
Definition pages.cpp:436
void setPageValue(byte pageNum, uint16_t offset, byte value)
Definition pages.cpp:429
Definition pages.h:63
entity_type type
Definition pages.h:69
uint16_t size
Definition pages.h:68
table_type_t table_key
Definition pages.h:65
void * pData
Definition pages.h:64
uint8_t page
Definition pages.h:66
uint16_t start
Definition pages.h:67
3D table data types and functions