/*
 * led.h
 *
 *  Created on: 09-10-2014
 *      Author: Krzysztof Jakubczyk
 */

#ifndef LED_H_
#define LED_H_

#include "tdefs.h"

#define MAX_LEDS_COUNT	21 // 20 LEDS + 1 BUZZER
#define BUZZER_LED_NUM	20

struct led_logic
{
	u8 *in_ptr;
	u8 in_bit_no;
	u8 *blink_in_ptr;
	u8 blink_in_bit_no;
	u8 *clr_ptr;
	u8 clr_bit_no;
};

struct led_io
{
	u32 in;
	u32 blink_in;
	u32 clr_in;
}__attribute__((__packed__));

struct led_params
{
	u32 led_num;
	u32 until_clr;
}__attribute__((__packed__));

struct led_args
{
	struct led_io io;
	struct led_params params;
//	u16 crc;
}__attribute__((__packed__));

extern int led_initlog(void *arguments, void *logic);
extern int buzzer_initlog(void *arguments, void *logic);

#endif /* LED_H_ */
