vitasdk
Documentation of the vitasdk
i2c.h
Go to the documentation of this file.
1 
6 #ifndef _PSP2KERN_LOWIO_I2C_H_
7 #define _PSP2KERN_LOWIO_I2C_H_
8 
9 #include <vitasdk/build_utils.h>
10 #include <psp2kern/types.h>
11 
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15 
16 typedef enum SceI2cErrorCode {
19  SCE_I2C_ERROR_INVALID_ADDR = 0x803F0303
21 
22 typedef struct SceI2cDebugHandlers {
23  unsigned int size;
24  void (*write_start)(int bus, int addr, unsigned char *buffer, int size);
25  void (*write_end)(int bus, int error, int result);
26  void (*read_start)(int bus, int addr, unsigned char *buffer, int size);
27  void (*read_end)(int bus, int error, int result);
28  void (*write_read_start)(int bus, int write_addr, unsigned char *write_buffer, int write_size,
29  unsigned int read_addr, unsigned char *read_buffer, int read_size);
30  void (*write_read_end)(int bus, int error, int result);
33 
34 int ksceI2cInit(int bus);
35 int ksceI2cReset(int bus);
36 int ksceI2cTransferRead(int bus, unsigned int addr, unsigned char *buffer, int size);
37 int ksceI2cTransferWrite(int bus, unsigned int addr, const unsigned char *buffer, int size);
39  unsigned int write_addr, unsigned char *write_buffer, int write_size,
40  unsigned int read_addr, unsigned char *read_buffer, int read_size);
41 
42 int ksceI2cSetDebugHandlers(int bus, SceI2cDebugHandlers *debug_handlers);
43 
44 #ifdef __cplusplus
45 }
46 #endif
47 
48 #endif /* _PSP2KERN_LOWIO_I2C_H_ */
49 
void * buffer
Definition: bt.h:6
VITASDK_BUILD_ASSERT_EQ(0x1C, SceI2cDebugHandlers)
void(* write_start)(int bus, int addr, unsigned char *buffer, int size)
Definition: i2c.h:24
int ksceI2cInit(int bus)
int ksceI2cSetDebugHandlers(int bus, SceI2cDebugHandlers *debug_handlers)
void(* write_read_start)(int bus, int write_addr, unsigned char *write_buffer, int write_size, unsigned int read_addr, unsigned char *read_buffer, int read_size)
Definition: i2c.h:28
void(* read_start)(int bus, int addr, unsigned char *buffer, int size)
Definition: i2c.h:26
int ksceI2cReset(int bus)
void(* write_read_end)(int bus, int error, int result)
Definition: i2c.h:30
SceI2cErrorCode
Definition: i2c.h:16
int ksceI2cTransferRead(int bus, unsigned int addr, unsigned char *buffer, int size)
void(* write_end)(int bus, int error, int result)
Definition: i2c.h:25
unsigned int size
Definition: i2c.h:23
int ksceI2cTransferWrite(int bus, unsigned int addr, const unsigned char *buffer, int size)
int ksceI2cTransferWriteRead(int bus, unsigned int write_addr, unsigned char *write_buffer, int write_size, unsigned int read_addr, unsigned char *read_buffer, int read_size)
void(* read_end)(int bus, int error, int result)
Definition: i2c.h:27
@ SCE_I2C_ERROR_INVALID_BUS
Definition: i2c.h:17
@ SCE_I2C_ERROR_INVALID_SIZE
Definition: i2c.h:18
@ SCE_I2C_ERROR_INVALID_ADDR
Definition: i2c.h:19
Definition: i2c.h:22
SceSize size
struct size(variable size)
Definition: debug.h:0