/**
 * Generated by Eclipse Mita 0.1.0.
 * @date 2022-04-18 17:15:46
 */


#include <BSP_BoardType.h>
#include <stdbool.h>
#include <BCDS_BSP_LED.h>
#include <BCDS_Retcode.h>
#include "SensorButton_two.h"
#include "SensorButton_one.h"
#include "MitaExceptions.h"

static bool _ledStatusRed = false;
static bool _ledStatusOrange = false;

Retcode_T ConnectivityLEDLight_Setup(void)
{
	Retcode_T ledSetupStatus = RETCODE_OK;
	ledSetupStatus = BSP_LED_Connect();
	if(ledSetupStatus != RETCODE_OK)
	{
		return ledSetupStatus;
	}
	
	ledSetupStatus = BSP_LED_Enable((uint32_t) BSP_XDK_LED_R);
	if(ledSetupStatus != RETCODE_OK)
	{
		return ledSetupStatus;
	} 		
	
	ledSetupStatus = BSP_LED_Enable((uint32_t) BSP_XDK_LED_O);
	if(ledSetupStatus != RETCODE_OK)
	{
		return ledSetupStatus;
	} 		
	
	return NO_EXCEPTION;
}

Retcode_T ConnectivityLEDLight_Enable(void)
{
	
	return NO_EXCEPTION;
}

/**
 * Provides read access to the red signal.
 */
Retcode_T ConnectivityLEDLight_Red_Read(bool* result)
{
	*result = _ledStatusRed;
	
	return NO_EXCEPTION;
}

/**
 * Provides write access to the red signal.
 */
Retcode_T ConnectivityLEDLight_Red_Write(bool* value)
{
	if(*value == TRUE) {
		BSP_LED_Switch((uint32_t) BSP_XDK_LED_R, (uint32_t) BSP_LED_COMMAND_ON);
	} else {
		BSP_LED_Switch((uint32_t) BSP_XDK_LED_R, (uint32_t) BSP_LED_COMMAND_OFF);
	}
	_ledStatusRed = *value;
	
	return NO_EXCEPTION;
}


/**
 * Provides read access to the orange signal.
 */
Retcode_T ConnectivityLEDLight_Orange_Read(bool* result)
{
	*result = _ledStatusOrange;
	
	return NO_EXCEPTION;
}

/**
 * Provides write access to the orange signal.
 */
Retcode_T ConnectivityLEDLight_Orange_Write(bool* value)
{
	if(*value == TRUE) {
		BSP_LED_Switch((uint32_t) BSP_XDK_LED_O, (uint32_t) BSP_LED_COMMAND_ON);
	} else {
		BSP_LED_Switch((uint32_t) BSP_XDK_LED_O, (uint32_t) BSP_LED_COMMAND_OFF);
	}
	_ledStatusOrange = *value;
	
	return NO_EXCEPTION;
}



