Library for the MAX7219 LED display driver
Fork of MAX7219 by
Revision 6:7e3d1bcc15df, committed 2018-04-28
- Comitter:
- viewdeep51
- Date:
- Sat Apr 28 10:15:36 2018 +0000
- Parent:
- 5:0912d18d072f
- Commit message:
- final_code dated 28/04/18
Changed in this revision
max7219.cpp | Show annotated file Show diff for this revision Revisions of this file |
max7219.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r 0912d18d072f -r 7e3d1bcc15df max7219.cpp --- a/max7219.cpp Thu Sep 28 05:06:39 2017 +0000 +++ b/max7219.cpp Sat Apr 28 10:15:36 2018 +0000 @@ -301,18 +301,7 @@ //********************************************************************* -void Max7219::enable_display(void) -{ - uint8_t idx = 0; - - _p_cs->write(0); - for(idx = 0; idx < _num_devices; idx++) - { - _p_spi->write(MAX7219_SHUTDOWN); - _p_spi->write(1); - } - _p_cs->write(1); -} + //********************************************************************* @@ -355,22 +344,6 @@ } -//********************************************************************* -void Max7219::disable_display(void) -{ - uint8_t idx = 0; - - _p_cs->write(0); - for(idx = 0; idx < _num_devices; idx++) - { - _p_spi->write(MAX7219_SHUTDOWN); - _p_spi->write(0); - } - _p_cs->write(1); -} - - - //********************************************************************* int32_t Max7219::write_digit(uint8_t device_number, uint8_t digit, uint8_t data) { @@ -470,97 +443,3 @@ return(rtn_val); } - -//********************************************************************* -int32_t Max7219::device_all_on(uint8_t device_number) -{ - int32_t rtn_val = -1; - uint8_t idx = 0; - - if(device_number > _num_devices) - { - rtn_val = -1; - } - else if(device_number == 0) - { - rtn_val = -2; - } - else - { - rtn_val = 0; - - //writes every digit of given device to 0xFF - for(idx = 0; idx < 8; idx++) - { - if(rtn_val == 0) - { - rtn_val = write_digit(device_number, (idx + 1), 0xFF); - } - } - } - - return(rtn_val); -} - - -//********************************************************************* -int32_t Max7219::device_all_off(uint8_t device_number) -{ - int32_t rtn_val = -1; - uint8_t idx = 0; - - if(device_number > _num_devices) - { - rtn_val = -1; - } - else if(device_number == 0) - { - rtn_val = -2; - } - else - { - rtn_val = 0; - - //writes every digit of given device to 0 - for(idx = 0; idx < 8; idx++) - { - if(rtn_val == 0) - { - rtn_val = write_digit(device_number, (idx + 1), 0); - } - } - } - - return(rtn_val); -} - - -void Max7219::display_all_on(void) -{ - uint8_t idx, idy; - - //writes every digit of every device to 0xFF - for(idx = 0; idx < _num_devices; idx++) - { - for(idy = 0; idy < MAX7219_DIGIT_7; idy++) - { - write_digit((idx + 1), (idy + 1), 0xFF); - } - } -} - - -void Max7219::display_all_off(void) -{ - uint8_t idx, idy; - - //writes every digit of every device to 0 - for(idx = 0; idx < _num_devices; idx++) - { - for(idy = 0; idy < MAX7219_DIGIT_7; idy++) - { - write_digit((idx + 1), (idy + 1), 0); - } - } -} -
diff -r 0912d18d072f -r 7e3d1bcc15df max7219.h --- a/max7219.h Thu Sep 28 05:06:39 2017 +0000 +++ b/max7219.h Sat Apr 28 10:15:36 2018 +0000 @@ -317,20 +317,6 @@ /**********************************************************//** - * @brief Enables all device in display - * - * @details - * - * On Entry: - * - * On Exit: - * - * @return None - **************************************************************/ - void enable_display(void); - - - /**********************************************************//** * @brief Disables specific device in display * * @details @@ -346,19 +332,6 @@ int32_t disable_device(uint8_t device_number); - /**********************************************************//** - * @brief Disables all devices in display - * - * @details - * - * On Entry: - * - * On Exit: - * - * @return None - **************************************************************/ - void disable_display(void); - /***********************************************************//** * @brief set brightness of all devices in display * @@ -413,68 +386,6 @@ **************************************************************/ int32_t clear_digit(uint8_t device_number, uint8_t digit); - - /**********************************************************//** - * @brief Turns on all segments/digits of given device - * - * @details - * - * On Entry: - * @param[in] device_number - device to write too - * - * On Exit: - * - * @return Returns 0 on success\n - * Returns -1 if device number is > _num_devices\n - * Returns -2 if device number is 0\n - **************************************************************/ - int32_t device_all_on(uint8_t device_number); - - - /**********************************************************//** - * @brief Turns off all segments/digits of given device - * - * @details - * - * On Entry: - * @param[in] device_number - device to write too - * - * On Exit: - * - * @return Returns 0 on success\n - * Returns -1 if device number is > _num_devices\n - * Returns -2 if device number is 0\n - **************************************************************/ - int32_t device_all_off(uint8_t device_number); - - - /**********************************************************//** - * @brief Turns on all segments/digits of display - * - * @details - * - * On Entry: - * - * On Exit: - * - * @return None - **************************************************************/ - void display_all_on(void); - - - /**********************************************************//** - * @brief Turns off all segments/digits of display - * - * @details - * - * On Entry: - * - * On Exit: - * - * @return None - **************************************************************/ - void display_all_off(void); - private: