/*
 * multi-splitflap.h
 *
 *  Created on: 07.10.2022
 *      Author: jonas
 */

#ifndef MULTI_SPLITFLAP_H_
#define MULTI_SPLITFLAP_H_

#include "splitflap.h"

#define NUM_FLAPS 2 // Number of flaps that can be added to the combination

/* initialize dictionary */
void MultiSplitFlap_Init();

/* de-initialize: deallocate memory etc. */
void MultiSplitFlap_Deinit(void);


/* add a splitflap to the combination */
void MultiSplitFlap_AddFlap(SF_Handle_t splitflap);

/* moves all split flaps to the zero position
 * After a timeout of 35sec the initializtion is cancelled and the return value is false
 * If all splitflaps report to be initialized before the timeout, the return value is true */
bool MultiSplitFlap_MoveAllToZeroPosition(void);

/* display a sentence on the splitflap combination
 * splitflaps must be initialized to be able to display something!
 * returns true when all movements finished */
bool MultiSplitFlap_Display(char sentence[]);

/* sets the hardware identifier <hwId> of a splitflap with <id> in the combination
 * returns true when successful, false when not (e.g. split flap with given id not available) */
bool MultiSplitFlap_SetHardwareIdentifier(SetupIdentifier_t id, HardwareIdentifier_t hwId);

/* returns the amount of registered split flap displays in the combination */
uint8_t MultiSplitFlap_GetAmountOfAddedSplitFlaps(void);

#endif /* MULTI_SPLITFLAP_H_ */
