Skip to content

Class ASL::cla_display

ClassList > ASL > cla_display

display handler More...

  • #include <ASL.hpp>

Public Functions

Type Name
void Begin ()
Initial Setup.
bool Blink_Is_On ()
Is Blinking On?
void Blink_Start (en_blink_mode _en_blink_mode, int8_t _i8_blink_cycles, en_blink_type _en_blink_type, uint8_t _u8_blink_player_number, int8_t _i8_blink_second_player, uint8_t _u8_new_position=0, bool _bool_occupied_flag=true, uint8_t _u8_old_position=0)
Blink method.
void Blink_Stop ()
Stop blinking.
bool Blink_Update (bool _bool_isr_active)
Update the Blink state.
void Display_Char (char _ch_first_letter=' ', char _ch_second_letter=' ', char _ch_third_letter=' ')
Display the Word.
void Display_Clear_Right ()
clears the right half of the display.
void Display_Current_Player (int8_t _i8_current_player_number, int8_t _i8_tokens_at_home=-1)
Display the Current Player.
void Display_Dice (uint8_t _u8_dice_value, uint8_t _u8_dice_roll_counter, int8_t _i8_current_player_number, bool _bool_animate=true)
Display the dice.
void Display_Players (uint8_t _u8_player_quantity, bool _bool_tokens_at_home=true)
Display the Players all in home.
void Display_Progress (int8_t _i8_current_player_number, uint8_t _u8_progress)
Display the Progress This method can display the progress of the Player.
void Display_Restore ()
Restore Display to track only.
void Display_Track ()
Display the Track.
void Modify_Position (uint8_t _u8_position, uint8_t _u8_player_number, bool bool_remove)
void Move_Token (uint8_t _u8_player_nr, uint8_t _u8_remove_position, uint8_t _u8_add_position)
Move a Token.
void Set_Colors (uint8_t _u8_player_nr, uint16_t _u16_bright_color, uint16_t _u16_dark_color)
Set the Colors of the player.
cla_display (uint8_t _u8_matrix_a, uint8_t u8_matrix_b, uint8_t u8_matrix_c, uint8_t u8_matrix_clk, uint8_t u8_lat, uint8_t u8_matrix_oe)
Constructor of the class.

Detailed Description

This class handles all the functions and parameters needed to display the game.

Public Functions Documentation

function Begin

Initial Setup.

void ASL::cla_display::Begin () 

This function must be called ONCE at the beginning of the Code

Is Blinking On?

bool ASL::cla_display::Blink_Is_On () 

Returns:

true if blinking is on, false otherwise

Blink method.

void ASL::cla_display::Blink_Start (
    en_blink_mode _en_blink_mode,
    int8_t _i8_blink_cycles,
    en_blink_type _en_blink_type,
    uint8_t _u8_blink_player_number,
    int8_t _i8_blink_second_player,
    uint8_t _u8_new_position=0,
    bool _bool_occupied_flag=true,
    uint8_t _u8_old_position=0
) 

This method can blink * a token to display possible Progress (token) * two tokens alternating in the color of two players (token_thrown)

Parameters:

  • _en_blink_mode The mode of the blinking (fast/slow/off)
  • _i8_blink_cycles The number of cycles to blink (-1: infinite)
  • _en_blink_type The type of the blinking (token/token_thrown/starting_square/winner_animation)
  • _u8_blink_player_number The number of the player to blink.
  • _i8_blink_second_player The number of the second player to blink.
  • _u8_new_position new position of the token. default: 0. Different use in case of blink_type starting_square: Tokens at home, signaled by the bit position (1 << tokennr -> token is home).
  • _bool_occupied_flag flag used in token mode to determine the color to alternate the new position to. default: true
  • _u8_old_position old position of the token. default: 0
void ASL::cla_display::Blink_Stop () 

Update the Blink state.

bool ASL::cla_display::Blink_Update (
    bool _bool_isr_active
) 

Parameters:

  • _bool_isr_active flag to determine if the function is called from an interupt service routine.

Returns:

true if the Blinking wasn't executed due to it possibly taking too long.

function Display_Char

Display the Word.

void ASL::cla_display::Display_Char (
    char _ch_first_letter=' ',
    char _ch_second_letter=' ',
    char _ch_third_letter=' '
) 

Parameters:

  • _ch_first_letter The first letter of the word to display. default: ' '
  • _ch_second_letter The second letter of the word to display. default: ' '

function Display_Clear_Right

void ASL::cla_display::Display_Clear_Right () 

function Display_Current_Player

Display the Current Player.

void ASL::cla_display::Display_Current_Player (
    int8_t _i8_current_player_number,
    int8_t _i8_tokens_at_home=-1
) 

This method can display the current player on the matrix.

Parameters:

  • _i8_current_player_number The number of the current player.
  • _u8_tokens_at_home Tokens at home, signaled by the bit position (1 << tokennr -> token is home). default: -1 (don't animate)

function Display_Dice

Display the dice.

void ASL::cla_display::Display_Dice (
    uint8_t _u8_dice_value,
    uint8_t _u8_dice_roll_counter,
    int8_t _i8_current_player_number,
    bool _bool_animate=true
) 

Display the Dice on the matrix. when Set to animate, it will play a small animation. The animation uses a simple delay instead of interupts, since the program is not supposed to keep running while the animation is played.

Parameters:

  • _u8_dice_value The value to be displayed.
  • _u8_dice_roll_counter The number of the current roll.
  • _i8_current_player_number The number of the current player.
  • _bool_animate flag to determine if the dice should be animated. should be handled with care as it uses Delay. default: true

function Display_Players

Display the Players all in home.

void ASL::cla_display::Display_Players (
    uint8_t _u8_player_quantity,
    bool _bool_tokens_at_home=true
) 

This method is supposed to be called when setting the Game up. It displays the number of players that are currently chosen.

Parameters:

  • _u8_player_quantity The number of Players to be displayed.

function Display_Progress

Display the Progress This method can display the progress of the Player.

void ASL::cla_display::Display_Progress (
    int8_t _i8_current_player_number,
    uint8_t _u8_progress
) 

Parameters:

  • _i8_current_player_number The number of the current player.
  • _u8_progress The progress of the player. (0:28)

function Display_Restore

void ASL::cla_display::Display_Restore () 

function Display_Track

void ASL::cla_display::Display_Track () 

function Modify_Position

void ASL::cla_display::Modify_Position (
    uint8_t _u8_position,
    uint8_t _u8_player_number,
    bool bool_remove
) 

function Move_Token

Move a Token.

void ASL::cla_display::Move_Token (
    uint8_t _u8_player_nr,
    uint8_t _u8_remove_position,
    uint8_t _u8_add_position
) 

This method can move a token.

Parameters:

  • _u8_player_number chosen player
  • _u8_old_position old position of the token
  • _u8_new_position new position of the token

function Set_Colors

Set the Colors of the player.

void ASL::cla_display::Set_Colors (
    uint8_t _u8_player_nr,
    uint16_t _u16_bright_color,
    uint16_t _u16_dark_color
) 

Parameters:

  • _u8_player_nr Number of the Player (0:3)
  • _u16_bright_color Bright Color for the Player
  • _u16_dark_color Dark Color for the Player

function cla_display

ASL::cla_display::cla_display (
    uint8_t _u8_matrix_a,
    uint8_t u8_matrix_b,
    uint8_t u8_matrix_c,
    uint8_t u8_matrix_clk,
    uint8_t u8_lat,
    uint8_t u8_matrix_oe
) 

The documentation for this class was generated from the following file /home/runner/work/Arduino_DHBW_Spiel/Arduino_DHBW_Spiel/Engineering/COD_ENG_OUT_arduino_code/lib/ASL/ASL.hpp