12345678910111213141516171819202122232425262728293031323334353637383940 |
- #ifndef __SK9822_H
- #define __SK9822_H
- #include <ioCC2530.h>
- #include "OnBoard.h"
- #define SK9822_SCK_PIN P1_4 //数据引脚
- #define SK9822_SCK_NUM GPIO_4
- #define SK9822_SDI_PIN P1_3 //数据引脚
- #define SK9822_SDI_NUM GPIO_3
- #define SK9822_PORT P1DIR
- //引脚配置为输出;
- #define SK9822_SCK_PIN_OUT() { SK9822_PORT |= SK9822_SCK_NUM; asm("NOP"); }
- //引脚配置为输入;
- #define SK9822_SCK_PIN_IN() { SK9822_PORT &= ~SK9822_SCK_NUM; asm("NOP"); }
- //引脚配置为输出;
- #define SK9822_SDI_PIN_OUT() { SK9822_PORT |= SK9822_SDI_NUM; asm("NOP"); }
- //引脚配置为输入;
- #define SK9822_SDI_PIN_IN() { SK9822_PORT &= ~SK9822_SDI_NUM; asm("NOP"); }
- //拉高数据线;
- #define SK9822_SCK_PIN_H() { SK9822_SCK_PIN = 1; asm("NOP"); }
- //拉低数据线;
- #define SK9822_SCK_PIN_L() { SK9822_SCK_PIN = 0; asm("NOP"); }
- //拉高数据线;
- #define SK9822_SDI_PIN_H() { SK9822_SDI_PIN = 1; asm("NOP"); }
- //拉低数据线;
- #define SK9822_SDI_PIN_L() { SK9822_SDI_PIN = 0; asm("NOP");}
- void SK9822_Write_Data(unsigned char Bri,unsigned char RED,unsigned char GREEN,unsigned char BLUE);
- void SK9822_Write_Byte(unsigned char Data);
- void SK9822_Intit(void);
- #endif
|