added skeleton for planned i2c API
This commit is contained in:
@@ -196,3 +196,4 @@ util/bas_string.c
|
||||
util/printf_helper.S
|
||||
util/wait.c
|
||||
bas.lk.in
|
||||
i2c/i2c.c
|
||||
|
||||
@@ -52,7 +52,7 @@ TRGTDIRS= ./firebee ./m5484lite ./m54455
|
||||
OBJDIRS=$(patsubst %, %/objs,$(TRGTDIRS))
|
||||
TOOLDIR=util
|
||||
|
||||
VPATH=dma exe flash fs if kbd pci spi sys usb net util video radeon x86emu xhdi
|
||||
VPATH=dma exe flash fs i2c if kbd pci spi sys usb net util video radeon x86emu xhdi
|
||||
|
||||
# Linker control file. The final $(LDCFILE) is intermediate only (preprocessed version of $(LDCSRC)
|
||||
LDCFILE=bas.lk
|
||||
@@ -85,6 +85,7 @@ CSRCS= \
|
||||
s19reader.c \
|
||||
flash.c \
|
||||
dma.c \
|
||||
i2c.c \
|
||||
xhdi_sd.c \
|
||||
xhdi_interface.c \
|
||||
pci.c \
|
||||
|
||||
41
BaS_gcc/i2c/i2c.c
Normal file
41
BaS_gcc/i2c/i2c.c
Normal file
@@ -0,0 +1,41 @@
|
||||
|
||||
#include <bas_types.h>
|
||||
|
||||
void i2c_init(void)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void i2c_set_frequency(int hz)
|
||||
{
|
||||
}
|
||||
|
||||
int i2c_read(int address, char *data, int lengt, bool repeated)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int i2c_read_byte(int ack)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int i2c_write(int address, const char *data, int length, bool repeated)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int i2c_write_byte(int data)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void i2c_start(void)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void i2c_stop(void)
|
||||
{
|
||||
|
||||
}
|
||||
@@ -28,6 +28,8 @@
|
||||
#ifndef _I2C_H
|
||||
#define _I2C_H
|
||||
|
||||
#include "bas_types.h"
|
||||
|
||||
/* --- General options ------------------------------------------------ */
|
||||
|
||||
struct i2c_msg;
|
||||
@@ -82,4 +84,13 @@ struct i2c_msg
|
||||
unsigned char *buf; /* pointer to msg data */
|
||||
};
|
||||
|
||||
extern void i2c_init(void);
|
||||
extern void i2c_set_frequency(int hz);
|
||||
extern int i2c_read(int address, char *data, int lengt, bool repeated);
|
||||
extern int i2c_read_byte(int ack);
|
||||
extern int i2c_write(int address, const char *data, int length, bool repeated);
|
||||
extern int i2c_write_byte(int data);
|
||||
extern void i2c_start(void);
|
||||
extern void i2c_stop(void);
|
||||
|
||||
#endif /* _I2C_H */
|
||||
|
||||
Reference in New Issue
Block a user