Skip to content

Namespace ASL

Namespace List > ASL

Classes

Type Name
class cla_display
display handler

Public Types

Type Name
enum en_blink_mode
enum en_blink_type
enum en_state
the states of the finite state machine.

Public Functions

Type Name
void Delay_256 (uint16_t _u16_delay)
Delay.
uint8_t Roll_Dice ()
roll the Dice.
void Setup_Buttons ()
setup function for the Buttons
void Setup_Dice ()
setup function for the Dice

Public Types Documentation

enum ASL::en_blink_mode {
    off = 0,
    fast,
    slow
};
enum ASL::en_blink_type {
    token = 0,
    token_thrown,
    starting_square,
    winner_animation
};

enum en_state

the states of the finite state machine.

enum ASL::en_state {
    display_setup_real_players = 0,
    setup_real_players,
    modify_real_player_number,
    display_setup_computer_players,
    setup_computer_players,
    modify_computer_player_number,
    display_setup_computer_player_mode,
    setup_computer_player_mode,
    modify_computer_player_mode,
    init_game_logic,
    wait_for_dice_roll,
    roll_the_dice,
    wait_for_player_input,
    display_token,
    validate_token,
    move_token,
    next_player,
    game_finished
};

Defines the states of the finite state machine. Starting state is 1.

Public Functions Documentation

function Delay_256

Delay.

void ASL::Delay_256 (
    uint16_t _u16_delay
) 

This function is a simple delay function. It uses Timer 5 with /256 clk divider to count to the value in the transfer parameter. when reached, the function returns.

Parameters:

  • _u16_delay The number of timer cycles to delay.

function Roll_Dice

roll the Dice.

uint8_t ASL::Roll_Dice () 

This function reads the TCNT register value, adds one and returns it. In Order to receive a Value between 1 and 6, the Setup_Dice() function must be called beforehand (ONCE).

function Setup_Buttons

setup function for the Buttons

void ASL::Setup_Buttons () 

Sets Buttons on Pin 2 and 3 to input and enables interupt for them. This function must be called ONCE at the beginning of the program in Order for the Buttons to work.

function Setup_Dice

setup function for the Dice

void ASL::Setup_Dice () 

Sets Timer 0 to count to 5 using CTC mode, so the value read from the TCNT register can be used as a dice value after adding 1. This function must be called ONCE at the beginning of the program in Order for the Dice to work.


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