Library for the MAX7219 LED display driver

Fork of MAX7219 by Maxim Integrated

Committer:
viewdeep51
Date:
Sat Apr 28 10:15:36 2018 +0000
Revision:
6:7e3d1bcc15df
Parent:
5:0912d18d072f
final_code dated 28/04/18

Who changed what in which revision?

UserRevisionLine numberNew contents of line
j3 0:798fb343e022 1 /******************************************************************//**
j3 0:798fb343e022 2 * @file max7219.h
j3 0:798fb343e022 3 * Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved.
j3 0:798fb343e022 4 *
j3 0:798fb343e022 5 * Permission is hereby granted, free of charge, to any person obtaining a
j3 0:798fb343e022 6 * copy of this software and associated documentation files (the "Software"),
j3 0:798fb343e022 7 * to deal in the Software without restriction, including without limitation
j3 0:798fb343e022 8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
j3 0:798fb343e022 9 * and/or sell copies of the Software, and to permit persons to whom the
j3 0:798fb343e022 10 * Software is furnished to do so, subject to the following conditions:
j3 0:798fb343e022 11 *
j3 0:798fb343e022 12 * The above copyright notice and this permission notice shall be included
j3 0:798fb343e022 13 * in all copies or substantial portions of the Software.
j3 0:798fb343e022 14 *
j3 0:798fb343e022 15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
j3 0:798fb343e022 16 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
j3 0:798fb343e022 17 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
j3 0:798fb343e022 18 * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES
j3 0:798fb343e022 19 * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
j3 0:798fb343e022 20 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
j3 0:798fb343e022 21 * OTHER DEALINGS IN THE SOFTWARE.
j3 0:798fb343e022 22 *
j3 0:798fb343e022 23 * Except as contained in this notice, the name of Maxim Integrated
j3 0:798fb343e022 24 * Products, Inc. shall not be used except as stated in the Maxim Integrated
j3 0:798fb343e022 25 * Products, Inc. Branding Policy.
j3 0:798fb343e022 26 *
j3 0:798fb343e022 27 * The mere transfer of this software does not imply any licenses
j3 0:798fb343e022 28 * of trade secrets, proprietary technology, copyrights, patents,
j3 0:798fb343e022 29 * trademarks, maskwork rights, or any other form of intellectual
j3 0:798fb343e022 30 * property whatsoever. Maxim Integrated Products, Inc. retains all
j3 0:798fb343e022 31 * ownership rights.
j3 0:798fb343e022 32 **********************************************************************/
j3 0:798fb343e022 33
j3 0:798fb343e022 34
j3 0:798fb343e022 35 #ifndef MAX7219_H
j3 0:798fb343e022 36 #define MAX7219_H
j3 0:798fb343e022 37
j3 0:798fb343e022 38 #include "mbed.h"
j3 0:798fb343e022 39
j3 0:798fb343e022 40
j3 2:9150a0dc77a3 41 /**
j3 2:9150a0dc77a3 42 * @brief Structure for device configuration
j3 2:9150a0dc77a3 43 * @code
j3 2:9150a0dc77a3 44 * #include "max7219.h"
j3 2:9150a0dc77a3 45 *
j3 2:9150a0dc77a3 46 * max7219_configuration_t cfg = {
j3 2:9150a0dc77a3 47 * .device_number = 1,
j3 2:9150a0dc77a3 48 * .decode_mode = 0,
j3 2:9150a0dc77a3 49 * .intensity = Max7219::MAX7219_INTENSITY_8,
j3 2:9150a0dc77a3 50 * .scan_limit = Max7219::MAX7219_SCAN_8
j3 2:9150a0dc77a3 51 * };
j3 2:9150a0dc77a3 52 * @endcode
j3 2:9150a0dc77a3 53 */
j3 0:798fb343e022 54 typedef struct
j3 0:798fb343e022 55 {
j3 0:798fb343e022 56 uint8_t device_number;
j3 0:798fb343e022 57 uint8_t decode_mode;
j3 0:798fb343e022 58 uint8_t intensity;
j3 0:798fb343e022 59 uint8_t scan_limit;
j3 0:798fb343e022 60 }max7219_configuration_t;
j3 0:798fb343e022 61
j3 0:798fb343e022 62
j3 2:9150a0dc77a3 63 /**
j3 2:9150a0dc77a3 64 * @brief Serially Interfaced, 8-Digit, LED Display Driver
j3 2:9150a0dc77a3 65 *
j3 2:9150a0dc77a3 66 * @details The MAX7219/MAX7221 are compact, serial input/output common-cathode
j3 2:9150a0dc77a3 67 * display drivers that interface microprocessors (µPs) to 7-segment numeric
j3 2:9150a0dc77a3 68 * LED displays of up to 8 digits, bar-graph displays, or 64 individual LEDs.
j3 2:9150a0dc77a3 69 * Included on-chip are a BCD code-B decoder, multiplex scan circuitry, segment
j3 2:9150a0dc77a3 70 * and digit drivers, and an 8x8 static RAM that stores each digit. Only one
j3 2:9150a0dc77a3 71 * external resistor is required to set the segment current for all LEDs.
j3 2:9150a0dc77a3 72 * The MAX7221 is compatible with SPI™, QSPI™, and MICROWIRE™, and has
j3 2:9150a0dc77a3 73 * slew-rate-limited segment drivers to reduce EMI.
j3 2:9150a0dc77a3 74 *
j3 2:9150a0dc77a3 75 * @code
j3 2:9150a0dc77a3 76 * #include "mbed.h"
j3 2:9150a0dc77a3 77 * #include "max7219.h"
j3 2:9150a0dc77a3 78 *
j3 2:9150a0dc77a3 79 * Max7219 max7219(SPI0_MOSI, SPI0_MISO, SPI0_SCK, SPI0_SS);
j3 2:9150a0dc77a3 80 *
j3 2:9150a0dc77a3 81 * int main()
j3 2:9150a0dc77a3 82 * {
j3 2:9150a0dc77a3 83 * max7219_configuration_t cfg = {
j3 2:9150a0dc77a3 84 * .device_number = 1,
j3 2:9150a0dc77a3 85 * .decode_mode = 0,
j3 2:9150a0dc77a3 86 * .intensity = Max7219::MAX7219_INTENSITY_8,
j3 2:9150a0dc77a3 87 * .scan_limit = Max7219::MAX7219_SCAN_8
j3 2:9150a0dc77a3 88 * };
j3 2:9150a0dc77a3 89 *
j3 2:9150a0dc77a3 90 * max7219.init_device(cfg);
j3 2:9150a0dc77a3 91 * max7219.enable_device(1);
j3 2:9150a0dc77a3 92 * max7219.set_display_test();
j3 2:9150a0dc77a3 93 * wait(1);
j3 2:9150a0dc77a3 94 * max7219.clear_display_test();
j3 2:9150a0dc77a3 95 *
j3 2:9150a0dc77a3 96 * while (1) {
j3 2:9150a0dc77a3 97 * max7219.write_digit(1, Max7219::MAX7219_DIGIT_0, ...
j3 2:9150a0dc77a3 98 * }
j3 2:9150a0dc77a3 99 * }
j3 2:9150a0dc77a3 100 * @endcode
j3 2:9150a0dc77a3 101 */
j3 0:798fb343e022 102 class Max7219
j3 0:798fb343e022 103 {
j3 0:798fb343e022 104 public:
j3 0:798fb343e022 105
j3 2:9150a0dc77a3 106 /**
j3 2:9150a0dc77a3 107 * @brief Digit and Control Registers
j3 2:9150a0dc77a3 108 * @details The 14 addressable digit and control registers.
j3 2:9150a0dc77a3 109 */
j3 0:798fb343e022 110 typedef enum
j3 0:798fb343e022 111 {
j3 0:798fb343e022 112 MAX7219_NO_OP = 0,
j3 0:798fb343e022 113 MAX7219_DIGIT_0,
j3 0:798fb343e022 114 MAX7219_DIGIT_1,
j3 0:798fb343e022 115 MAX7219_DIGIT_2,
j3 0:798fb343e022 116 MAX7219_DIGIT_3,
j3 0:798fb343e022 117 MAX7219_DIGIT_4,
j3 0:798fb343e022 118 MAX7219_DIGIT_5,
j3 0:798fb343e022 119 MAX7219_DIGIT_6,
j3 0:798fb343e022 120 MAX7219_DIGIT_7,
j3 0:798fb343e022 121 MAX7219_DECODE_MODE,
j3 0:798fb343e022 122 MAX7219_INTENSITY,
j3 0:798fb343e022 123 MAX7219_SCAN_LIMIT,
j3 0:798fb343e022 124 MAX7219_SHUTDOWN,
j3 0:798fb343e022 125 MAX7219_DISPLAY_TEST = 15
j3 0:798fb343e022 126 }max7219_register_e;
j3 0:798fb343e022 127
j3 0:798fb343e022 128
j3 2:9150a0dc77a3 129 /**
j3 2:9150a0dc77a3 130 * @brief Intensity values
j3 2:9150a0dc77a3 131 * @details Digital control of display brightness is provided by an
j3 2:9150a0dc77a3 132 * internal pulse-width modulator, which is controlled by
j3 2:9150a0dc77a3 133 * the lower nibble of the intensity register.
j3 2:9150a0dc77a3 134 */
j3 0:798fb343e022 135 typedef enum
j3 0:798fb343e022 136 {
j3 0:798fb343e022 137 MAX7219_INTENSITY_0 = 0,
j3 0:798fb343e022 138 MAX7219_INTENSITY_1,
j3 0:798fb343e022 139 MAX7219_INTENSITY_2,
j3 0:798fb343e022 140 MAX7219_INTENSITY_3,
j3 0:798fb343e022 141 MAX7219_INTENSITY_4,
j3 0:798fb343e022 142 MAX7219_INTENSITY_5,
j3 0:798fb343e022 143 MAX7219_INTENSITY_6,
j3 0:798fb343e022 144 MAX7219_INTENSITY_7,
j3 0:798fb343e022 145 MAX7219_INTENSITY_8,
j3 0:798fb343e022 146 MAX7219_INTENSITY_9,
j3 0:798fb343e022 147 MAX7219_INTENSITY_A,
j3 0:798fb343e022 148 MAX7219_INTENSITY_B,
j3 0:798fb343e022 149 MAX7219_INTENSITY_C,
j3 0:798fb343e022 150 MAX7219_INTENSITY_D,
j3 0:798fb343e022 151 MAX7219_INTENSITY_E,
j3 0:798fb343e022 152 MAX7219_INTENSITY_F
j3 0:798fb343e022 153 }max7219_intensity_e;
j3 0:798fb343e022 154
j3 0:798fb343e022 155
j3 2:9150a0dc77a3 156 /**
j3 2:9150a0dc77a3 157 * @brief Scan limit for mutiplexing digits
j3 2:9150a0dc77a3 158 * @details The scan-limit register sets how many digits are
j3 2:9150a0dc77a3 159 * displayed, from 1 to 8. They are displayed in a multiplexed
j3 2:9150a0dc77a3 160 * manner with a typical display scan rate of 800Hz with 8
j3 2:9150a0dc77a3 161 * digits displayed.
j3 2:9150a0dc77a3 162 */
j3 0:798fb343e022 163 typedef enum
j3 0:798fb343e022 164 {
j3 0:798fb343e022 165 MAX7219_SCAN_1 = 0,
j3 0:798fb343e022 166 MAX7219_SCAN_2,
j3 0:798fb343e022 167 MAX7219_SCAN_3,
j3 0:798fb343e022 168 MAX7219_SCAN_4,
j3 0:798fb343e022 169 MAX7219_SCAN_5,
j3 0:798fb343e022 170 MAX7219_SCAN_6,
j3 0:798fb343e022 171 MAX7219_SCAN_7,
j3 0:798fb343e022 172 MAX7219_SCAN_8
j3 0:798fb343e022 173 }max7219_scan_limit_e;
j3 0:798fb343e022 174
j3 0:798fb343e022 175
j3 0:798fb343e022 176 /**********************************************************//**
j3 0:798fb343e022 177 * @brief Constructor for Max7219 Class.
j3 0:798fb343e022 178 *
j3 0:798fb343e022 179 * @details Allows user to pass pointer to existing SPI bus
j3 0:798fb343e022 180 *
j3 0:798fb343e022 181 * On Entry:
j3 0:798fb343e022 182 * @param[in] spi_bus - pointer to existing SPI object
j3 0:798fb343e022 183 * @param[in] cs - pin to use for cs
j3 0:798fb343e022 184 *
j3 0:798fb343e022 185 * On Exit:
j3 4:b5e4379a3d90 186 *
j3 4:b5e4379a3d90 187 * @return None
j3 0:798fb343e022 188 **************************************************************/
j3 0:798fb343e022 189 Max7219(SPI *spi_bus, PinName cs);
j3 0:798fb343e022 190
j3 0:798fb343e022 191
j3 0:798fb343e022 192 /**********************************************************//**
j3 0:798fb343e022 193 * @brief Constructor for Max7219 Class.
j3 0:798fb343e022 194 *
j3 0:798fb343e022 195 * @details Allows user to specify SPI peripheral to use
j3 0:798fb343e022 196 *
j3 0:798fb343e022 197 * On Entry:
j3 0:798fb343e022 198 * @param[in] mosi - pin to use for mosi
j3 0:798fb343e022 199 * @param[in] miso - pin to use for miso
j3 0:798fb343e022 200 * @param[in] sclk - pin to use for sclk
j3 0:798fb343e022 201 * @param[in] cs - pin to use for cs
j3 0:798fb343e022 202 *
j3 0:798fb343e022 203 * On Exit:
j3 4:b5e4379a3d90 204 *
j3 4:b5e4379a3d90 205 * @return None
j3 0:798fb343e022 206 **************************************************************/
j3 0:798fb343e022 207 Max7219(PinName mosi, PinName miso, PinName sclk, PinName cs);
j3 0:798fb343e022 208
j3 0:798fb343e022 209
j3 0:798fb343e022 210 /**********************************************************//**
j3 0:798fb343e022 211 * @brief Default destructor for Max7219 Class.
j3 0:798fb343e022 212 *
j3 0:798fb343e022 213 * @details Destroys SPI object if owner
j3 0:798fb343e022 214 *
j3 0:798fb343e022 215 * On Entry:
j3 0:798fb343e022 216 *
j3 0:798fb343e022 217 * On Exit:
j3 4:b5e4379a3d90 218 *
j3 4:b5e4379a3d90 219 * @return None
j3 0:798fb343e022 220 **************************************************************/
j3 0:798fb343e022 221 ~Max7219();
j3 0:798fb343e022 222
j3 0:798fb343e022 223
j3 0:798fb343e022 224 /**********************************************************//**
j3 0:798fb343e022 225 * @brief Sets the number of MAX7219 devices being used.
j3 0:798fb343e022 226 * Defaults to one
j3 0:798fb343e022 227 *
j3 0:798fb343e022 228 * @details
j3 0:798fb343e022 229 *
j3 0:798fb343e022 230 * On Entry:
j3 0:798fb343e022 231 * @param[in] num_devices - number of MAX7219 devices being
j3 0:798fb343e022 232 * used, max of 255
j3 0:798fb343e022 233 *
j3 0:798fb343e022 234 * On Exit:
j3 4:b5e4379a3d90 235 *
j3 4:b5e4379a3d90 236 * @return Returns number of devices
j3 0:798fb343e022 237 **************************************************************/
j3 0:798fb343e022 238 int32_t set_num_devices(uint8_t num_devices);
j3 0:798fb343e022 239
j3 0:798fb343e022 240
j3 0:798fb343e022 241 /**********************************************************//**
j3 0:798fb343e022 242 * @brief Tests all devices being used
j3 0:798fb343e022 243 *
j3 0:798fb343e022 244 * @details Sets bit0 of DISPLAY_TEST regiser in all devices
j3 0:798fb343e022 245 *
j3 0:798fb343e022 246 * On Entry:
j3 0:798fb343e022 247 *
j3 0:798fb343e022 248 * On Exit:
j3 4:b5e4379a3d90 249 *
j3 4:b5e4379a3d90 250 * @return None
j3 0:798fb343e022 251 **************************************************************/
j3 0:798fb343e022 252 void set_display_test(void);
j3 0:798fb343e022 253
j3 0:798fb343e022 254
j3 0:798fb343e022 255 /**********************************************************//**
j3 0:798fb343e022 256 * @brief Stops test
j3 0:798fb343e022 257 *
j3 0:798fb343e022 258 * @details Clear bit0 of DISPLAY_TEST regiser in all devices
j3 0:798fb343e022 259 *
j3 0:798fb343e022 260 * On Entry:
j3 0:798fb343e022 261 *
j3 0:798fb343e022 262 * On Exit:
j3 4:b5e4379a3d90 263 *
j3 4:b5e4379a3d90 264 * @return None
j3 0:798fb343e022 265 **************************************************************/
j3 0:798fb343e022 266 void clear_display_test(void);
j3 0:798fb343e022 267
j3 0:798fb343e022 268
j3 0:798fb343e022 269 /**********************************************************//**
j3 3:c245060379b9 270 * @brief Initializes specific device in display with given
j3 0:798fb343e022 271 * config data
j3 0:798fb343e022 272 *
j3 0:798fb343e022 273 * @details
j3 0:798fb343e022 274 *
j3 0:798fb343e022 275 * On Entry:
j3 1:90a7cf4e7d26 276 * @param[in] config - Structure containing configuration
j3 1:90a7cf4e7d26 277 * data of device
j3 0:798fb343e022 278 *
j3 0:798fb343e022 279 * On Exit:
j3 4:b5e4379a3d90 280 *
j3 4:b5e4379a3d90 281 * @return Returns 0 on success\n
j3 4:b5e4379a3d90 282 * Returns -1 if device number is > _num_devices\n
j3 4:b5e4379a3d90 283 * Returns -2 if device number is 0\n
j3 0:798fb343e022 284 **************************************************************/
j3 1:90a7cf4e7d26 285 int32_t init_device(max7219_configuration_t config);
j3 0:798fb343e022 286
j3 0:798fb343e022 287
j3 0:798fb343e022 288 /**********************************************************//**
j3 3:c245060379b9 289 * @brief Initializes all devices with given config data
j3 0:798fb343e022 290 *
j3 3:c245060379b9 291 * @details All devices are configured with given data
j3 0:798fb343e022 292 *
j3 0:798fb343e022 293 * On Entry:
j3 1:90a7cf4e7d26 294 * @param[in] config - Structure containing configuration
j3 1:90a7cf4e7d26 295 * data
j3 0:798fb343e022 296 * On Exit:
j3 4:b5e4379a3d90 297 *
j3 4:b5e4379a3d90 298 * @return None
j3 0:798fb343e022 299 **************************************************************/
j3 0:798fb343e022 300 void init_display(max7219_configuration_t config);
j3 0:798fb343e022 301
j3 0:798fb343e022 302 /**********************************************************//**
j3 3:c245060379b9 303 * @brief Enables specific device in display
j3 0:798fb343e022 304 *
j3 0:798fb343e022 305 * @details
j3 0:798fb343e022 306 *
j3 0:798fb343e022 307 * On Entry:
j3 1:90a7cf4e7d26 308 * @param[in] device_number - device to enable
j3 0:798fb343e022 309 *
j3 0:798fb343e022 310 * On Exit:
j3 4:b5e4379a3d90 311 *
j3 4:b5e4379a3d90 312 * @return Returns 0 on success\n
j3 4:b5e4379a3d90 313 * Returns -1 if device number is > _num_devices\n
j3 4:b5e4379a3d90 314 * Returns -2 if device number is 0\n
j3 0:798fb343e022 315 **************************************************************/
j3 0:798fb343e022 316 int32_t enable_device(uint8_t device_number);
j3 0:798fb343e022 317
j3 0:798fb343e022 318
j3 0:798fb343e022 319 /**********************************************************//**
j3 3:c245060379b9 320 * @brief Disables specific device in display
j3 0:798fb343e022 321 *
j3 0:798fb343e022 322 * @details
j3 0:798fb343e022 323 *
j3 0:798fb343e022 324 * On Entry:
j3 1:90a7cf4e7d26 325 * @param[in] device_number - device to disable
j3 0:798fb343e022 326 *
j3 0:798fb343e022 327 * On Exit:
j3 4:b5e4379a3d90 328 * @return Returns 0 on success\n
j3 4:b5e4379a3d90 329 * Returns -1 if device number is > _num_devices\n
j3 4:b5e4379a3d90 330 * Returns -2 if device number is 0\n
j3 0:798fb343e022 331 **************************************************************/
j3 0:798fb343e022 332 int32_t disable_device(uint8_t device_number);
j3 0:798fb343e022 333
j3 0:798fb343e022 334
viewdeep51 5:0912d18d072f 335 /***********************************************************//**
viewdeep51 5:0912d18d072f 336 * @brief set brightness of all devices in display
viewdeep51 5:0912d18d072f 337 *
viewdeep51 5:0912d18d072f 338 * @details
viewdeep51 5:0912d18d072f 339 *
viewdeep51 5:0912d18d072f 340 * On Entry : max7219_configuration_t
viewdeep51 5:0912d18d072f 341 *
viewdeep51 5:0912d18d072f 342 * On Exit :
viewdeep51 5:0912d18d072f 343 *
viewdeep51 5:0912d18d072f 344 * return NONE
viewdeep51 5:0912d18d072f 345 ***************************************************************/
viewdeep51 5:0912d18d072f 346 void set_intensity(max7219_configuration_t config);
j3 0:798fb343e022 347
j3 0:798fb343e022 348 /**********************************************************//**
j3 3:c245060379b9 349 * @brief Writes digit of given device with given data, user
j3 0:798fb343e022 350 * must enter correct data for decode_mode chosen
j3 0:798fb343e022 351 *
j3 0:798fb343e022 352 * @details
j3 0:798fb343e022 353 *
j3 0:798fb343e022 354 * On Entry:
j3 1:90a7cf4e7d26 355 * @param[in] device_number - device to write too
j3 1:90a7cf4e7d26 356 * @param[in] digit - digit to write
j3 1:90a7cf4e7d26 357 * @param[in] data - data to write
j3 0:798fb343e022 358 *
j3 0:798fb343e022 359 * On Exit:
j3 4:b5e4379a3d90 360 *
j3 4:b5e4379a3d90 361 * @return Returns 0 on success\n
j3 4:b5e4379a3d90 362 * Returns -1 if device number is > _num_devices\n
j3 4:b5e4379a3d90 363 * Returns -2 if device number is 0\n
j3 4:b5e4379a3d90 364 * Returns -3 if digit > 8\n
j3 4:b5e4379a3d90 365 * Returns -4 if digit < 1\n
j3 0:798fb343e022 366 **************************************************************/
j3 0:798fb343e022 367 int32_t write_digit(uint8_t device_number, uint8_t digit, uint8_t data);
j3 0:798fb343e022 368
j3 0:798fb343e022 369
j3 0:798fb343e022 370 /**********************************************************//**
j3 3:c245060379b9 371 * @brief Clears digit of given device
j3 0:798fb343e022 372 *
j3 0:798fb343e022 373 * @details
j3 0:798fb343e022 374 *
j3 0:798fb343e022 375 * On Entry:
j3 1:90a7cf4e7d26 376 * @param[in] device_number - device to write too
j3 1:90a7cf4e7d26 377 * @param[in] digit - digit to clear
j3 0:798fb343e022 378 *
j3 0:798fb343e022 379 * On Exit:
j3 4:b5e4379a3d90 380 *
j3 4:b5e4379a3d90 381 * @return Returns 0 on success\n
j3 4:b5e4379a3d90 382 * Returns -1 if device number is > _num_devices\n
j3 4:b5e4379a3d90 383 * Returns -2 if device number is 0\n
j3 4:b5e4379a3d90 384 * Returns -3 if digit > 8\n
j3 4:b5e4379a3d90 385 * Returns -4 if digit < 1\n
j3 0:798fb343e022 386 **************************************************************/
j3 0:798fb343e022 387 int32_t clear_digit(uint8_t device_number, uint8_t digit);
j3 0:798fb343e022 388
j3 0:798fb343e022 389
j3 0:798fb343e022 390 private:
j3 0:798fb343e022 391
j3 0:798fb343e022 392 SPI *_p_spi;
j3 0:798fb343e022 393 DigitalOut *_p_cs;
j3 0:798fb343e022 394 bool _spi_owner;
j3 0:798fb343e022 395
j3 0:798fb343e022 396 uint8_t _num_devices;
j3 0:798fb343e022 397
j3 0:798fb343e022 398 };
j3 0:798fb343e022 399 #endif /* MAX7219_H*/