memlib
Ondřej Hruška 9 years ago
parent 7913d14e09
commit 94662e35a8
  1. 13
      project/main.c
  2. 3
      project/matrixdsp.c

@ -54,7 +54,7 @@ int main(void)
mdsp_send_command_all(CMD_SCAN_LIMIT, 0x07);
mdsp_send_command_all(CMD_SHUTDOWN, 0x01);
mdsp_send_command_all(CMD_DISPLAY_TEST, 0x00);
mdsp_send_command_all(CMD_INTENSITY, 0x05);
mdsp_send_command_all(CMD_INTENSITY, 0x0F);
mdsp_clear();
@ -90,6 +90,15 @@ int main(void)
poll_subsystems();
for(int i = 0; i < 8; i++) {
mdsp_send_command_all(CMD_DIGIT0+i, i);
}
delay_ms(500);
for(int i = 7; i >= 0; i--) {
mdsp_send_command_all(CMD_DIGIT0+i, 0x00);
}
delay_ms(500);
/*for (int i = 0; i < 8; i++) {
uint32_t x = __RBIT(inva0[7-i]);
mdsp_set(i, x >> 21);
mdsp_set(8+i, (x >> 29) & 0b111);
@ -101,7 +110,7 @@ int main(void)
mdsp_set(i, x >> 21);
mdsp_set(8+i, (x >> 29) & 0b111);
}
delay_ms(500);
delay_ms(500);*/
}
}

@ -57,7 +57,7 @@ void mdsp_send_command(uint8_t idx, MDSP_Command cmd, uint8_t data)
void mdsp_send_command_all(MDSP_Command cmd, uint8_t data)
{
dbg("Set cmd 0x%02x, data 0x%02x ALL", cmd, data);
//dbg("Set cmd 0x%02x, data 0x%02x ALL", cmd, data);
set_nss(false);
while (MDSP_SPIx->SR & SPI_SR_BSY);
@ -67,7 +67,6 @@ void mdsp_send_command_all(MDSP_Command cmd, uint8_t data)
}
while (MDSP_SPIx->SR & SPI_SR_BSY);
set_nss(false);
set_nss(true);
}

Loading…
Cancel
Save