LMS 2012
|
#include <asm/types.h>
#include <linux/time.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.
Data Structures | |
struct | INPORT |
struct | OUTPORT |
Macros | |
#define | HW_ID_SUPPORT |
#define | INPUTADCPORTS 12 |
#define | INPUTADCPOWERS 4 |
#define | INPUTADC (INPUTADCPORTS + INPUTADCPOWERS) |
#define | NO_OF_INPUT_PORTS INPUTS |
#define | NO_OF_OUTPUT_PORTS OUTPUTS |
#define | PUDisable iowrite32(ioread32(da8xx_syscfg1_base + 0x0C) & ~0xFFFFFFFF,da8xx_syscfg1_base + 0x0C) |
#define | MODULE_NAME "analog_module" |
#define | DEVICE1_NAME ANALOG_DEVICE |
#define | DEVICE2_NAME TEST_PIN_DEVICE |
#define | DEVICE3_NAME DCM_DEVICE |
#define | __USE_POSIX |
#define | PINFloat(port, pin) |
#define | PINRead(port, pin) ((*InputPortPin[port][pin].pGpio).in_data & InputPortPin[port][pin].Mask) |
#define | PINHigh(port, pin) |
#define | PINLow(port, pin) |
#define | POUTFloat(port, pin) |
#define | POUTRead(port, pin) ((*OutputPortPin[port][pin].pGpio).in_data & OutputPortPin[port][pin].Mask) |
#define | POUTHigh(port, pin) |
#define | POUTLow(port, pin) |
#define | IGENOn |
#define | IGENOff |
#define | BATENOn |
#define | BATENOff |
#define | SPI0_CLOCK 150000000 |
#define | ADC_TIME 8 |
#define | ADC_CLOCK (((ULONG)1000000 * (ULONG)16) / (ULONG)ADC_TIME) |
#define | CNVSPD (((ULONG)SPI0_CLOCK / (ULONG)ADC_CLOCK) - 1) |
#define | SPIGCR0 0 |
#define | SPIGCR1 1 |
#define | SPIINT0 2 |
#define | SPILVL 3 |
#define | SPIFLG 4 |
#define | SPIPC0 5 |
#define | SPIPC1 6 |
#define | SPIPC2 7 |
#define | SPIPC3 8 |
#define | SPIPC4 9 |
#define | SPIPC5 10 |
#define | SPIDAT0 14 |
#define | SPIDAT1 15 |
#define | SPIBUF 16 |
#define | SPIEMU 17 |
#define | SPIDELAY 18 |
#define | SPIDEF 19 |
#define | SPIFMT0 20 |
#define | SPIFMT1 21 |
#define | SPIFMT2 22 |
#define | SPIFMT3 23 |
#define | INTVEC1 25 |
#define | SPIRxempty (Spi0[SPIBUF] & 0x80000000) |
#define | SPITxfull (Spi0[SPIBUF] & 0x20000000) |
#define | SPIInit |
#define | SPIExit |
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) |
void | SpiSaveReg (void) |
void | SpiRestoreReg (void) |
void | SpiInit (void) |
void | SpiExit (void) |
UWORD | SpiUpdate (UWORD DataOut) |
UWORD | Device1GetInputPins (UBYTE Port) |
UWORD | Device1GetOutputPins (UBYTE Port) |
void | NxtColorCommStart (UBYTE Port, UBYTE Cmd) |
UBYTE | NxtColorCommReady (UBYTE Port) |
void | NxtColorCommStop (UBYTE Port) |
module_param (HwId, charp, 0) | |
#define __USE_POSIX |
Definition at line 694 of file d_analog.c.
Definition at line 964 of file d_analog.c.
#define ADC_TIME 8 |
Definition at line 961 of file d_analog.c.
#define BATENOff |
Definition at line 918 of file d_analog.c.
#define BATENOn |
Definition at line 912 of file d_analog.c.
#define CNVSPD (((ULONG)SPI0_CLOCK / (ULONG)ADC_CLOCK) - 1) |
Definition at line 965 of file d_analog.c.
#define DEVICE1_NAME ANALOG_DEVICE |
Definition at line 687 of file d_analog.c.
#define DEVICE2_NAME TEST_PIN_DEVICE |
Definition at line 688 of file d_analog.c.
#define DEVICE3_NAME DCM_DEVICE |
Definition at line 689 of file d_analog.c.
#define HW_ID_SUPPORT |
Definition at line 307 of file d_analog.c.
#define IGENOff |
Definition at line 907 of file d_analog.c.
#define IGENOn |
Definition at line 901 of file d_analog.c.
#define INPUTADC (INPUTADCPORTS + INPUTADCPOWERS) |
Definition at line 364 of file d_analog.c.
#define INPUTADCPORTS 12 |
Definition at line 362 of file d_analog.c.
#define INPUTADCPOWERS 4 |
Definition at line 363 of file d_analog.c.
#define INTVEC1 25 |
Definition at line 989 of file d_analog.c.
#define MODULE_NAME "analog_module" |
Definition at line 686 of file d_analog.c.
#define NO_OF_INPUT_PORTS INPUTS |
Definition at line 366 of file d_analog.c.
#define NO_OF_OUTPUT_PORTS OUTPUTS |
Definition at line 367 of file d_analog.c.
#define PINFloat | ( | port, | |
pin | |||
) |
Definition at line 863 of file d_analog.c.
#define PINHigh | ( | port, | |
pin | |||
) |
Definition at line 871 of file d_analog.c.
#define PINLow | ( | port, | |
pin | |||
) |
Definition at line 876 of file d_analog.c.
#define PINRead | ( | port, | |
pin | |||
) | ((*InputPortPin[port][pin].pGpio).in_data & InputPortPin[port][pin].Mask) |
Definition at line 868 of file d_analog.c.
#define POUTFloat | ( | port, | |
pin | |||
) |
Definition at line 882 of file d_analog.c.
#define POUTHigh | ( | port, | |
pin | |||
) |
Definition at line 890 of file d_analog.c.
#define POUTLow | ( | port, | |
pin | |||
) |
Definition at line 896 of file d_analog.c.
#define POUTRead | ( | port, | |
pin | |||
) | ((*OutputPortPin[port][pin].pGpio).in_data & OutputPortPin[port][pin].Mask) |
Definition at line 887 of file d_analog.c.
#define PUDisable iowrite32(ioread32(da8xx_syscfg1_base + 0x0C) & ~0xFFFFFFFF,da8xx_syscfg1_base + 0x0C) |
Definition at line 657 of file d_analog.c.
#define SPI0_CLOCK 150000000 |
Definition at line 959 of file d_analog.c.
#define SPIBUF 16 |
Definition at line 981 of file d_analog.c.
#define SPIDAT0 14 |
Definition at line 979 of file d_analog.c.
#define SPIDAT1 15 |
Definition at line 980 of file d_analog.c.
#define SPIDEF 19 |
Definition at line 984 of file d_analog.c.
#define SPIDELAY 18 |
Definition at line 983 of file d_analog.c.
#define SPIEMU 17 |
Definition at line 982 of file d_analog.c.
#define SPIExit |
Definition at line 1008 of file d_analog.c.
#define SPIFLG 4 |
Definition at line 972 of file d_analog.c.
#define SPIFMT0 20 |
Definition at line 985 of file d_analog.c.
#define SPIFMT1 21 |
Definition at line 986 of file d_analog.c.
#define SPIFMT2 22 |
Definition at line 987 of file d_analog.c.
#define SPIFMT3 23 |
Definition at line 988 of file d_analog.c.
#define SPIGCR0 0 |
Definition at line 968 of file d_analog.c.
#define SPIGCR1 1 |
Definition at line 969 of file d_analog.c.
#define SPIInit |
Definition at line 997 of file d_analog.c.
#define SPIINT0 2 |
Definition at line 970 of file d_analog.c.
#define SPILVL 3 |
Definition at line 971 of file d_analog.c.
#define SPIPC0 5 |
Definition at line 973 of file d_analog.c.
#define SPIPC1 6 |
Definition at line 974 of file d_analog.c.
#define SPIPC2 7 |
Definition at line 975 of file d_analog.c.
#define SPIPC3 8 |
Definition at line 976 of file d_analog.c.
#define SPIPC4 9 |
Definition at line 977 of file d_analog.c.
#define SPIPC5 10 |
Definition at line 978 of file d_analog.c.
#define SPIRxempty (Spi0[SPIBUF] & 0x80000000) |
Definition at line 994 of file d_analog.c.
#define SPITxfull (Spi0[SPIBUF] & 0x20000000) |
Definition at line 995 of file d_analog.c.
enum AdcPowerPins |
Enumerator | |
---|---|
ADCONIGEN | |
ADCBATEN | |
ADC_POWER_PINS |
Definition at line 354 of file d_analog.c.
enum DCM_STATE |
Definition at line 1636 of file d_analog.c.
enum InputPortPins |
Enumerator | |
---|---|
INPUT_PORT_PIN1 | |
INPUT_PORT_PIN2 | |
INPUT_PORT_PIN5 | |
INPUT_PORT_PIN6 | |
INPUT_PORT_BUF | |
INPUT_PORT_PINS | |
INPUT_PORT_VALUE |
Definition at line 320 of file d_analog.c.
enum InputSpiPins |
Enumerator | |
---|---|
ADCMOSI | |
ADCMISO | |
ADCCLK | |
ADCCS | |
ADC_SPI_PINS |
Definition at line 332 of file d_analog.c.
enum OutputPortPins |
Enumerator | |
---|---|
OUTPUT_PORT_PIN1 | |
OUTPUT_PORT_PIN2 | |
OUTPUT_PORT_PIN5W | |
OUTPUT_PORT_PIN5R | |
OUTPUT_PORT_PIN6 | |
OUTPUT_PORT_PINS | |
OUTPUT_PORT_VALUE | |
PWM | |
DIR0 | |
DIR1 | |
INT | |
DIR | |
SLEEP | |
FAULT | |
OUTPUT_PORT_PINS |
Definition at line 342 of file d_analog.c.
Definition at line 1735 of file d_analog.c.
Definition at line 1754 of file d_analog.c.
void InitGpio | ( | void | ) |
Definition at line 774 of file d_analog.c.
MODULE_AUTHOR | ( | "The LEGO Group" | ) |
MODULE_DESCRIPTION | ( | MODULE_NAME | ) |
module_exit | ( | ModuleExit | ) |
module_init | ( | ModuleInit | ) |
MODULE_LICENSE | ( | "GPL" | ) |
module_param | ( | HwId | , |
charp | , | ||
0 | |||
) |
MODULE_SUPPORTED_DEVICE | ( | DEVICE1_NAME | ) |
Definition at line 2537 of file d_analog.c.
Definition at line 2517 of file d_analog.c.
void NxtColorCommStop | ( | UBYTE | Port | ) |
Definition at line 2550 of file d_analog.c.
void SetGpio | ( | int | Pin | ) |
Definition at line 735 of file d_analog.c.
void SpiExit | ( | void | ) |
Definition at line 1084 of file d_analog.c.
void SpiInit | ( | void | ) |
Definition at line 1056 of file d_analog.c.
void SpiRestoreReg | ( | void | ) |
Definition at line 1043 of file d_analog.c.
void SpiSaveReg | ( | void | ) |
Definition at line 1030 of file d_analog.c.
Definition at line 1101 of file d_analog.c.
INPIN AdcPowerPin[ADC_POWER_PINS] |
Definition at line 375 of file d_analog.c.
char DcmStateText[DCM_STATES][50] |
Definition at line 1664 of file d_analog.c.
int Hw = 0 |
Definition at line 317 of file d_analog.c.
INPORT InputPort[NO_OF_INPUT_PORTS] |
Definition at line 1244 of file d_analog.c.
INPORT InputPortDefault |
Definition at line 1691 of file d_analog.c.
INPIN InputPortPin[NO_OF_INPUT_PORTS][INPUT_PORT_PINS] |
Definition at line 371 of file d_analog.c.
OUTPORT OutputPort[NO_OF_OUTPUT_PORTS] |
Definition at line 1262 of file d_analog.c.
OUTPORT OutputPortDefault |
Definition at line 1702 of file d_analog.c.
INPIN OutputPortPin[NO_OF_OUTPUT_PORTS][OUTPUT_PORT_PINS] |
Definition at line 373 of file d_analog.c.
INPIN* pAdcPowerPin[] |
Definition at line 676 of file d_analog.c.
INPIN* pInputPortPin[] |
Definition at line 660 of file d_analog.c.
INPIN* pOutputPortPin[] |
Definition at line 668 of file d_analog.c.
ULONG SpiSave0 |
Definition at line 1020 of file d_analog.c.
ULONG SpiSave1 |
Definition at line 1021 of file d_analog.c.
ULONG SpiSave2 |
Definition at line 1022 of file d_analog.c.
ULONG SpiSave3 |
Definition at line 1023 of file d_analog.c.
ULONG SpiSave4 |
Definition at line 1024 of file d_analog.c.
ULONG SpiSave5 |
Definition at line 1025 of file d_analog.c.
ULONG SpiSave6 |
Definition at line 1026 of file d_analog.c.
ULONG SpiSave7 |
Definition at line 1027 of file d_analog.c.