|
|
|
@ -95,6 +95,25 @@ void max7219_ledMatrixSetLED(
|
|
|
|
|
spiWriteReg(display->spiCH, row,col);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void max7219_rawWrite(
|
|
|
|
|
max7219_t *display,
|
|
|
|
|
uint8_t reg,
|
|
|
|
|
uint8_t data)
|
|
|
|
|
{
|
|
|
|
|
spiWriteReg(display->spiCH, reg, data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void max7219_printLedMatrix(
|
|
|
|
|
max7219_t *display,
|
|
|
|
|
uint8_t matrix[])
|
|
|
|
|
{
|
|
|
|
|
uint8_t i = 0;
|
|
|
|
|
|
|
|
|
|
for(i = 0; i < 8; i ++) {
|
|
|
|
|
spiWriteReg(display->spiCH, i+1, matrix[i]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void max7219_ledMatrixUnsetLED(
|
|
|
|
|
max7219_t *display,
|
|
|
|
|
uint8_t row,
|
|
|
|
@ -168,6 +187,26 @@ int main(int argc, char *argv[])
|
|
|
|
|
{
|
|
|
|
|
uint8_t i = 0;
|
|
|
|
|
uint8_t j = 0;
|
|
|
|
|
|
|
|
|
|
uint8_t matrix[] = {
|
|
|
|
|
0xAA,
|
|
|
|
|
0xFF,
|
|
|
|
|
0xAA,
|
|
|
|
|
0xFF,
|
|
|
|
|
0xAA,
|
|
|
|
|
0xFF,
|
|
|
|
|
0xAA,
|
|
|
|
|
0xFF};
|
|
|
|
|
|
|
|
|
|
uint8_t matrix_1[] = {
|
|
|
|
|
0xFF,
|
|
|
|
|
0xAA,
|
|
|
|
|
0xFF,
|
|
|
|
|
0xAA,
|
|
|
|
|
0xFF,
|
|
|
|
|
0xAA
|
|
|
|
|
0xFF,
|
|
|
|
|
0xAA};
|
|
|
|
|
spi_ch_t spi_test_channel;
|
|
|
|
|
max7219_t ledMatrix;
|
|
|
|
|
|
|
|
|
@ -256,7 +295,7 @@ int main(int argc, char *argv[])
|
|
|
|
|
max7219_shutdownDiaply(&ledMatrix,0);
|
|
|
|
|
max7219_setDecodeMode(&ledMatrix, NO_DECODE_DIGIT_7_TO_0);
|
|
|
|
|
max7219_setScanLimit(&ledMatrix, DSIPLAX_DIGIT_7_TO_0);
|
|
|
|
|
max7219_setIntensity(&ledMatrix,0x0F);
|
|
|
|
|
max7219_setIntensity(&ledMatrix,0x01);
|
|
|
|
|
|
|
|
|
|
max7219_ledMatrixSetLED(&ledMatrix,0,0);
|
|
|
|
|
delayMs(1000);
|
|
|
|
@ -269,9 +308,10 @@ int main(int argc, char *argv[])
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
while(1) {
|
|
|
|
|
max7219_ledMatrixSetLED(&ledMatrix,1,1);
|
|
|
|
|
max7219_printLedMatrix(&ledMatrix, matrix);
|
|
|
|
|
//max7219_ledMatrixSetLED(&ledMatrix, 0, 0);
|
|
|
|
|
delayMs(100);
|
|
|
|
|
max7219_ledMatrixUnsetLED(&ledMatrix,1,1);
|
|
|
|
|
max7219_printLedMatrix(&ledMatrix, matrix_1);
|
|
|
|
|
delayMs(100);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|