SysIo  1.9.0
Embedded Library and tools
chipio.h
1 
8 #ifndef _CHIPIO_H_
9 #define _CHIPIO_H_
10 
11 #include <sysio/defs.h>
12 #ifdef __cplusplus
13  extern "C" {
14 #endif
15 /* ========================================================================== */
16 
25 /* constants ================================================================ */
29 typedef enum {
30  eChipIoOptionLcd = 0x01,
31  eChipIoOptionAdc = 0x02,
32  eChipIoOptionSerial = 0x04,
33  eChipIoOptionSerialIrq = 0x40,
34  eChipIoOptionLcdSplashScreen = 0x80
36 
37 /* structures =============================================================== */
43 typedef struct xChipIo xChipIo;
44 
45 /* internal public functions ================================================ */
46 
54 xChipIo * xChipIoOpen (const char * sI2cBus, int iSlaveAddr);
55 
62 int iChipIoClose (xChipIo * chip);
63 
70 int iChipIoRevisionMajor (xChipIo * chip);
71 
78 int iChipIoRevisionMinor (xChipIo * chip);
79 
86 int iChipIoAvailableOptions (xChipIo * chip);
87 
100 int iChipIoReadReg8 (xChipIo * chip, uint8_t reg);
101 
114 int iChipIoReadReg16 (xChipIo * chip, uint8_t reg);
115 
130 int iChipIoReadRegBlock (xChipIo * chip, uint8_t reg, uint8_t * buffer, uint8_t size);
131 
143 int iChipIoWriteReg8 (xChipIo * chip, uint8_t reg, uint8_t data);
144 
156 int iChipIoWriteReg16 (xChipIo * chip, uint8_t reg, uint16_t data);
157 
171 int iChipIoWriteRegBlock (xChipIo * chip, uint8_t reg, const uint8_t * buffer, uint8_t size);
172 
177 /* ========================================================================== */
178 #ifdef __cplusplus
179  }
180 #endif
181 #endif /* _CHIPIO_H_ */
int iChipIoWriteReg16(xChipIo *chip, uint8_t reg, uint16_t data)
Ecriture d&#39;un registre 16 bits.
int iChipIoRevisionMinor(xChipIo *chip)
xChipIo * xChipIoOpen(const char *sI2cBus, int iSlaveAddr)
int iChipIoAvailableOptions(xChipIo *chip)
int iChipIoRevisionMajor(xChipIo *chip)
int iChipIoWriteReg8(xChipIo *chip, uint8_t reg, uint8_t data)
Ecriture d&#39;un registre 8 bits.
struct xChipIo xChipIo
Definition: chipio.h:43
int iChipIoClose(xChipIo *chip)
int iChipIoWriteRegBlock(xChipIo *chip, uint8_t reg, const uint8_t *buffer, uint8_t size)
Ecriture d&#39;un bloc de registres.
eChipIoOptions
Definition: chipio.h:29
int iChipIoReadReg8(xChipIo *chip, uint8_t reg)
Lecture d&#39;un registre 8 bits.
int iChipIoReadReg16(xChipIo *chip, uint8_t reg)
Lecture d&#39;un registre 16 bits.
int iChipIoReadRegBlock(xChipIo *chip, uint8_t reg, uint8_t *buffer, uint8_t size)
Lecture d&#39;un bloc de registres.