forked from PAWPAW-Mirror/lib_xua
Added new iic files
This commit is contained in:
36
module_usb_aud_shared/iic/iic.h
Executable file
36
module_usb_aud_shared/iic/iic.h
Executable file
@@ -0,0 +1,36 @@
|
||||
#ifndef IIC_H_
|
||||
#define IIC_H_
|
||||
|
||||
#include <xccompat.h>
|
||||
|
||||
int iic_initialise(timer t, port p_scl, port p_sda);
|
||||
|
||||
// Write to IIC device
|
||||
#if defined __XC__
|
||||
int iic_writeC(unsigned int address, unsigned int reg, unsigned char data[], unsigned int numBytes, chanend ?c,
|
||||
port ?p_scl, port ?p_sda);
|
||||
#elif defined __STDC__
|
||||
int iic_writeC(unsigned int address, unsigned int reg, unsigned char data[], unsigned int numBytes, chanend c,
|
||||
port p_scl, port p_sda);
|
||||
#endif
|
||||
|
||||
int iic_write(unsigned int address, unsigned int reg, unsigned char data[], unsigned int numBytes, timer t,
|
||||
port p_scl, port p_sda);
|
||||
|
||||
// Read from IIC device
|
||||
// It receives numBytes, acking each one and does not ack the final byte
|
||||
#if defined __XC__
|
||||
int iic_readC(unsigned int address, unsigned int reg, unsigned char data[], unsigned int numBytes, chanend ?c,
|
||||
port ?p_scl, port ?p_sda);
|
||||
#elif defined __STDC__
|
||||
int iic_readC(unsigned int address, unsigned int reg, unsigned char data[], unsigned int numBytes, chanend c,
|
||||
port p_scl, port p_sda);
|
||||
#endif
|
||||
|
||||
int iic_read(unsigned int address, unsigned int reg, unsigned char data[], unsigned int numBytes, timer t, port p_scl, port p_sda);
|
||||
|
||||
// iic_phy_wait
|
||||
// Wait a certain number of cycles
|
||||
void iic_phy_wait(unsigned delay, timer t);
|
||||
|
||||
#endif /*IIC_H_*/
|
||||
Reference in New Issue
Block a user