2013-11-27

SPI 0,0 MATRIX0, MATRIX1 displaying "OK" ok


// ***********************************************************************
// Function    - testMax7219V0903()
// Description - Display "O", "K" at MAX7219s at SPI 0,0 and 0,1
// Date        - 2013nov27hkt1300
// Notes       - 1. Set up 2 SPI channels and 6 Slave Select ports
//               2. Set up SPI 0,0 MATRIX0 and MATRIX1 for matrix mode
//               3. Display "O" at MATIX0 and "K" at MATRIX1
// ***********************************************************************
void testMax7219V0903() 
{
// *** Set up all SPI channels and SPI slave select ports ***
setupAllSpiChannelsAndSlaveSelectPorts(Olimex20SlaveSelectPortPinArrayPointerArrayArray);

// *** Set up Max7219 matrix mode for SPI 0,0 Matrix #1 and Matrix #2 ***
setupMax7219MatrixModeV090(Olimex20SlaveSelectPortPinArrayPointerArrayArray, \
                               SPI_CHANNEL_0, SLAVE_SELECT_0, MATRIX_0);
setupMax7219MatrixModeV090(Olimex20SlaveSelectPortPinArrayPointerArrayArray, \
                               SPI_CHANNEL_0, SLAVE_SELECT_1, MATRIX_1);

// *** Display matrix for for SPI 0,1 Matrix #1 and #2 ***
displayMax7219OneMatrix0803(Olimex20SlaveSelectPortPinArrayPointerArrayArray, \
                                SPI_CHANNEL_0, SLAVE_SELECT_0, \
                                MATRIX_0, MatrixChar_O);

displayMax7219OneMatrix0803(Olimex20SlaveSelectPortPinArrayPointerArrayArray, \
                                SPI_CHANNEL_0, SLAVE_SELECT_0, \
                                MATRIX_1, MatrixChar_K);
}

// ***************************************************************************
// End
// ***************************************************************************

No comments:

Post a Comment