MOD:Standard

This commit is contained in:
but0n 2016-09-07 21:40:38 +08:00
parent 7ea2dcfd84
commit 06a913dc41
2 changed files with 12 additions and 4 deletions

View File

@ -51,8 +51,7 @@ typedef struct{
float aX;
float aY;
float aZ;
}SixAxis;
typedef SixAxis* pSixAxis;
}SixAxis, *pSixAxis;
void initLED();

View File

@ -17,6 +17,13 @@ void oled_portInit() {
GPIOB->CRL &= 0x00000FFF;
GPIOB->CRL |= 0x33333FFF;
SDIN_OLED = 0;
SCLK_OLED = 0;
DC_OLED = 0;
RST_OLED = 0;
CS_OLED = 0;
}
void oled_sendData(unsigned char dat) {
@ -25,13 +32,14 @@ void oled_sendData(unsigned char dat) {
unsigned char i;
for(i = 0; i < 8; i++) {
SCLK_OLED = 0;
SDIN_OLED = (dat&0x80)>>7;
dat <<= 1;
delay_oled(10);
SCLK_OLED = 1;
delay_oled(10);
SCLK_OLED = 0;
}
delay_oled(10);
CS_OLED = 1;
}
@ -41,13 +49,14 @@ void oled_sendCmd(unsigned char cmd) {
unsigned char i;
for(i = 0; i < 8; i++) {
SCLK_OLED = 0;
SDIN_OLED = (cmd&0x80)>>7;
cmd <<= 1;
delay_oled(10);
SCLK_OLED = 1;
delay_oled(10);
SCLK_OLED = 0;
}
delay_oled(10);
CS_OLED = 1;
}