cpled.c File Reference


Detailed Description

AVR32 UC3 Control Panel leds actuators module.

Author:
Atmel Corporation: http://www.atmel.com
Support and FAQ: http://support.atmel.no/

Definition in file cpled.c.

#include <string.h>
#include <stdio.h>
#include "compiler.h"
#include "FreeRTOS.h"
#include "board.h"
#include "cpled.h"

Go to the source code of this file.

Functions

Bool b_ledm1_get_value (char *buf)
 Get the ledm1 current value.
Bool b_ledm2_get_value (char *buf)
 Get the ledm2 current value.
Bool b_ledm3_get_value (char *buf)
 Get the ledm3 current value.
Bool b_ledm4_get_value (char *buf)
 Get the ledm4 current value.
Bool e_ledm1_set_value (char *cmd, char *buf)
Bool e_ledm2_set_value (char *cmd, char *buf)
Bool e_ledm3_set_value (char *cmd, char *buf)
Bool e_ledm4_set_value (char *cmd, char *buf)
Bool e_ledm_refresh_intensity (U32 intensity)

Variables

const signed portCHAR *const CPLED_OFF_STR = (signed portCHAR *)"off"
const signed portCHAR *const CPLED_ON_STR = (signed portCHAR *)"on"


Function Documentation

Bool b_ledm1_get_value ( char *  buf  ) 

Get the ledm1 current value.

Parameters:
buf char buffer in which the ledm1 state is stored.
Returns:
TRUE upon success, FALSE if error.

Definition at line 74 of file cpled.c.

References CPLED_OFF_STR, and CPLED_ON_STR.

Referenced by device_full_custom_task().

00075 {
00076    // Build the log string.
00077    if( LED_Test( LED_MONO0_GREEN ) ) {
00078       sprintf( buf, "%s\r\n", CPLED_ON_STR);
00079    } else {
00080       sprintf( buf, "%s\r\n", CPLED_OFF_STR);
00081    }
00082    return TRUE;
00083 }

Bool b_ledm2_get_value ( char *  buf  ) 

Get the ledm2 current value.

Parameters:
buf char buffer in which the ledm2 state is stored.
Returns:
TRUE upon success, FALSE if error.

Definition at line 93 of file cpled.c.

References CPLED_OFF_STR, and CPLED_ON_STR.

Referenced by device_full_custom_task().

00094 {
00095    // Build the log string.
00096    if( LED_Test( LED_MONO1_GREEN ) ) {
00097       sprintf( buf, "%s\r\n", CPLED_ON_STR);
00098    } else {
00099       sprintf( buf, "%s\r\n", CPLED_OFF_STR);
00100    }
00101    return TRUE;
00102 }

Bool b_ledm3_get_value ( char *  buf  ) 

Get the ledm3 current value.

Parameters:
buf char buffer in which the ledm3 state is stored.
Returns:
TRUE upon success, FALSE if error.

Definition at line 111 of file cpled.c.

References CPLED_OFF_STR, and CPLED_ON_STR.

Referenced by device_full_custom_task().

00112 {
00113    // Build the log string.
00114    if( LED_Test( LED_MONO2_GREEN ) ) {
00115       sprintf( buf, "%s\r\n", CPLED_ON_STR);
00116    } else {
00117       sprintf( buf, "%s\r\n", CPLED_OFF_STR);
00118    }
00119    return TRUE;
00120 }

Bool b_ledm4_get_value ( char *  buf  ) 

Get the ledm4 current value.

Parameters:
buf char buffer in which the ledm4 state is stored.
Returns:
TRUE upon success, FALSE if error.

Definition at line 130 of file cpled.c.

References CPLED_OFF_STR, and CPLED_ON_STR.

Referenced by device_full_custom_task().

00131 {
00132    // Build the log string.
00133    if( LED_Test( LED_MONO3_GREEN ) ) {
00134       sprintf( buf, "%s\r\n", CPLED_ON_STR);
00135    } else {
00136       sprintf( buf, "%s\r\n", CPLED_OFF_STR);
00137    }
00138    return TRUE;
00139 }

Bool e_ledm1_set_value ( char *  cmd,
char *  buf 
)

Definition at line 149 of file cpled.c.

References CPLED_OFF_STR, and CPLED_ON_STR.

Referenced by device_full_custom_task().

00150 {
00151    if( !strncmp( cmd, (char *)CPLED_ON_STR, strlen((char *)CPLED_ON_STR) ) )
00152    {
00153       sprintf( buf, "%s\r\n", CPLED_ON_STR);
00154       LED_On( LED_MONO0_GREEN );
00155    }
00156    else if( !strncmp( cmd, (char *)CPLED_OFF_STR, strlen((char *)CPLED_OFF_STR) ) )
00157    {
00158       sprintf( buf, "%s\r\n", CPLED_OFF_STR);
00159       LED_Off( LED_MONO0_GREEN );
00160    }
00161    return TRUE;
00162 }

Bool e_ledm2_set_value ( char *  cmd,
char *  buf 
)

Definition at line 171 of file cpled.c.

References CPLED_OFF_STR, and CPLED_ON_STR.

Referenced by device_full_custom_task().

00172 {
00173    if( !strncmp( cmd, (char *)CPLED_ON_STR, strlen((char *)CPLED_ON_STR) ) )
00174    {
00175       sprintf( buf, "%s\r\n", CPLED_ON_STR);
00176       LED_On( LED_MONO1_GREEN );
00177    }
00178    else if( !strncmp( cmd, (char *)CPLED_OFF_STR, strlen((char *)CPLED_OFF_STR) ) )
00179    {
00180       sprintf( buf, "%s\r\n", CPLED_OFF_STR);
00181       LED_Off( LED_MONO1_GREEN );
00182    }
00183    return TRUE;
00184 }

Bool e_ledm3_set_value ( char *  cmd,
char *  buf 
)

Definition at line 193 of file cpled.c.

References CPLED_OFF_STR, and CPLED_ON_STR.

Referenced by device_full_custom_task().

00194 {
00195    if( !strncmp( cmd, (char *)CPLED_ON_STR, strlen((char *)CPLED_ON_STR) ) )
00196    {
00197       sprintf( buf, "%s\r\n", CPLED_ON_STR);
00198       LED_On( LED_MONO2_GREEN );
00199    }
00200    else if( !strncmp( cmd, (char *)CPLED_OFF_STR, strlen((char *)CPLED_OFF_STR) ) )
00201    {
00202       sprintf( buf, "%s\r\n", CPLED_OFF_STR);
00203       LED_Off( LED_MONO2_GREEN );
00204    }
00205    return TRUE;
00206 }

Bool e_ledm4_set_value ( char *  cmd,
char *  buf 
)

Definition at line 215 of file cpled.c.

References CPLED_OFF_STR, and CPLED_ON_STR.

Referenced by device_full_custom_task().

00216 {
00217    if( !strncmp( cmd, (char *)CPLED_ON_STR, strlen((char *)CPLED_ON_STR) ) )
00218    {
00219       sprintf( buf, "%s\r\n", CPLED_ON_STR);
00220       LED_On( LED_MONO3_GREEN );
00221    }
00222    else if( !strncmp( cmd, (char *)CPLED_OFF_STR, strlen((char *)CPLED_OFF_STR) ) )
00223    {
00224       sprintf( buf, "%s\r\n", CPLED_OFF_STR);
00225       LED_Off( LED_MONO3_GREEN );
00226    }
00227    return TRUE;
00228 }

Bool e_ledm_refresh_intensity ( U32  intensity  ) 

Definition at line 236 of file cpled.c.

Referenced by device_full_custom_task().

00237 {
00238    // Adjust LED intensity
00239    if( LED_Test( LED_MONO0_GREEN ) ) LED_Set_Intensity(LED_MONO0_GREEN, intensity);
00240    if( LED_Test( LED_MONO1_GREEN ) ) LED_Set_Intensity(LED_MONO1_GREEN, intensity);
00241    if( LED_Test( LED_MONO2_GREEN ) ) LED_Set_Intensity(LED_MONO2_GREEN, intensity);
00242    if( LED_Test( LED_MONO3_GREEN ) ) LED_Set_Intensity(LED_MONO3_GREEN, intensity);
00243    return TRUE;
00244 }


Variable Documentation

const signed portCHAR* const CPLED_OFF_STR = (signed portCHAR *)"off"

const signed portCHAR* const CPLED_ON_STR = (signed portCHAR *)"on"


Generated on Fri Feb 19 02:22:51 2010 for AVR32 - Control Panel demonstration. by  doxygen 1.5.5