forked from PAWPAW-Mirror/lib_xua
Remove L2 channel style i2c
This commit is contained in:
@@ -1,10 +1,4 @@
|
|||||||
|
|
||||||
// Channel interface
|
|
||||||
void I2cRegWriteC(int deviceAdrs, int Adrs, int WrData, chanend c);
|
|
||||||
|
|
||||||
int I2cRegReadC(int deviceAdrs, int Adrs, chanend c);
|
|
||||||
|
|
||||||
// Function interface
|
|
||||||
void I2cRegWrite(int deviceAdrs, int Adrs, int WrData, port AUD_SCLK, port AUD_SDIN);
|
void I2cRegWrite(int deviceAdrs, int Adrs, int WrData, port AUD_SCLK, port AUD_SDIN);
|
||||||
|
|
||||||
int I2cRegRead(int deviceAdrs, int Adrs, port AUD_SCLK, port AUD_SDIN);
|
int I2cRegRead(int deviceAdrs, int Adrs, port AUD_SCLK, port AUD_SDIN);
|
||||||
|
|||||||
@@ -1,28 +1,6 @@
|
|||||||
#include <xs1.h>
|
#include <xs1.h>
|
||||||
#include <print.h>
|
#include <print.h>
|
||||||
|
|
||||||
int I2cRegReadC(int device, int addr, chanend c) {
|
|
||||||
int read;
|
|
||||||
int retVal;
|
|
||||||
c <: 0; // isWrite
|
|
||||||
c <: device;
|
|
||||||
c <: addr;
|
|
||||||
c <: 1; // only ever one byte
|
|
||||||
c :> read;
|
|
||||||
c :> retVal;
|
|
||||||
return read;
|
|
||||||
}
|
|
||||||
|
|
||||||
void I2cRegWriteC(int device, int addr, int data, chanend c) {
|
|
||||||
int retVal;
|
|
||||||
c <: 1; // isWrite
|
|
||||||
c <: device;
|
|
||||||
c <: addr;
|
|
||||||
c <: 1; // only ever one byte
|
|
||||||
c <: data;
|
|
||||||
c :> retVal;
|
|
||||||
}
|
|
||||||
|
|
||||||
int I2cRegRead(int device, int addr, port scl, port sda)
|
int I2cRegRead(int device, int addr, port scl, port sda)
|
||||||
{
|
{
|
||||||
//int Result;
|
//int Result;
|
||||||
|
|||||||
Reference in New Issue
Block a user