#include "lms2012.h"
#include "c_com.h"
#include "c_bt.h"
#include "c_i2c.h"
#include <stdio.h>
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <signal.h>
#include <sys/mman.h>
#include <time.h>
#include <errno.h>
#include <sys/ioctl.h>
#include <linux/i2c.h>
#include <linux/i2c-dev.h>
#include <pthread.h>
Go to the source code of this file.
|
enum | { WRITE_DATA = 0x2A,
READ_STATUS = 0x2A,
WRITE_RAW = 0x2B,
READ_DATA = 0x2B
} |
|
enum | { CTS_PIC,
PIC_RST,
PIC_EN,
BLUETOOTH_PINS
} |
|
enum | { SET = 0,
CLEAR = 1,
HIIMP = 2
} |
|
enum | {
OVERRUN_ERROR = 0x01,
CRC_ERROR = 0x02,
INCORRECT_ACTION = 0x03,
UNEXPECTED_ERROR = 0x04,
RAW_OVERRUN_ERROR = 0x05
} |
|
|
UBYTE | I2cReadStatus (UBYTE *pBuf) |
|
UBYTE | I2cReadCts (void) |
|
int | I2cRead (int fd, unsigned int addr, char *buf, unsigned char len) |
|
int | I2cWrite (int fd, unsigned int addr, char *buf, unsigned char len) |
|
void * | I2cCtrl (void *ptr) |
|
void | I2cSetPIC_RST (void) |
|
void | I2cClearPIC_RST (void) |
|
void | I2cSetPIC_EN (void) |
|
void | I2cClearPIC_EN (void) |
|
void | I2cHiImpPIC_EN (void) |
|
RESULT | I2cInit (READBUF *pBuf, WRITEBUF *pWriteBuf, char *pBundleId, char *pBundleSeedId) |
|
void | I2cExit (void) |
|
void | I2cStart (void) |
|
void | I2cStop (void) |
|
UWORD | DataToMode2Decoding (UBYTE *pBuf, UWORD Length) |
|
UBYTE | I2cGetBootStatus (void) |
|
|
char * | RtnMsg = "I2c Func thread end" |
|
#define APPDATABUF_SIZE 150 |
#define BUFAddInPtr |
( |
|
Val | ) |
(Mode2InBuf.InPtr = ((Mode2InBuf.InPtr + Val) & ((UWORD)(MODE2BUF_SIZE - 1)))) |
#define BUFAddOutPtr |
( |
|
Val | ) |
(Mode2InBuf.OutPtr = ((Mode2InBuf.OutPtr + Val) & ((UWORD)(MODE2BUF_SIZE - 1)))) |
#define BUFBytesAvail ((Mode2InBuf.InPtr - Mode2InBuf.OutPtr) & ((UWORD)(MODE2BUF_SIZE - 1))) |
#define BUFBytesFree (((Mode2InBuf.OutPtr - Mode2InBuf.InPtr) - 1) & ((UWORD)(MODE2BUF_SIZE - 1))) |
Value:
ThreadRunState = 0;\
}
UBYTE cBtDiscChNo(UBYTE ChNo)
Definition at line 162 of file c_i2c.c.
#define MODE2BUF_SIZE 1024 |
#define SLEEPuS ((ULONG)(1000)) |
Enumerator |
---|
WRITE_DATA |
|
READ_STATUS |
|
WRITE_RAW |
|
READ_DATA |
|
Definition at line 76 of file c_i2c.c.
Enumerator |
---|
CTS_PIC |
|
PIC_RST |
|
PIC_EN |
|
BLUETOOTH_PINS |
|
Definition at line 85 of file c_i2c.c.
Enumerator |
---|
SET |
|
CLEAR |
|
HIIMP |
|
Definition at line 93 of file c_i2c.c.
Enumerator |
---|
OVERRUN_ERROR |
|
CRC_ERROR |
|
INCORRECT_ACTION |
|
UNEXPECTED_ERROR |
|
RAW_OVERRUN_ERROR |
|
Definition at line 100 of file c_i2c.c.
void I2cClearPIC_EN |
( |
void |
| ) |
|
void I2cClearPIC_RST |
( |
void |
| ) |
|
void * I2cCtrl |
( |
void * |
ptr | ) |
|
UBYTE I2cGetBootStatus |
( |
void |
| ) |
|
void I2cHiImpPIC_EN |
( |
void |
| ) |
|
RESULT I2cInit |
( |
READBUF * |
pBuf, |
|
|
WRITEBUF * |
pWriteBuf, |
|
|
char * |
pBundleId, |
|
|
char * |
pBundleSeedId |
|
) |
| |
int I2cRead |
( |
int |
fd, |
|
|
unsigned int |
addr, |
|
|
char * |
buf, |
|
|
unsigned char |
len |
|
) |
| |
UBYTE I2cReadCts |
( |
void |
| ) |
|
void I2cSetPIC_EN |
( |
void |
| ) |
|
void I2cSetPIC_RST |
( |
void |
| ) |
|
int I2cWrite |
( |
int |
fd, |
|
|
unsigned int |
addr, |
|
|
char * |
buf, |
|
|
unsigned char |
len |
|
) |
| |
char* RtnMsg = "I2c Func thread end" |