Speeduino
Loading...
Searching...
No Matches
Classes | Macros | Functions | Variables
pages.cpp File Reference
#include "pages.h"
#include "globals.h"
#include "utilities.h"
#include "table3d_axis_io.h"

Classes

class  offset_to_table< table_t >
 

Macros

#define _ENTITY_START(entityNum)   entity ## entityNum ## Start
 
#define ENTITY_START_VAR(entityNum)   _ENTITY_START(entityNum)
 
#define DECLARE_NEXT_ENTITY_START(entityIndex, entitySize)    constexpr uint16_t ENTITY_START_VAR( PP_INC(entityIndex) ) = ENTITY_START_VAR(entityIndex)+entitySize;
 
#define END_OF_PAGE(pageNum, entityNum)
 
#define CHECK_TABLE(pageNum, offset, pTable, entityNum)
 
#define CHECK_RAW(pageNum, offset, pDataBlock, blockSize, entityNum)
 

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 *)
 
byteget_raw_location (page_iterator_t &entity, uint16_t offset)
 
byte get_table_value (page_iterator_t &entity, uint16_t offset)
 
byte get_value (page_iterator_t &entity, uint16_t offset)
 
void set_table_value (page_iterator_t &entity, uint16_t offset, byte new_value)
 
void set_value (page_iterator_t &entity, byte value, uint16_t offset)
 
template<uint8_t pageNum, uint16_t min>
static void check_size ()
 
const page_iterator_t create_end_iterator (uint8_t pageNum, uint16_t start)
 
const page_iterator_t create_table_iterator (void *pTable, table_type_t key, uint8_t pageNum, uint16_t start, uint16_t size)
 
const page_iterator_t create_raw_iterator (void *pBuffer, uint8_t pageNum, uint16_t start, uint16_t size)
 
static page_iterator_t map_page_offset_to_entity (uint8_t pageNumber, uint16_t offset)
 
uint8_t getPageCount (void)
 
uint16_t getPageSize (byte pageNum)
 
void setPageValue (byte pageNum, uint16_t offset, byte value)
 
byte getPageValue (byte pageNum, uint16_t offset)
 
page_iterator_t page_begin (byte 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)
 

Variables

constexpr const uint16_t ini_page_sizes [] = { 0, 128, 288, 288, 128, 288, 128, 240, 384, 192, 192, 288, 192, 128, 288, 256 }
 

Macro Definition Documentation

◆ _ENTITY_START

#define _ENTITY_START (   entityNum)    entity ## entityNum ## Start

◆ CHECK_RAW

#define CHECK_RAW (   pageNum,
  offset,
  pDataBlock,
  blockSize,
  entityNum 
)
Value:
{ \
} \
static uint32_t rshift(uint32_t a)
Bitwise right shift - generic, unoptimized, case.
Definition bit_shifts.h:349
#define ENTITY_START_VAR(entityNum)
Definition pages.cpp:209
const page_iterator_t create_raw_iterator(void *pBuffer, uint8_t pageNum, uint16_t start, uint16_t size)
Definition pages.cpp:271

◆ CHECK_TABLE

#define CHECK_TABLE (   pageNum,
  offset,
  pTable,
  entityNum 
)
Value:
{ \
} \
const page_iterator_t create_table_iterator(void *pTable, table_type_t key, uint8_t pageNum, uint16_t start, uint16_t size)
Definition pages.cpp:247
static constexpr uint16_t get_table_axisy_end(const table_t *)
Definition pages.cpp:44

◆ DECLARE_NEXT_ENTITY_START

◆ END_OF_PAGE

#define END_OF_PAGE (   pageNum,
  entityNum 
)
Value:
const page_iterator_t create_end_iterator(uint8_t pageNum, uint16_t start)
Definition pages.cpp:228

◆ ENTITY_START_VAR

#define ENTITY_START_VAR (   entityNum)    _ENTITY_START(entityNum)

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:

◆ check_size()

template<uint8_t pageNum, uint16_t min>
static void check_size ( )
inlinestatic
Here is the call graph for this function:

◆ create_end_iterator()

const page_iterator_t create_end_iterator ( uint8_t  pageNum,
uint16_t  start 
)
inline
Here is the call graph for this function:

◆ create_raw_iterator()

const page_iterator_t create_raw_iterator ( void pBuffer,
uint8_t  pageNum,
uint16_t  start,
uint16_t  size 
)
inline
Here is the call graph for this function:

◆ create_table_iterator()

const page_iterator_t create_table_iterator ( void pTable,
table_type_t  key,
uint8_t  pageNum,
uint16_t  start,
uint16_t  size 
)
inline
Here is the call graph for this function:

◆ get_raw_location()

byte & get_raw_location ( page_iterator_t entity,
uint16_t  offset 
)
inline
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  )
inlinestaticconstexpr
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 )
inlinestaticconstexpr
Here is the call graph for this function:

◆ get_table_value()

byte get_table_value ( page_iterator_t entity,
uint16_t  offset 
)
inline
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  )
inlinestaticconstexpr

◆ get_value()

byte get_value ( page_iterator_t entity,
uint16_t  offset 
)
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getPageCount()

uint8_t getPageCount ( void  )

Page count, as defined in the INI file

Here is the caller graph for this function:

◆ getPageSize()

uint16_t getPageSize ( byte  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 ( byte  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 
)
inlinestatic
Here is the call graph for this function:
Here is the caller graph for this function:

◆ page_begin()

page_iterator_t page_begin ( byte  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:

◆ 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_table_value()

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

◆ set_value()

void set_value ( page_iterator_t entity,
byte  value,
uint16_t  offset 
)
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setPageValue()

void setPageValue ( byte  pageNum,
uint16_t  offset,
byte  value 
)

Sets 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.
[in]valueThe new value
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:

Variable Documentation

◆ ini_page_sizes

constexpr const uint16_t ini_page_sizes[] = { 0, 128, 288, 288, 128, 288, 128, 240, 384, 192, 192, 288, 192, 128, 288, 256 }
constexpr