Author | Rob Hamerling, Copyright © 2014..2014, all rights reserved. |
Adapted-by | |
Compiler | 2.4q2 |
Library for a module with MAX7219 - serial interface - 8 x 8 LEDs . The max7219 module uses 3 data wires, which have to be specified by the user. Before including this library declare the following aliases (mandatory): . alias max7219_din is pin_?? -- pin for data signal alias max7219_clk is pin_?? -- pin for clock signal alias max7219_cs is pin_?? -- pin for chip select signal . These pins must be configured for digital output by the user program. . When you want to control LEDs individually while retaining the state of the other LEDs a cache must be used. This is a builtin feature of this library, but you have to indicate if you want it. By default the cache is not active, to activate it declare: . const bit MAX7219_DISPLAY_CACHE = TRUE . Initialize the max7219 with max7219_init()
This library is exclusively designed to control a single 8x8 led matrix, the features of the MAX7219 chip to display data on 7-segment displays are disabled.
const byte MAX7219_DISPLAY_PWM17 = 0b_0000_1000
const byte MAX7219_COL_3 = 0b_0000_0100
const byte MAX7219_DISPLAY_PWM5 = 0b_0000_0010
const byte MAX7219_COL_4 = 0b_0000_0101
const byte MAX7219_DISPLAY_PWM3 = 0b_0000_0001
const byte MAX7219_SHUTDOWN = 0b_0000_1100
const byte MAX7219_DISPLAY_PWM25 = 0b_0000_1100
const byte MAX7219_COL_5 = 0b_0000_0110
const byte MAX7219_COL_1 = 0b_0000_0010
const byte MAX7219_DISPLAY_PWM7 = 0b_0000_0011
const byte MAX7219_NO_OP = 0b_0000_0000
const byte MAX7219_DISPLAY_OFF = 0b_0000_0000
const byte MAX7219_DECODE = 0b_0000_1001
const byte MAX7219_DISPLAY_PWM31 = 0b_0000_1111
const byte MAX7219_DISPLAY_PWM27 = 0b_0000_1101
const byte MAX7219_DISPLAY_PWM15 = 0b_0000_0111
const byte MAX7219_COL_7 = 0b_0000_1000
const byte MAX7219_DISPLAY_PWM23 = 0b_0000_1011
const byte MAX7219_DISPLAY_PWM21 = 0b_0000_1010
const byte MAX7219_COL_6 = 0b_0000_0111
const byte MAX7219_DISPLAY_PWM9 = 0b_0000_0100
const byte MAX7219_DISPLAY_PWM29 = 0b_0000_1110
const byte MAX7219_COL_0 = 0b_0000_0001
const byte MAX7219_INTENSITY = 0b_0000_1010
const byte MAX7219_SCANLIMIT = 0b_0000_1011
const byte MAX7219_DISPLAY_ON = 0b_0000_0000
const byte MAX7219_DISPLAY_PWM11 = 0b_0000_0101
const byte MAX7219_DISPLAY_PWM1 = 0b_0000_0000
const byte MAX7219_COL_2 = 0b_0000_0011
const byte MAX7219_DISPLAY_PWM13 = 0b_0000_0110
const byte MAX7219_TEST = 0b_0000_1111
const byte MAX7219_DISPLAY_PWM19 = 0b_0000_1001
max7219_display_blink(byte in times, byte in halfperiod)
max7219_init()
max7219_display_row(byte in row, bit in state)
max7219_display_bit(byte in col, byte in row, bit in state)
max7219_display_test(byte in period)
max7219_display_col(byte in col, bit in state)
max7219_display_byte_bin(byte in col, byte in data)
max7219_display_clear()
max7219_display_intensity(byte in intensity)
const byte MAX7219_DISPLAY_PWM17 = 0b_0000_1000
No documentation found
const byte MAX7219_COL_3 = 0b_0000_0100
No documentation found
const byte MAX7219_DISPLAY_PWM5 = 0b_0000_0010
No documentation found
const byte MAX7219_COL_4 = 0b_0000_0101
No documentation found
const byte MAX7219_DISPLAY_PWM3 = 0b_0000_0001
No documentation found
const byte MAX7219_SHUTDOWN = 0b_0000_1100
No documentation found
const byte MAX7219_DISPLAY_PWM25 = 0b_0000_1100
No documentation found
const byte MAX7219_COL_5 = 0b_0000_0110
No documentation found
const byte MAX7219_COL_1 = 0b_0000_0010
No documentation found
const byte MAX7219_DISPLAY_PWM7 = 0b_0000_0011
No documentation found
const byte MAX7219_NO_OP = 0b_0000_0000
No documentation found
const byte MAX7219_DISPLAY_OFF = 0b_0000_0000
No documentation found
const byte MAX7219_DECODE = 0b_0000_1001
No documentation found
const byte MAX7219_DISPLAY_PWM31 = 0b_0000_1111
No documentation found
const byte MAX7219_DISPLAY_PWM27 = 0b_0000_1101
No documentation found
const byte MAX7219_DISPLAY_PWM15 = 0b_0000_0111
No documentation found
const byte MAX7219_COL_7 = 0b_0000_1000
No documentation found
const byte MAX7219_DISPLAY_PWM23 = 0b_0000_1011
No documentation found
const byte MAX7219_DISPLAY_PWM21 = 0b_0000_1010
No documentation found
const byte MAX7219_COL_6 = 0b_0000_0111
No documentation found
const byte MAX7219_DISPLAY_PWM9 = 0b_0000_0100
No documentation found
const byte MAX7219_DISPLAY_PWM29 = 0b_0000_1110
No documentation found
const byte MAX7219_COL_0 = 0b_0000_0001
No documentation found
const byte MAX7219_INTENSITY = 0b_0000_1010
No documentation found
const byte MAX7219_SCANLIMIT = 0b_0000_1011
No documentation found
const byte MAX7219_DISPLAY_ON = 0b_0000_0000
No documentation found
const byte MAX7219_DISPLAY_PWM11 = 0b_0000_0101
PWM dutycycle for LEDs
const byte MAX7219_DISPLAY_PWM1 = 0b_0000_0000
No documentation found
const byte MAX7219_COL_2 = 0b_0000_0011
No documentation found
const byte MAX7219_DISPLAY_PWM13 = 0b_0000_0110
No documentation found
const byte MAX7219_TEST = 0b_0000_1111
No documentation found
const byte MAX7219_DISPLAY_PWM19 = 0b_0000_1001
No documentation found
max7219_display_blink(byte in times, byte in halfperiod)
Title: Blink whole module a number of times at a given speed Input: - number of times the display should blink time in 0.1 seconds that the display should be on and off Notes: The current display pattern is retained.
max7219_init()
Title: Initialize LED module with max7219 Input: (none) Notes: Must be called before any other operation involving the display
max7219_display_row(byte in row, bit in state)
Title: Display a row of leds (all leds in a row on or off) Input: - row number (byte, 0..7) led state (true or false, resp. on or off)
max7219_display_bit(byte in col, byte in row, bit in state)
Title: Set or reset a single LED Input: - column number (byte, 0..7) row number (byte, 0..7) led state (true or false, on or off)
max7219_display_test(byte in period)
Title: Put MAX7219 in test mode for some time. Input: period in number of 0.1 seconds Notes: All leds will be in maximum intensity
max7219_display_col(byte in col, bit in state)
Title: Display a column of leds (all leds on a column on or off) Input: - column number (byte, 0..7) led state (true or false, resp. on or off)
max7219_display_byte_bin(byte in col, byte in data)
Title: Display whole column (byte, 8 bits) Input: - column number (byte, 0..7) byte with value to be displayed
max7219_display_clear()
Title: Clear display (all LEDs off) Input: (none)
max7219_display_intensity(byte in intensity)
Title: Set LED intensity Input: LED intensity (range 0..15) Notes:
_max7219_write(byte in addr, byte in data)
Title: transfer addr + data to the max7219 Input: - address (command) byte data byte
12f1501 | 12f1501_max7219.jal |
12f1572 | 12f1572_max7219.jal |
12f683 | 12f683_max7219.jal |
16f648a | 16f648a_max7219.jal |
16f723 | 16f723_max7219.jal |
16f73 | 16f73_max7219.jal |
16f877 | 16f877_max7219.jal |
16f877a | 16f877a_max7219.jal |
16f88 | 16f88_max7219.jal |
18f2450 | 18f2450_max7219.jal |
18f2520 | 18f2520_max7219.jal |
18f2550 | 18f2550_max7219.jal |
18f2620 | 18f2620_max7219.jal |
18f452 | 18f452_max7219.jal |
18f4550 | 18f4550_max7219.jal |
18f4620 | 18f4620_max7219.jal |
18f67j50 | 18f67j50_max7219.jal |