Fix to have load pin working with SPI1.

Dependencies:   mbed

Fork of Max7221 by Dwayne Dilbeck

Files at this revision

API Documentation at this revision

Comitter:
ky3orr
Date:
Mon Nov 23 11:38:17 2015 +0000
Parent:
7:a160cb7cdd86
Child:
9:75bddbfbb692
Commit message:
Small updates to the documentation.

Changed in this revision

Max7221.cpp Show annotated file Show diff for this revision Revisions of this file
Max7221.h Show annotated file Show diff for this revision Revisions of this file
--- a/Max7221.cpp	Mon Nov 23 11:28:44 2015 +0000
+++ b/Max7221.cpp	Mon Nov 23 11:38:17 2015 +0000
@@ -3,7 +3,7 @@
 * @brief MAX7219/7221 driver class.
 * 
 * @author Grzegorz Kaczmarek
-* @comment Code inspired on erlier Dwayne S. Dilbeck's work
+* @comment Code inspired on earlier Dwayne S. Dilbeck's work
 * @date 20/11/2015
 */
 
@@ -46,7 +46,7 @@
     if(m_position > 0) {
         i = m_position;
         while(i--) {
-            WriteRaw(max7219_reg_noop, 0x0);
+            WriteRaw(max7219_reg_noop, 0x00);
         }
     }
     CsHigh();
--- a/Max7221.h	Mon Nov 23 11:28:44 2015 +0000
+++ b/Max7221.h	Mon Nov 23 11:38:17 2015 +0000
@@ -3,7 +3,7 @@
 * @brief Header file for the MAX7219/7221 driver class.
 * 
 * @author Grzegorz Kaczmarek
-* @comment Code inspired on erlier Dwayne S. Dilbeck's work
+* @comment Code inspired on earlier Dwayne S. Dilbeck's work
 * @date 20/11/2015
 */
 
@@ -13,10 +13,10 @@
 // MAX7219/7221 register map
 #define max7219_reg_noop         0x00
 #define max7219_reg_decodeMode   0x09
-#define max7219_reg_intensity    0x0a
-#define max7219_reg_scanLimit    0x0b
-#define max7219_reg_shutdown     0x0c
-#define max7219_reg_displayTest  0x0f
+#define max7219_reg_intensity    0x0A
+#define max7219_reg_scanLimit    0x0B
+#define max7219_reg_shutdown     0x0C
+#define max7219_reg_displayTest  0x0F
 
 // Logical values
 #define LOG_0 0
@@ -25,14 +25,14 @@
 class Max7221 {
 private:
    SPI *mp_spi;             // SPI used for this display (no data transmission when NULL)
-   DigitalOut *mp_cs;       // CS signal (it should be handled manually when NULL)
+   DigitalOut *mp_cs;       // /CS signal (it should be handled manually when NULL)
    unsigned int m_position; // Display position on SPI chain (0 = 1'st)
 
 public:
     /**
     *  Default constructor.
     *  @param spi       Initialized SPI port used for communication with MAX7219/7221.
-    *  @param cs        Initialized output pin used as SW CS signal or NULL when HW one is used.
+    *  @param cs        Initialized output pin used as SW CS signal or NULL when this signal is handled manually.
     *  @param position  Position on SPI port (for displays connected in daisy-chain: DOUT-DIN). 0=1st.
     */
     Max7221(SPI *spi, DigitalOut *cs, unsigned int position=0);