LMS 2012
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
d_bt.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/hrtimer.h>
#include <linux/mm.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   "bluetooth_module"
 
#define DEVICE1_NAME   BT_DEVICE
 
#define DEVICE2_NAME   UPDATE_DEVICE
 
#define __USE_POSIX
 
#define BtFloat(pin)
 
#define BtRead(pin)   ((*pBluetoothPin[Hw][pin].pGpio).in_data & pBluetoothPin[Hw][pin].Mask)
 
#define BtHigh(pin)
 
#define BtLow(pin)
 

Enumerations

enum  { SET = 0, CLEAR = 1, HIIMP = 2 }
 
enum  BluetoothPins { CTS_PIC, PIC_RST, PIC_EN, BLUETOOTH_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 EP2_BluetoothPin [BLUETOOTH_PINS]
 
INPIN FINALB_BluetoothPin [BLUETOOTH_PINS]
 
INPIN FINAL_BluetoothPin [BLUETOOTH_PINS]
 
INPINpBluetoothPin []
 

Macro Definition Documentation

#define __USE_POSIX

Definition at line 40 of file d_bt.c.

#define BtFloat (   pin)
Value:
{\
(*pBluetoothPin[Hw][pin].pGpio).dir |= pBluetoothPin[Hw][pin].Mask;\
}
GPIOC pGpio
Definition: am1808.h:225
INPIN * pBluetoothPin[]
Definition: d_bt.c:118
int Hw
Definition: d_bt.c:31

Definition at line 183 of file d_bt.c.

#define BtHigh (   pin)
Value:
{\
(*pBluetoothPin[Hw][pin].pGpio).set_data = pBluetoothPin[Hw][pin].Mask;\
(*pBluetoothPin[Hw][pin].pGpio).dir &= ~pBluetoothPin[Hw][pin].Mask;\
}
GPIOC pGpio
Definition: am1808.h:225
INPIN * pBluetoothPin[]
Definition: d_bt.c:118
int Hw
Definition: d_bt.c:31

Definition at line 189 of file d_bt.c.

#define BtLow (   pin)
Value:
{\
(*pBluetoothPin[Hw][pin].pGpio).clr_data = pBluetoothPin[Hw][pin].Mask;\
(*pBluetoothPin[Hw][pin].pGpio).dir &= ~pBluetoothPin[Hw][pin].Mask;\
}
GPIOC pGpio
Definition: am1808.h:225
INPIN * pBluetoothPin[]
Definition: d_bt.c:118
int Hw
Definition: d_bt.c:31

Definition at line 194 of file d_bt.c.

#define BtRead (   pin)    ((*pBluetoothPin[Hw][pin].pGpio).in_data & pBluetoothPin[Hw][pin].Mask)

Definition at line 187 of file d_bt.c.

#define DEVICE1_NAME   BT_DEVICE

Definition at line 34 of file d_bt.c.

#define DEVICE2_NAME   UPDATE_DEVICE

Definition at line 35 of file d_bt.c.

#define HW_ID_SUPPORT

Definition at line 26 of file d_bt.c.

#define MODULE_NAME   "bluetooth_module"

Definition at line 33 of file d_bt.c.

Enumeration Type Documentation

anonymous enum
Enumerator
SET 
CLEAR 
HIIMP 

Definition at line 78 of file d_bt.c.

Enumerator
CTS_PIC 
PIC_RST 
PIC_EN 
BLUETOOTH_PINS 

Definition at line 85 of file d_bt.c.

Function Documentation

void InitGpio ( void  )

Definition at line 165 of file d_bt.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 129 of file d_bt.c.

Variable Documentation

INPIN EP2_BluetoothPin[BLUETOOTH_PINS]
Initial value:
=
{
{ GP5_7 , NULL, 0 },
{ GP4_14 , NULL, 0 },
{ GP3_3 , NULL, 0 },
}
Definition: am1808.h:37
Definition: am1808.h:36
Definition: am1808.h:38
#define NULL

Definition at line 94 of file d_bt.c.

INPIN FINAL_BluetoothPin[BLUETOOTH_PINS]
Initial value:
=
{
{ GP5_7 , NULL, 0 },
{ GP4_14 , NULL, 0 },
{ GP3_3 , NULL, 0 },
}
Definition: am1808.h:37
Definition: am1808.h:36
Definition: am1808.h:38
#define NULL

Definition at line 110 of file d_bt.c.

INPIN FINALB_BluetoothPin[BLUETOOTH_PINS]
Initial value:
=
{
{ GP5_7 , NULL, 0 },
{ GP4_14 , NULL, 0 },
{ GP3_3 , NULL, 0 },
}
Definition: am1808.h:37
Definition: am1808.h:36
Definition: am1808.h:38
#define NULL

Definition at line 102 of file d_bt.c.

int Hw = 0

Definition at line 31 of file d_bt.c.

INPIN* pBluetoothPin[]
Initial value:
=
{
}
INPIN EP2_BluetoothPin[BLUETOOTH_PINS]
Definition: d_bt.c:94
Definition: am1808.h:222
#define EP2
Schematics revision D.
Definition: lms2012.h:99
INPIN FINALB_BluetoothPin[BLUETOOTH_PINS]
Definition: d_bt.c:102
#define FINAL
Final prototype.
Definition: lms2012.h:101
INPIN FINAL_BluetoothPin[BLUETOOTH_PINS]
Definition: d_bt.c:110
#define FINALB
Schematics revision B and C.
Definition: lms2012.h:100

Definition at line 118 of file d_bt.c.