LMS 2012
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
d_ui.c File Reference
#include <asm/types.h>
#include "../../lms2012/source/lms2012.h"
#include "../../lms2012/source/am1808.h"
#include <linux/kernel.h>
#include <linux/fs.h>
#include <linux/sched.h>
#include <linux/mm.h>
#include <linux/hrtimer.h>
#include <linux/init.h>
#include <linux/uaccess.h>
#include <linux/debugfs.h>
#include <linux/ioport.h>
#include <asm/gpio.h>
#include <asm/io.h>
#include <linux/module.h>
#include <linux/miscdevice.h>
#include <asm/uaccess.h>

Go to the source code of this file.

Macros

#define HW_ID_SUPPORT
 
#define MODULE_NAME   "ui_module"
 
#define DEVICE1_NAME   UI_DEVICE
 
#define NO_OF_LEDS   LEDS
 
#define NO_OF_BUTTONS   BUTTONS
 
#define BUTFloat(B)
 
#define BUTRead(B)   ((*UiButPin[B].pGpio).in_data & UiButPin[B].Mask)
 
#define DIODEInit(D)
 
#define DIODEOn(D)
 
#define DIODEOff(D)
 
#define SHM_LENGTH   (sizeof(UiDefault))
 
#define NPAGES   ((SHM_LENGTH + PAGE_SIZE - 1) / PAGE_SIZE)
 

Enumerations

enum  UiLedPins {
  DIODE0, DIODE1, DIODE2, DIODE3,
  DIODE4, DIODE5, LED_PINS
}
 
enum  UiButPins {
  BUT0, BUT1, BUT2, BUT3,
  BUT4, BUT5, BUT_PINS
}
 

Functions

 MODULE_LICENSE ("GPL")
 
 MODULE_AUTHOR ("The LEGO Group")
 
 MODULE_DESCRIPTION (MODULE_NAME)
 
 MODULE_SUPPORTED_DEVICE (DEVICE1_NAME)
 
 module_init (ModuleInit)
 
 module_exit (ModuleExit)
 
void SetGpio (int Pin)
 
void InitGpio (void)
 
 module_param (HwId, charp, 0)
 

Variables

int Hw = 0
 
INPIN UiLedPin [LED_PINS]
 
INPIN UiButPin [BUT_PINS]
 
INPINpUiLedPin []
 
INPINpUiButPin []
 
ULONG LEDPATTERNDATA [NO_OF_LEDS+1][LEDPATTERNS]
 
UBYTE PatternBlock = 0
 
UBYTE PatternBits = 20
 
UBYTE PatternBit = 0
 
ULONG ActPattern [NO_OF_LEDS]
 
ULONG TmpPattern [NO_OF_LEDS]
 

Macro Definition Documentation

#define BUTFloat (   B)
Value:
{\
(*UiButPin[B].pGpio).dir |= UiButPin[B].Mask;\
}
GPIOC pGpio
Definition: am1808.h:225
INPIN UiButPin[BUT_PINS]
Definition: d_ui.c:112

Definition at line 301 of file d_ui.c.

#define BUTRead (   B)    ((*UiButPin[B].pGpio).in_data & UiButPin[B].Mask)

Definition at line 306 of file d_ui.c.

#define DEVICE1_NAME   UI_DEVICE

Definition at line 44 of file d_ui.c.

#define DIODEInit (   D)
Value:
{\
(*UiLedPin[D].pGpio).clr_data = UiLedPin[D].Mask;\
(*UiLedPin[D].pGpio).dir &= ~UiLedPin[D].Mask;\
}
INPIN UiLedPin[LED_PINS]
Definition: d_ui.c:110
GPIOC pGpio
Definition: am1808.h:225

Definition at line 309 of file d_ui.c.

#define DIODEOff (   D)
Value:
{\
(*UiLedPin[D].pGpio).clr_data = UiLedPin[D].Mask;\
}
INPIN UiLedPin[LED_PINS]
Definition: d_ui.c:110
GPIOC pGpio
Definition: am1808.h:225

Definition at line 318 of file d_ui.c.

#define DIODEOn (   D)
Value:
{\
(*UiLedPin[D].pGpio).set_data = UiLedPin[D].Mask;\
}
INPIN UiLedPin[LED_PINS]
Definition: d_ui.c:110
GPIOC pGpio
Definition: am1808.h:225

Definition at line 314 of file d_ui.c.

#define HW_ID_SUPPORT

Definition at line 37 of file d_ui.c.

#define MODULE_NAME   "ui_module"

Definition at line 43 of file d_ui.c.

#define NO_OF_BUTTONS   BUTTONS

Definition at line 116 of file d_ui.c.

#define NO_OF_LEDS   LEDS

Definition at line 115 of file d_ui.c.

#define NPAGES   ((SHM_LENGTH + PAGE_SIZE - 1) / PAGE_SIZE)

Definition at line 478 of file d_ui.c.

#define SHM_LENGTH   (sizeof(UiDefault))

Definition at line 477 of file d_ui.c.

Enumeration Type Documentation

enum UiButPins
Enumerator
BUT0 
BUT1 
BUT2 
BUT3 
BUT4 
BUT5 
BUT_PINS 

Definition at line 98 of file d_ui.c.

enum UiLedPins
Enumerator
DIODE0 
DIODE1 
DIODE2 
DIODE3 
DIODE4 
DIODE5 
LED_PINS 

Definition at line 87 of file d_ui.c.

Function Documentation

void InitGpio ( void  )

Definition at line 238 of file d_ui.c.

MODULE_AUTHOR ( "The LEGO Group"  )
MODULE_DESCRIPTION ( MODULE_NAME  )
module_exit ( ModuleExit  )
module_init ( ModuleInit  )
MODULE_LICENSE ( "GPL"  )
module_param ( HwId  ,
charp  ,
 
)
MODULE_SUPPORTED_DEVICE ( DEVICE1_NAME  )
void SetGpio ( int  Pin)

Definition at line 207 of file d_ui.c.

Variable Documentation

ULONG ActPattern[NO_OF_LEDS]

Definition at line 336 of file d_ui.c.

int Hw = 0

Definition at line 85 of file d_ui.c.

ULONG LEDPATTERNDATA[NO_OF_LEDS+1][LEDPATTERNS]
Initial value:
=
{
{ 0x00000000, 0x00000000, 0xFFFFFFFF, 0xFFFFFFFF, 0b00000000000000000000000000000000, 0b00000000000000000111110000011111, 0b00000000000000000111110000011111, 0b00000000000000000000000000000000, 0b00000000000000000000000001110111, 0b00000000000000000000000001110111 },
{ 0x00000000, 0xFFFFFFFF, 0x00000000, 0xFFFFFFFF, 0b00000000000000000111110000011111, 0b00000000000000000000000000000000, 0b00000000000000000111110000011111, 0b00000000000000000000000001110111, 0b00000000000000000000000000000000, 0b00000000000000000000000001110111 },
{ 0x00000000, 0x00000000, 0xFFFFFFFF, 0xFFFFFFFF, 0b00000000000000000000000000000000, 0b00000000000000000111110000011111, 0b00000000000000000111110000011111, 0b00000000000000000000000000000000, 0b00000000000000000000000001110111, 0b00000000000000000000000001110111 },
{ 0x00000000, 0xFFFFFFFF, 0x00000000, 0xFFFFFFFF, 0b00000000000000000111110000011111, 0b00000000000000000000000000000000, 0b00000000000000000111110000011111, 0b00000000000000000000000001110111, 0b00000000000000000000000000000000, 0b00000000000000000000000001110111 },
{ 0 }
}

Definition at line 323 of file d_ui.c.

UBYTE PatternBit = 0

Definition at line 335 of file d_ui.c.

UBYTE PatternBits = 20

Definition at line 334 of file d_ui.c.

UBYTE PatternBlock = 0

Definition at line 333 of file d_ui.c.

INPIN* pUiButPin[]
Initial value:
=
{
[FINAL] = FINAL_UiButPin,
[FINALB] = FINALB_UiButPin,
[EP2] = EP2_UiButPin,
}
#define EP2
Schematics revision D.
Definition: lms2012.h:99
#define FINAL
Final prototype.
Definition: lms2012.h:101
#define FINALB
Schematics revision B and C.
Definition: lms2012.h:100

Definition at line 194 of file d_ui.c.

INPIN* pUiLedPin[]
Initial value:
=
{
[FINAL] = FINAL_UiLedPin,
[FINALB] = FINALB_UiLedPin,
[EP2] = EP2_UiLedPin,
}
#define EP2
Schematics revision D.
Definition: lms2012.h:99
#define FINAL
Final prototype.
Definition: lms2012.h:101
#define FINALB
Schematics revision B and C.
Definition: lms2012.h:100

Definition at line 186 of file d_ui.c.

ULONG TmpPattern[NO_OF_LEDS]

Definition at line 337 of file d_ui.c.

INPIN UiButPin[BUT_PINS]

Definition at line 112 of file d_ui.c.

INPIN UiLedPin[LED_PINS]

Definition at line 110 of file d_ui.c.