Firmware for Arduino | PLEN Project Company Inc.
PLEN2::Motion::Header Class Reference

Class of a motion header. More...

#include <Motion.h>

Public Types

enum  { NAME_LENGTH = 21, FRAMELENGTH_MIN = 1, FRAMELENGTH_MAX = 20 }
 

Static Public Member Functions

static void init (Header &header)
 Initialize the header. More...
 
static bool set (uint8_t slot, const Header &header)
 Write the header to external EEPROM. More...
 
static bool get (uint8_t slot, Header &header)
 Read the header from external EEPROM. More...
 

Public Attributes

uint8_t slot
 Slot number of a motion. More...
 
char name [NAME_LENGTH]
 Motion name. More...
 
uint8_t frame_length
 Frame length of a motion. More...
 
uint8_t NON_RESERVED: 5
 Undefined area. (It is reserved for future changes.) More...
 
uint8_t use_extra: 1
 Selector to enable "extra". More...
 
uint8_t use_jump: 1
 Selector to enable "jump". More...
 
uint8_t use_loop: 1
 Selector to enable "loop". More...
 
uint8_t loop_begin
 Frame number of loop's beginning. More...
 
uint8_t loop_end
 Frame number of loop's ending. More...
 
uint8_t loop_count
 Loop count. (Using 255 as infinity.) More...
 
uint8_t jump_slot
 Slot number that is used for jumping when the motion's play is finished. More...
 
uint8_t stop_flags [2]
 Array of stop flags. More...
 

Detailed Description

Class of a motion header.

Attention
The firmware backs up memory allocation of an instance to external EEPROM, so if you change the order of the member instances, PLEN does not work properly if you did not re-install all motions.

Member Enumeration Documentation

anonymous enum
Enumerator
NAME_LENGTH 

Length of a motion name.

Attention
Regard end of a string as '\0', so the actual length is 20 bytes.
FRAMELENGTH_MIN 

Minimum value of frame length.

FRAMELENGTH_MAX 

Maximum value of frame length.

Member Function Documentation

static bool PLEN2::Motion::Header::get ( uint8_t  slot,
Header header 
)
static

Read the header from external EEPROM.

Parameters
[in]slotNumber of a header.
[in,out]headerAn instance of header.
Returns
Result
static void PLEN2::Motion::Header::init ( Header header)
static

Initialize the header.

Parameters
[in,out]headerAn instance of header.
static bool PLEN2::Motion::Header::set ( uint8_t  slot,
const Header header 
)
static

Write the header to external EEPROM.

Parameters
[in]slotNumber of a header.
[in]headerAn instance of header.
Returns
Result

Member Data Documentation

uint8_t PLEN2::Motion::Header::frame_length

Frame length of a motion.

uint8_t PLEN2::Motion::Header::jump_slot

Slot number that is used for jumping when the motion's play is finished.

uint8_t PLEN2::Motion::Header::loop_begin

Frame number of loop's beginning.

uint8_t PLEN2::Motion::Header::loop_count

Loop count. (Using 255 as infinity.)

uint8_t PLEN2::Motion::Header::loop_end

Frame number of loop's ending.

char PLEN2::Motion::Header::name[NAME_LENGTH]

Motion name.

uint8_t PLEN2::Motion::Header::NON_RESERVED

Undefined area. (It is reserved for future changes.)

uint8_t PLEN2::Motion::Header::slot

Slot number of a motion.

uint8_t PLEN2::Motion::Header::stop_flags[2]

Array of stop flags.

Todo:
Currently, the definition is uint8_t 2 bytes array, but in the future, it should be uint32_t variable.

Thus, the authors need to refactor I2C libraries.
uint8_t PLEN2::Motion::Header::use_extra

Selector to enable "extra".

uint8_t PLEN2::Motion::Header::use_jump

Selector to enable "jump".

uint8_t PLEN2::Motion::Header::use_loop

Selector to enable "loop".


The documentation for this class was generated from the following file: