Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

# pca9532.h

    00001
    00002 #ifndef PCA9532_H
    00003 #define PCA9532_H
    00004
    00005 #include "global.h"
    00006
    00007 // device base address
    00008 #define PCA9532_I2C_BASE_ADDR   0x60
    00009
    00010 // device registers
    00011 #define PCA9532_REG_INPUT0      0
    00012 #define PCA9532_REG_INPUT1      1
    00013 #define PCA9532_REG_PSC0        2
    00014 #define PCA9532_REG_PWM0        3
    00015 #define PCA9532_REG_PSC1        4
    00016 #define PCA9532_REG_PWM1        5
    00017 #define PCA9532_REG_LS0         6
    00018 #define PCA9532_REG_LS1         7
    00019 #define PCA9532_REG_LS2         8
    00020 #define PCA9532_REG_LS3         9
    00021
    00022 // possible pin/led states
    00023 #define PCA9532_LED_OFF         0
    00024 #define PCA9532_LED_ON          1
    00025 #define PCA9532_LED_DIM0        2
    00026 #define PCA9532_LED_DIM1        3
    00027
    00028 void pca9532Init(u08 node);
    00029
    00030 void pca9532SetPinState(u08 node, u08 pin, u08 state);
    00031
    00032 void pca9532SetFreq(u08 node, u08 ch, u08 period);
    00033
    00034 void pca9532SetPWM(u08 node, u08 ch, u08 duty);
    00035
    00036 u16 pca9532GetInput(u08 node);
    00037
    00038
    00039 #endif