Home > other >  The punctual atomic OLED experiment, by piecing together a data output
The punctual atomic OLED experiment, by piecing together a data output

Time:09-18

//to the OLED output by using the method of piecing together an 8-bit data
//data: to output digital
//8 bits for the corresponding pin PE6/PE5/PB6/PC11/PC9/PC8/PC7 PC6/
Void OLED_Data_Out (u8 data)
{
Under-16 dat=data& 0 x0f;
GPIOC - & gt; ODR&=~ (0 xf & lt; <6);//empty 6 ~ 9
GPIOC - & gt; The ODR |=dat<6;//D (3-0) - & gt; PC [or]
GPIO_Write (GPIOC, dat<6);
PCout (11)=(data> 4) & amp; 0 x01;//D4
PBout (6)=(data> 5) & amp; 0 x01;//D5
PEout (5)=(data> 6) & amp; 0 x01;//D6
PEout (6)=(data> 7) & amp; 0 x01;//D7
}
Reset the ODR first four, and then write the value of the four, why again to write a GPIO_Write, superfluous action, can't understand!
  • Related