|
@@ -28,7 +28,6 @@ static void _delay_c(uint32_t cycle);
|
|
void display_Init(void) {
|
|
void display_Init(void) {
|
|
|
|
|
|
while ((SPI1->SR & SPI_SR_BSY) != 0) { __NOP(); }
|
|
while ((SPI1->SR & SPI_SR_BSY) != 0) { __NOP(); }
|
|
- display_Fill(0x0);
|
|
|
|
|
|
|
|
GPIO_SPI_SW();
|
|
GPIO_SPI_SW();
|
|
HT1632C_CS_ON;
|
|
HT1632C_CS_ON;
|
|
@@ -40,6 +39,8 @@ void display_Init(void) {
|
|
|
|
|
|
HT1632C_CS_OFF;
|
|
HT1632C_CS_OFF;
|
|
GPIO_SPI_HW();
|
|
GPIO_SPI_HW();
|
|
|
|
+
|
|
|
|
+ display_Fill(0x0);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -175,7 +176,7 @@ static void _delay_c(uint32_t cycle) {
|
|
* @param nbits num of bits (1<<(num-1))
|
|
* @param nbits num of bits (1<<(num-1))
|
|
*/
|
|
*/
|
|
void _display_WriteBits(const uint16_t data, uint16_t nbits) {
|
|
void _display_WriteBits(const uint16_t data, uint16_t nbits) {
|
|
- _delay_c(2);
|
|
+
|
|
do {
|
|
do {
|
|
HT1632C_WR_LOW;
|
|
HT1632C_WR_LOW;
|
|
|
|
|
|
@@ -184,9 +185,9 @@ void _display_WriteBits(const uint16_t data, uint16_t nbits) {
|
|
} else {
|
|
} else {
|
|
HT1632C_DATA_0;
|
|
HT1632C_DATA_0;
|
|
}
|
|
}
|
|
- _delay_c(5);
|
|
+
|
|
HT1632C_WR_HGH;
|
|
HT1632C_WR_HGH;
|
|
- _delay_c(5);
|
|
+
|
|
} while (nbits >>= 1);
|
|
} while (nbits >>= 1);
|
|
}
|
|
}
|
|
|
|
|