//////////////////////////////////////////////////////////////////
//
// App:			Guardian task
// Author:		Milan Korinek
// Version:		1.0
// Notice:		Supervisor of Digital I/O USB Card
//////////////////////////////////////////////////////////////////


#ifndef GUARDIAN_H_
#define GUARDIAN_H_

#include <config_tasks.h>
#include "support/support.h"

/* Messages types with auto generate string names */
#define FOREACH_guardian_msg_type(ITEM) \
ITEM(GUARDIAN_MSG_1)   \

typedef enum {
	FOREACH_guardian_msg_type(GENERATE_ENUM)
} guardian_msg_type_t;

extern const char *const guardian_msg_type_str[];

typedef struct {
	guardian_msg_type_t message;
	uint32_t settings;
} guardian_msg_t;

typedef struct {
	xTaskHandle task_handle;
	xQueueHandle control_pipe;
} guardian_handle_t;

status_code_t guardian_init(guardian_handle_t * task_handle);

void guardian_task(void *pvParameters);

extern guardian_handle_t guardian_handle;

#endif /* GUARDIAN_H_ */