Speeduino
Loading...
Searching...
No Matches
Classes | Functions
pages.cpp File Reference
#include "pages.h"
#include "globals.h"
#include "preprocessor.h"
#include "table3d_visitor.h"

Classes

class  offset_to_table< table_t >
 
struct  get_table_value_visitor
 
struct  set_table_value_visitor
 

Functions

template<class table_t >
static constexpr uint16_t get_table_value_end (void)
 
template<class table_t >
static constexpr uint16_t get_table_axisx_end (void)
 
template<class table_t >
static constexpr uint16_t get_table_axisy_end (const table_t *table)
 
static byte get_raw_location (const page_iterator_t &entity, uint16_t offset)
 
static bool set_raw_location (page_iterator_t &entity, uint16_t offset, byte value)
 
static byte get_table_value (const page_iterator_t &entity, uint16_t offset)
 
byte getEntityValue (const page_iterator_t &entity, uint16_t offset)
 Gets a single value from an entity, with data aligned as per the ini file.
 
static bool set_table_value (page_iterator_t &entity, uint16_t offset, byte new_value)
 
bool setEntityValue (page_iterator_t &entity, uint16_t offset, byte value)
 Sets a single value from a page, with data aligned as per the ini file.
 
void nextEntity (page_iterator_t &entity, uint16_t nextBlockSize)
 
template<class table_t >
static void checkIsInTable (page_iterator_t &result, table_t *pTable, uint16_t offset)
 
static void checkIsInRaw (page_iterator_t &result, config_page_t *pEntity, uint16_t entitySize, uint16_t offset)
 
static void checkIsInEmpty (page_iterator_t &result, uint16_t entitySize, uint16_t offset)
 
static page_iterator_t map_page_offset_to_entity (uint8_t pageNumber, uint16_t offset)
 
static void setTableRowToEmpty (table_row_iterator row)
 
static void setTableValuesToEmpty (table_value_iterator it)
 
static void setTableAxisToEmpty (table_axis_iterator it)
 
static void setTableToEmpty (const page_iterator_t &entity)
 
static void setEntityToEmpty (page_iterator_t entity)
 
void setTuneToEmpty (void)
 Fill the tune (config pages & tables) with zeroes.
 
uint16_t getPageSize (byte pageNum)
 
static uint16_t pageOffsetToEntityOffset (const page_iterator_t &entity, uint16_t pageOffset)
 
bool setPageValue (uint8_t pageNum, uint16_t offset, byte value)
 Sets a single value from a page, with data aligned as per the ini file.
 
byte getPageValue (uint8_t pageNum, uint16_t offset)
 Gets a single value from a page, with data aligned as per the ini file.
 
page_iterator_t page_begin (uint8_t pageNum)
 
page_iterator_t advance (const page_iterator_t &it)
 
table_value_iterator rows_begin (const page_iterator_t &it)
 
table_axis_iterator x_begin (const page_iterator_t &it)
 
table_axis_iterator x_rbegin (const page_iterator_t &it)
 
table_axis_iterator y_begin (const page_iterator_t &it)
 

Function Documentation

◆ advance()

Moves the iterator to the next sub-entity on the page

Parameters
[in]itThe current iterator
Here is the call graph for this function:
Here is the caller graph for this function:

◆ checkIsInEmpty()

static void checkIsInEmpty ( page_iterator_t result,
uint16_t  entitySize,
uint16_t  offset 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ checkIsInRaw()

static void checkIsInRaw ( page_iterator_t result,
config_page_t pEntity,
uint16_t  entitySize,
uint16_t  offset 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ checkIsInTable()

template<class table_t >
static void checkIsInTable ( page_iterator_t result,
table_t pTable,
uint16_t  offset 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_raw_location()

static byte get_raw_location ( const page_iterator_t entity,
uint16_t  offset 
)
inlinestatic
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_table_axisx_end()

template<class table_t >
static constexpr uint16_t get_table_axisx_end ( void  )
staticconstexpr
Here is the call graph for this function:

◆ get_table_axisy_end()

template<class table_t >
static constexpr uint16_t get_table_axisy_end ( const table_t table)
staticconstexpr
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_table_value()

static byte get_table_value ( const page_iterator_t entity,
uint16_t  offset 
)
inlinestatic
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_table_value_end()

template<class table_t >
static constexpr uint16_t get_table_value_end ( void  )
staticconstexpr

◆ getEntityValue()

byte getEntityValue ( const page_iterator_t entity,
uint16_t  offset 
)

Gets a single value from an entity, with data aligned as per the ini file.

Parameters
[in]entityThe entity to update
[in]offsetThe offset within the entity
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getPageSize()

uint16_t getPageSize ( uint8_t  pageNum)

Page size in bytes

Parameters
[in]pageNumThe page number
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getPageValue()

byte getPageValue ( uint8_t  pageNum,
uint16_t  offset 
)

Gets a single value from a page, with data aligned as per the ini file.

Parameters
[in]pageNumThe page number to retrieve data from.
[in]offsetThe address in the page that should be returned. This is as per the page definition in the ini.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ map_page_offset_to_entity()

static page_iterator_t map_page_offset_to_entity ( uint8_t  pageNumber,
uint16_t  offset 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ nextEntity()

void nextEntity ( page_iterator_t entity,
uint16_t  nextBlockSize 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ page_begin()

page_iterator_t page_begin ( uint8_t  pageNum)

Initiates iteration over a pages entities. Test entity.type==End to determine the end of the page.

Parameters
[in]pageNumThe page number to iterate over.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pageOffsetToEntityOffset()

static uint16_t pageOffsetToEntityOffset ( const page_iterator_t entity,
uint16_t  pageOffset 
)
inlinestatic
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rows_begin()

Convert page iterator to table value iterator.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_raw_location()

static bool set_raw_location ( page_iterator_t entity,
uint16_t  offset,
byte  value 
)
inlinestatic
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_table_value()

static bool set_table_value ( page_iterator_t entity,
uint16_t  offset,
byte  new_value 
)
inlinestatic
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setEntityToEmpty()

static void setEntityToEmpty ( page_iterator_t  entity)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setEntityValue()

bool setEntityValue ( page_iterator_t entity,
uint16_t  offset,
byte  value 
)

Sets a single value from a page, with data aligned as per the ini file.

Returns
true if value set, false otherwise
Parameters
[in]entityThe entity to update
[in]offsetThe offset within the entity
[in]valueThe new value
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setPageValue()

bool setPageValue ( uint8_t  pageNum,
uint16_t  offset,
byte  value 
)

Sets a single value from a page, with data aligned as per the ini file.

Returns
true if value set, false otherwise
Parameters
[in]pageNumThe page number to update.
[in]offsetThe offset within the page.
[in]valueThe new value
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setTableAxisToEmpty()

static void setTableAxisToEmpty ( table_axis_iterator  it)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setTableRowToEmpty()

static void setTableRowToEmpty ( table_row_iterator  row)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setTableToEmpty()

static void setTableToEmpty ( const page_iterator_t entity)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setTableValuesToEmpty()

static void setTableValuesToEmpty ( table_value_iterator  it)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setTuneToEmpty()

void setTuneToEmpty ( void  )

Fill the tune (config pages & tables) with zeroes.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ x_begin()

Convert page iterator to table x axis iterator.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ x_rbegin()

Convert page iterator to table x axis iterator.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ y_begin()

Convert page iterator to table y axis iterator.

Here is the call graph for this function:
Here is the caller graph for this function: