Statistics
| Branch: | Tag: | Revision:

root / LUFA / CodeTemplates / DriverStubs / LEDs.h @ 978b99e5

History | View | Annotate | Download (4.14 KB)

1
/*
2
             LUFA Library
3
     Copyright (C) Dean Camera, 2011.
4

5
  dean [at] fourwalledcubicle [dot] com
6
           www.lufa-lib.org
7
*/
8

    
9
/*
10
  Copyright 2011  Dean Camera (dean [at] fourwalledcubicle [dot] com)
11

12
  Permission to use, copy, modify, distribute, and sell this
13
  software and its documentation for any purpose is hereby granted
14
  without fee, provided that the above copyright notice appear in
15
  all copies and that both that the copyright notice and this
16
  permission notice and warranty disclaimer appear in supporting
17
  documentation, and that the name of the author not be used in
18
  advertising or publicity pertaining to distribution of the
19
  software without specific, written prior permission.
20

21
  The author disclaim all warranties with regard to this
22
  software, including all implied warranties of merchantability
23
  and fitness.  In no event shall the author be liable for any
24
  special, indirect or consequential damages or any damages
25
  whatsoever resulting from loss of use, data or profits, whether
26
  in an action of contract, negligence or other tortious action,
27
  arising out of or in connection with the use or performance of
28
  this software.
29
*/
30

    
31
/*
32
   This is a stub driver header file, for implementing custom board
33
   layout hardware with compatible LUFA board specific drivers. If
34
   the library is configured to use the BOARD_USER board mode, this
35
   driver file should be completed and copied into the "/Board/" folder
36
   inside the application's folder.
37

38
   This stub is for the board-specific component of the LUFA LEDs driver,
39
   for the LEDs (up to four) mounted on most development boards.
40
*/
41

    
42
#ifndef __LEDS_USER_H__
43
#define __LEDS_USER_H__
44

    
45
        /* Includes: */
46
                // TODO: Add any required includes here
47

    
48
/* Enable C linkage for C++ Compilers: */
49
                #if defined(__cplusplus)
50
                        extern "C" {
51
                #endif
52

    
53
        /* Preprocessor Checks: */
54
                #if !defined(__INCLUDE_FROM_LEDS_H)
55
                        #error Do not include this file directly. Include LUFA/Drivers/Board/LEDS.h instead.
56
                #endif
57

    
58
        /* Public Interface - May be used in end-application: */
59
                /* Macros: */
60
                        /** LED mask for the first LED on the board. */
61
                        #define LEDS_LED1        // TODO: Add mask for first board LED here
62

    
63
                        /** LED mask for the second LED on the board. */
64
                        #define LEDS_LED2        // TODO: Add mask for second board LED here
65

    
66
                        /** LED mask for the third LED on the board. */
67
                        #define LEDS_LED3        // TODO: Add mask for third board LED here
68

    
69
                        /** LED mask for the fourth LED on the board. */
70
                        #define LEDS_LED4        // TODO: Add mask for fourth board LED here
71

    
72
                        /** LED mask for all the LEDs on the board. */
73
                        #define LEDS_ALL_LEDS    (LEDS_LED1 | LEDS_LED2 | LEDS_LED3 | LEDS_LED4)
74

    
75
                        /** LED mask for none of the board LEDs. */
76
                        #define LEDS_NO_LEDS     0
77

    
78
                /* Inline Functions: */
79
                #if !defined(__DOXYGEN__)
80
                        static inline void LEDs_Init(void)
81
                        {
82
                                // TODO: Add code to initialize LED port pins as outputs here
83
                        }
84

    
85
                        static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask)
86
                        {
87
                                // TODO: Add code to turn on LEDs given in the LEDMask mask here, leave others as-is
88
                        }
89

    
90
                        static inline void LEDs_TurnOffLEDs(const uint8_t LEDMask)
91
                        {
92
                                // TODO: Add code to turn off LEDs given in the LEDMask mask here, leave others as-is
93
                        }
94

    
95
                        static inline void LEDs_SetAllLEDs(const uint8_t LEDMask)
96
                        {
97
                                // TODO: Add code to turn on only LEDs given in the LEDMask mask here, all others off
98
                        }
99

    
100
                        static inline void LEDs_ChangeLEDs(const uint8_t LEDMask, const uint8_t ActiveMask)
101
                        {
102
                                // TODO: Add code to set the Leds in the given LEDMask to the status given in ActiveMask here
103
                        }
104

    
105
                        static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
106
                        {
107
                                // TODO: Add code to toggle the Leds in the given LEDMask, ignoring all others
108
                        }
109

    
110
                        static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;
111
                        static inline uint8_t LEDs_GetLEDs(void)
112
                        {
113
                                // TODO: Add code to return the current LEDs status' here which can be masked against LED_LED* macros
114
                        }
115
                #endif
116

    
117
        /* Disable C linkage for C++ Compilers: */
118
                #if defined(__cplusplus)
119
                        }
120
                #endif
121

    
122
#endif
123