2014-01-17
SPI test - test050.h
// ***********************************************************************
// test050.h 2013dec22hkt2101
// ***********************************************************************
#include "led050.h"
#include "key050.h"
#include "adc050.h"
#include "eeprom050.h"
#include "spi080.h"
#include "mled080.h"
#define DEBUG 1
#define NO_DEBUG 0
void testMax7219DisplayEightDigitV09f()
...
void testMax7219DisplayEightDigitV09d()
{
printf("\n*** testMax7219DisplayEightDigit() ***\n\n");
// *** Set up SPI channels ***
printf("\n*** Set up SPI channels ***\n\n");
setupOneSpiChannel080(SPI_CHANNEL_0);
setupOneSpiChannel080(SPI_CHANNEL_1);
// *** Set up SPI slave select ports ***
printf("\n*** Set up Slave select ports ***\n\n");
setupSpiSlaveSelectPortV0909(WUYINS_01, SPI_CHANNEL_0, SLAVE_SELECT_0);
setupSpiSlaveSelectPortV0909(WUYINS_01, SPI_CHANNEL_0, SLAVE_SELECT_1);
setupSpiSlaveSelectPortV0909(WUYINS_01, SPI_CHANNEL_0, SLAVE_SELECT_2);
setupSpiSlaveSelectPortV0909(WUYINS_01, SPI_CHANNEL_0, SLAVE_SELECT_3);
setupSpiSlaveSelectPortV0909(WUYINS_01, SPI_CHANNEL_1, SLAVE_SELECT_0);
setupSpiSlaveSelectPortV0909(WUYINS_01, SPI_CHANNEL_1, SLAVE_SELECT_4);
setupSpiSlaveSelectPortV0909(WUYINS_01, SPI_CHANNEL_1, SLAVE_SELECT_5);
setupSpiSlaveSelectPortV0909(WUYINS_01, SPI_CHANNEL_1, SLAVE_SELECT_6);
// *** Set up Max7219 display mode ***
printf("\n*** Set up Max7219 display mode ***\n\n");
setupMax7219DigitModeV090c(WUYINS_01, SPI_CHANNEL_0, SLAVE_SELECT_0);
setupMax7219DigitModeV090c(WUYINS_01, SPI_CHANNEL_0, SLAVE_SELECT_1);
setupMax7219DigitModeV090c(WUYINS_01, SPI_CHANNEL_0, SLAVE_SELECT_2);
setupMax7219DigitModeV090c(WUYINS_01, SPI_CHANNEL_0, SLAVE_SELECT_3);
setupMax7219DigitModeV090c(WUYINS_01, SPI_CHANNEL_1, SLAVE_SELECT_0);
setupMax7219DigitModeV090c(WUYINS_01, SPI_CHANNEL_1, SLAVE_SELECT_4);
setupMax7219DigitModeV090c(WUYINS_01, SPI_CHANNEL_1, SLAVE_SELECT_5);
setupMax7219DigitModeV090c(WUYINS_01, SPI_CHANNEL_1, SLAVE_SELECT_6);
// *** Display 8 digits ***
printf("\n*** Display 8 digits ***\n\n");
displayMax7219EightDigitV090d(WUYINS_01, SPI_CHANNEL_0, SLAVE_SELECT_0, TEST_DIGIT_ARRAY_00);
displayMax7219EightDigitV090d(WUYINS_01, SPI_CHANNEL_0, SLAVE_SELECT_1, TEST_DIGIT_ARRAY_01);
displayMax7219EightDigitV090d(WUYINS_01, SPI_CHANNEL_0, SLAVE_SELECT_2, TEST_DIGIT_ARRAY_02);
displayMax7219EightDigitV090d(WUYINS_01, SPI_CHANNEL_0, SLAVE_SELECT_3, TEST_DIGIT_ARRAY_03);
displayMax7219EightDigitV090d(WUYINS_01, SPI_CHANNEL_1, SLAVE_SELECT_0, TEST_DIGIT_ARRAY_10);
displayMax7219EightDigitV090d(WUYINS_01, SPI_CHANNEL_1, SLAVE_SELECT_4, TEST_DIGIT_ARRAY_14);
displayMax7219EightDigitV090d(WUYINS_01, SPI_CHANNEL_1, SLAVE_SELECT_5, TEST_DIGIT_ARRAY_15);
displayMax7219EightDigitV090d(WUYINS_01, SPI_CHANNEL_1, SLAVE_SELECT_6, TEST_DIGIT_ARRAY_16);
}
// ***************************************************************************
// End
// ***************************************************************************
.END
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment