Advanced Distributed Systems module at HSLU
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

43 lines
1.4 KiB

/*
* multi-splitflap.h
*
* Created on: 07.10.2022
* Author: jonas
*/
#ifndef MULTI_SPLITFLAP_H_
#define MULTI_SPLITFLAP_H_
#include "splitflap.h"
#define NUM_MAX_AMOUNT_FLAPS 9 // Number of flaps that can be added to the combination
/* initialize dictionary.
* numFlaps: Amount of flaps to be used*/
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_ */