2016-05-06 23:03:39 +00:00
|
|
|
/*
|
2020-05-02 19:42:54 +00:00
|
|
|
* Copyright (C) 2016,2017,2018,2020 by Jonathan Naylor G4KLX
|
2016-05-06 23:03:39 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "OLED.h"
|
2018-04-07 15:49:12 +00:00
|
|
|
#include "Log.h"
|
2020-11-17 11:50:00 +00:00
|
|
|
#include "NetworkInfo.h"
|
2016-05-06 23:03:39 +00:00
|
|
|
|
2020-11-17 16:56:12 +00:00
|
|
|
#include <cassert>
|
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
const uint16_t BLACK = 0U;
|
|
|
|
const uint16_t WHITE = 1U;
|
|
|
|
|
|
|
|
// Init gray level for text. Default:Brightest White
|
|
|
|
const uint8_t GRAY_H = 0xF0U;
|
|
|
|
const uint8_t GRAY_L = 0x0FU;
|
|
|
|
|
|
|
|
const uint16_t OLED_STATUSBAR = 0U;
|
|
|
|
const uint16_t OLED_LINE1 = 8U; //16
|
|
|
|
const uint16_t OLED_LINE2 = 18U; //26
|
|
|
|
const uint16_t OLED_LINE3 = 28U; //36
|
|
|
|
const uint16_t OLED_LINE4 = 37U; //46
|
|
|
|
const uint16_t OLED_LINE5 = 47U; //56
|
|
|
|
const uint16_t OLED_LINE6 = 57U;
|
|
|
|
|
|
|
|
const uint8_t SSD_Command_Mode = 0x00U; /* C0 and DC bit are 0 */
|
|
|
|
const uint8_t SSD_Data_Mode = 0x40U; /* C0 bit is 0 and DC bit is 1 */
|
|
|
|
|
|
|
|
const uint8_t SSD_Inverse_Display = 0xA7U;
|
|
|
|
const uint8_t SSD_Set_ContrastLevel = 0x81U;
|
|
|
|
|
|
|
|
const uint8_t SSD_Activate_Scroll = 0x2FU;
|
|
|
|
const uint8_t SSD_Deactivate_Scroll = 0x2EU;
|
|
|
|
|
|
|
|
const uint8_t SSD_Left_Horizontal_Scroll = 0x27U;
|
|
|
|
|
|
|
|
const uint8_t SSD1306_Normal_Display = 0xA6U;
|
|
|
|
|
|
|
|
// Scrolling #defines
|
|
|
|
const uint8_t SSD1306_SET_VERTICAL_SCROLL_AREA = 0xA3U;
|
|
|
|
const uint8_t SSD1306_VERTICAL_AND_RIGHT_HORIZONTAL_SCROLL = 0x29U;
|
|
|
|
const uint8_t SSD1306_VERTICAL_AND_LEFT_HORIZONTAL_SCROLL = 0x2AU;
|
|
|
|
|
|
|
|
const uint8_t SSD1306_Set_Lower_Column_Start_Address = 0x00U;
|
|
|
|
const uint8_t SSD1306_Set_Higher_Column_Start_Address = 0x10U;
|
|
|
|
const uint8_t SSD1306_Set_Start_Line = 0x40U;
|
|
|
|
|
|
|
|
// Arduino Compatible Macro
|
|
|
|
#define _BV(bit) (1 << (bit))
|
|
|
|
|
|
|
|
// standard ascii 5x7 font
|
|
|
|
const uint8_t FONT[] = {
|
|
|
|
0x00U, 0x00U, 0x00U, 0x00U, 0x00U,
|
|
|
|
0x3EU, 0x5BU, 0x4FU, 0x5BU, 0x3EU,
|
|
|
|
0x3EU, 0x6BU, 0x4FU, 0x6BU, 0x3EU,
|
|
|
|
0x1CU, 0x3EU, 0x7CU, 0x3EU, 0x1CU,
|
|
|
|
0x18U, 0x3CU, 0x7EU, 0x3CU, 0x18U,
|
|
|
|
0x1CU, 0x57U, 0x7DU, 0x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
|
0x06U, 0x0EU, 0x3EU, 0x0EU, 0x06U,
|
|
|
|
0x00U, 0x00U, 0x00U, 0x00U, 0x00U,
|
|
|
|
0x00U, 0x00U, 0x5FU, 0x00U, 0x00U,
|
|
|
|
0x00U, 0x07U, 0x00U, 0x07U, 0x00U,
|
|
|
|
0x14U, 0x7FU, 0x14U, 0x7FU, 0x14U,
|
|
|
|
0x24U, 0x2AU, 0x7FU, 0x2AU, 0x12U,
|
|
|
|
0x23U, 0x13U, 0x08U, 0x64U, 0x62U,
|
|
|
|
0x36U, 0x49U, 0x56U, 0x20U, 0x50U,
|
|
|
|
0x00U, 0x08U, 0x07U, 0x03U, 0x00U,
|
|
|
|
0x00U, 0x1CU, 0x22U, 0x41U, 0x00U,
|
|
|
|
0x00U, 0x41U, 0x22U, 0x1CU, 0x00U,
|
|
|
|
0x2AU, 0x1CU, 0x7FU, 0x1CU, 0x2AU,
|
|
|
|
0x08U, 0x08U, 0x3EU, 0x08U, 0x08U,
|
|
|
|
0x00U, 0x80U, 0x70U, 0x30U, 0x00U,
|
|
|
|
0x08U, 0x08U, 0x08U, 0x08U, 0x08U,
|
|
|
|
0x00U, 0x00U, 0x60U, 0x60U, 0x00U,
|
|
|
|
0x20U, 0x10U, 0x08U, 0x04U, 0x02U,
|
|
|
|
0x3EU, 0x51U, 0x49U, 0x45U, 0x3EU,
|
|
|
|
0x00U, 0x42U, 0x7FU, 0x40U, 0x00U,
|
|
|
|
0x72U, 0x49U, 0x49U, 0x49U, 0x46U,
|
|
|
|
0x21U, 0x41U, 0x49U, 0x4DU, 0x33U,
|
|
|
|
0x18U, 0x14U, 0x12U, 0x7FU, 0x10U,
|
|
|
|
0x27U, 0x45U, 0x45U, 0x45U, 0x39U,
|
|
|
|
0x3CU, 0x4AU, 0x49U, 0x49U, 0x31U,
|
|
|
|
0x41U, 0x21U, 0x11U, 0x09U, 0x07U,
|
|
|
|
0x36U, 0x49U, 0x49U, 0x49U, 0x36U,
|
|
|
|
0x46U, 0x49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U, 0x49U, 0x32U,
|
|
|
|
0x03U, 0x01U, 0x7FU, 0x01U, 0x03U,
|
|
|
|
0x3FU, 0x40U, 0x40U, 0x40U, 0x3FU,
|
|
|
|
0x1FU, 0x20U, 0x40U, 0x20U, 0x1FU,
|
|
|
|
0x3FU, 0x40U, 0x38U, 0x40U, 0x3FU,
|
|
|
|
0x63U, 0x14U, 0x08U, 0x14U, 0x63U,
|
|
|
|
0x03U, 0x04U, 0x78U, 0x04U, 0x03U,
|
|
|
|
0x61U, 0x59U, 0x49U, 0x4DU, 0x43U,
|
|
|
|
0x00U, 0x7FU, 0x41U, 0x41U, 0x41U,
|
|
|
|
0x02U, 0x04U, 0x08U, 0x10U, 0x20U,
|
|
|
|
0x00U, 0x41U, 0x41U, 0x41U, 0x7FU,
|
|
|
|
0x04U, 0x02U, 0x01U, 0x02U, 0x04U,
|
|
|
|
0x40U, 0x40U, 0x40U, 0x40U, 0x40U,
|
|
|
|
0x00U, 0x03U, 0x07U, 0x08U, 0x00U,
|
|
|
|
0x20U, 0x54U, 0x54U, 0x78U, 0x40U,
|
|
|
|
0x7FU, 0x28U, 0x44U, 0x44U, 0x38U,
|
|
|
|
0x38U, 0x44U, 0x44U, 0x44U, 0x28U,
|
|
|
|
0x38U, 0x44U, 0x44U, 0x28U, 0x7FU,
|
|
|
|
0x38U, 0x54U, 0x54U, 0x54U, 0x18U,
|
|
|
|
0x00U, 0x08U, 0x7EU, 0x09U, 0x02U,
|
|
|
|
0x18U, 0xA4U, 0xA4U, 0x9CU, 0x78U,
|
|
|
|
0x7FU, 0x08U, 0x04U, 0x04U, 0x78U,
|
|
|
|
0x00U, 0x44U, 0x7DU, 0x40U, 0x00U,
|
|
|
|
0x20U, 0x40U, 0x40U, 0x3DU, 0x00U,
|
|
|
|
0x7FU, 0x10U, 0x28U, 0x44U, 0x00U,
|
|
|
|
0x00U, 0x41U, 0x7FU, 0x40U, 0x00U,
|
|
|
|
0x7CU, 0x04U, 0x78U, 0x04U, 0x78U,
|
|
|
|
0x7CU, 0x08U, 0x04U, 0x04U, 0x78U,
|
|
|
|
0x38U, 0x44U, 0x44U, 0x44U, 0x38U,
|
|
|
|
0xFCU, 0x18U, 0x24U, 0x24U, 0x18U,
|
|
|
|
0x18U, 0x24U, 0x24U, 0x18U, 0xFCU,
|
|
|
|
0x7CU, 0x08U, 0x04U, 0x04U, 0x08U,
|
|
|
|
0x48U, 0x54U, 0x54U, 0x54U, 0x24U,
|
|
|
|
0x04U, 0x04U, 0x3FU, 0x44U, 0x24U,
|
|
|
|
0x3CU, 0x40U, 0x40U, 0x20U, 0x7CU,
|
|
|
|
0x1CU, 0x20U, 0x40U, 0x20U, 0x1CU,
|
|
|
|
0x3CU, 0x40U, 0x30U, 0x40U, 0x3CU,
|
|
|
|
0x44U, 0x28U, 0x10U, 0x28U, 0x44U,
|
|
|
|
0x4CU, 0x90U, 0x90U, 0x90U, 0x7CU,
|
|
|
|
0x44U, 0x64U, 0x54U, 0x4CU, 0x44U,
|
|
|
|
0x00U, 0x08U, 0x36U, 0x41U, 0x00U,
|
|
|
|
0x00U, 0x00U, 0x77U, 0x00U, 0x00U,
|
|
|
|
0x00U, 0x41U, 0x36U, 0x08U, 0x00U,
|
|
|
|
0x02U, 0x01U, 0x02U, 0x04U, 0x02U,
|
|
|
|
0x3CU, 0x26U, 0x23U, 0x26U, 0x3CU,
|
|
|
|
0x1EU, 0xA1U, 0xA1U, 0x61U, 0x12U,
|
|
|
|
0x3AU, 0x40U, 0x40U, 0x20U, 0x7AU,
|
|
|
|
0x38U, 0x54U, 0x54U, 0x55U, 0x59U,
|
|
|
|
0x21U, 0x55U, 0x55U, 0x79U, 0x41U,
|
|
|
|
0x21U, 0x54U, 0x54U, 0x78U, 0x41U,
|
|
|
|
0x21U, 0x55U, 0x54U, 0x78U, 0x40U,
|
|
|
|
0x20U, 0x54U, 0x55U, 0x79U, 0x40U,
|
|
|
|
0x0CU, 0x1EU, 0x52U, 0x72U, 0x12U,
|
|
|
|
0x39U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 0x2AU,
|
|
|
|
0x44U, 0x44U, 0x5FU, 0x44U, 0x44U,
|
|
|
|
0x40U, 0x51U, 0x4AU, 0x44U, 0x40U,
|
|
|
|
0x40U, 0x44U, 0x4AU, 0x51U, 0x40U,
|
|
|
|
0x00U, 0x00U, 0xFFU, 0x01U, 0x03U,
|
|
|
|
0xE0U, 0x80U, 0xFFU, 0x00U, 0x00U,
|
|
|
|
0x08U, 0x08U, 0x6BU, 0x6BU, 0x08U,
|
|
|
|
0x36U, 0x12U, 0x36U, 0x24U, 0x36U,
|
|
|
|
0x06U, 0x0FU, 0x09U, 0x0FU, 0x06U,
|
|
|
|
0x00U, 0x00U, 0x18U, 0x18U, 0x00U,
|
|
|
|
0x00U, 0x00U, 0x10U, 0x10U, 0x00U,
|
|
|
|
0x30U, 0x40U, 0xFFU, 0x01U, 0x01U,
|
|
|
|
0x00U, 0x1FU, 0x01U, 0x01U, 0x1EU,
|
|
|
|
0x00U, 0x19U, 0x1DU, 0x17U, 0x12U,
|
|
|
|
0x00U, 0x3CU, 0x3CU, 0x3CU, 0x3CU,
|
|
|
|
0x00U, 0x00U, 0x00U, 0x00U, 0x00U};
|
|
|
|
|
2017-08-06 16:35:10 +00:00
|
|
|
//Logo MMDVM for Idle Screen
|
2020-11-17 11:50:00 +00:00
|
|
|
static unsigned char logo_glcd_bmp[] = {
|
2020-11-17 12:06:10 +00:00
|
|
|
0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U,
|
|
|
|
0x01U, 0xF8U, 0x03U, 0xFCU, 0x7FU, 0x80U, 0x3FU, 0xC7U, 0xFFU, 0xFCU, 0xF8U, 0x00U, 0xF9U, 0xFCU, 0x01U, 0xFEU,
|
|
|
|
0x01U, 0xFCU, 0x07U, 0xFCU, 0x7FU, 0xC0U, 0x7FU, 0xC4U, 0x00U, 0x02U, 0x48U, 0x00U, 0x91U, 0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 0xFCU, 0x1EU,
|
|
|
|
0x3CU, 0x01U, 0xF0U, 0x3CU, 0x78U, 0x1FU, 0x03U, 0xC4U, 0x00U, 0x02U, 0x02U, 0x02U, 0x3CU, 0x00U, 0xF8U, 0x1EU,
|
|
|
|
0x7CU, 0x01U, 0xF0U, 0x3CU, 0x78U, 0x1FU, 0x03U, 0xC7U, 0xFFU, 0xFCU, 0x01U, 0xFCU, 0x7CU, 0x00U, 0xF8U, 0x1EU,
|
|
|
|
0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U,
|
|
|
|
0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U};
|
2017-08-06 16:35:10 +00:00
|
|
|
|
|
|
|
//Logo D-Star 128x16 px
|
2020-11-17 11:50:00 +00:00
|
|
|
static unsigned char logo_dstar_bmp[] = {
|
2020-11-17 12:06:10 +00:00
|
|
|
0x00U, 0x00U, 0x20U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U,
|
|
|
|
0x00U, 0x00U, 0x60U, 0x03U, 0xFFU, 0xC0U, 0x00U, 0x00U, 0x1FU, 0xF0U, 0xFFU, 0xFEU, 0x07U, 0x80U, 0x3FU, 0xF8U,
|
|
|
|
0x00U, 0x00U, 0xC0U, 0x07U, 0xC1U, 0xD0U, 0x00U, 0x00U, 0x78U, 0x7CU, 0xFFU, 0xFEU, 0x0FU, 0xC0U, 0x3FU, 0xFCU,
|
|
|
|
0x00U, 0x01U, 0xC0U, 0x07U, 0x80U, 0xF0U, 0x00U, 0x00U, 0xD0U, 0x3CU, 0x07U, 0x80U, 0x0FU, 0xC0U, 0x78U, 0x0EU,
|
|
|
|
0x00U, 0x03U,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U, 0x00U, 0x03U, 0xFFU, 0x80U, 0x1CU, 0x0CU, 0x00U, 0xF3U, 0xC0U, 0x38U,
|
|
|
|
0x06U, 0x03U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x3CU, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U,
|
|
|
|
0x00U, 0x01U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U};
|
2017-08-06 16:35:10 +00:00
|
|
|
|
|
|
|
//Logo DMR 128x16 px
|
2020-11-17 11:50:00 +00:00
|
|
|
static unsigned char logo_dmr_bmp[] = {
|
2020-11-17 12:06:10 +00:00
|
|
|
0x00U, 0x01U, 0xFFU, 0xFFU, 0xF8U, 0x01U, 0xF8U, 0x00U, 0x00U, 0x1FU, 0x1FU, 0xFFU, 0xFFU, 0xFCU, 0x00U, 0x00U,
|
|
|
|
0x00U, 0x01U, 0xFFU, 0xFFU, 0xFFU, 0x81U, 0xFCU, 0x00U, 0x00U, 0x3FU, 0x1FU, 0xFFU, 0xFFU, 0xFFU, 0x00U, 0x00U,
|
|
|
|
0x00U, 0x01U, 0xFFU, 0xFFU, 0xFFU, 0xE1U, 0xFEU, 0x00U, 0x00U, 0xFFU, 0x1FU, 0xFFU, 0xFFU, 0xFFU, 0x00U, 0x00U,
|
|
|
|
0x00U, 0x01U, 0xF8U, 0x00U, 0x0FU, 0xF1U, 0xFFU, 0x80U, 0x01U, 0xFFU, 0x1FU, 0x80U, 0x00U, 0x1FU, 0x00U, 0x00U,
|
|
|
|
0x00U, 0x01U, 0xF8U, 0x00U, 0x03U, 0xF9U, 0xFFU, 0xC0U, 0x03U, 0xFFU, 0x1FU, 0x80U, 0x00U, 0x0FU, 0x00U, 0x00U,
|
|
|
|
0x00U, 0x01U, 0xF8U, 0x00U, 0x01U, 0xF9U, 0xFFU, 0xD0U, 0x07U, 0xFFU,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x80U, 0x03U, 0xFCU, 0x00U, 0x00U,
|
|
|
|
0x00U, 0x01U, 0xFFU, 0xFFU, 0xF0U, 0x01U, 0xF0U, 0x00U, 0x00U, 0x1FU, 0x1FU, 0x80U, 0x01U, 0xFFU, 0x00U, 0x00U};
|
2017-08-06 16:35:10 +00:00
|
|
|
|
|
|
|
//Logo Fusion 128x16
|
2020-11-17 11:50:00 +00:00
|
|
|
const unsigned char logo_fusion_bmp [] = {
|
2020-11-17 12:06:10 +00:00
|
|
|
0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U,
|
|
|
|
0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x03U, 0xF8U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U,
|
|
|
|
0x00U, 0xFFU, 0xFFU, 0xD0U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x07U, 0xF0U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U,
|
|
|
|
0x00U, 0xFFU, 0x80U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x07U, 0xD0U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U,
|
|
|
|
0x00U, 0xFFU, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U,
|
|
|
|
0x01U, 0xFEU, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U,
|
|
|
|
0x03U, 0xFCU, 0x00U, 0x1FU, 0xE1U, 0xFEU, 0x1FU, 0xFFU, 0xF8U, 0x7FU, 0xC3U, 0xFFU, 0xFFU, 0x1FU, 0xFFU, 0xFEU,
|
|
|
|
0x03U, 0xFCU,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2017-08-06 16:35:10 +00:00
|
|
|
|
2018-06-13 11:07:06 +00:00
|
|
|
//Logo P25 128x16px
|
2020-11-17 11:50:00 +00:00
|
|
|
const unsigned char logo_P25_bmp [] = {
|
2020-11-17 12:06:10 +00:00
|
|
|
0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U,
|
|
|
|
0x01U, 0xFFU, 0xFFU, 0xFFU, 0xF0U, 0x00U, 0x03U, 0xFFU, 0xFFU, 0xC0U, 0x01U, 0xFFU, 0xFFU, 0xFFU, 0xF8U, 0x00U,
|
|
|
|
0x01U, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0x80U, 0x3FU, 0xFFU, 0xFFU, 0xFCU, 0x01U, 0xFFU, 0xFFU, 0xFFU, 0xF8U, 0x00U,
|
|
|
|
0x01U, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xD0U, 0xFFU, 0xF8U, 0x3FU, 0xFFU, 0x01U, 0xFFU, 0xFFU, 0xFFU, 0xF8U, 0x00U,
|
|
|
|
0x01U, 0xFFU, 0xC0U, 0x00U, 0x7FU, 0xF1U, 0xFFU, 0xC0U, 0x07U, 0xFFU, 0x01U, 0xFFU, 0x00U, 0x00U, 0x00U, 0x00U,
|
|
|
|
0x01U, 0xFFU, 0xC0U, 0x00U, 0x3FU, 0xF3U, 0xFFU, 0x80U, 0x03U, 0xFFU, 0x81U, 0xFFU, 0x00U, 0x00U, 0x00U, 0x00U,
|
|
|
|
0x01U, 0xFFU, 0xC0U, 0x00U, 0x3FU, 0xF1U, 0xFFU, 0x80U, 0x07U, 0xFFU, 0x01U, 0xFFU, 0xFFU, 0xFFU, 0xD0U, 0x00U,
|
|
|
|
0x01U, 0xFFU, 0xC0U, 0x07U, 0xFFU, 0xD0U, 0x00U, 0x00U, 0x1FU, 0xFEU, 0x01U, 0xFFU, 0xFFU, 0xFFU, 0xFEU, 0x00U,
|
|
|
|
0x01U, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0x80U, 0x00U, 0x00U, 0xFFU, 0xF8U, 0x00U, 0x00U, 0x00U, 0x07U, 0xFFU, 0x80U,
|
|
|
|
0x01U, 0xFFU, 0xFFU, 0xFFU, 0xF8U, 0x00U, 0x00U, 0x07U, 0xFFU, 0xC0U, 0x00U, 0x00U, 0x00U, 0x01U, 0xFFU, 0xC0U,
|
|
|
|
0x01U, 0xFFU, 0xC0U, 0x00U, 0x00U, 0x00U, 0x00U, 0x7FU, 0xFEU, 0x00U, 0x00U, 0x00U, 0x00U, 0x01U, 0xFFU, 0xC0U,
|
|
|
|
0x01U, 0xFFU, 0xC0U, 0x00U, 0x00U, 0x00U, 0x07U, 0xFFU, 0xD0U, 0x00U, 0x03U, 0xF0U, 0x00U, 0x03U, 0xFFU, 0xC0U,
|
|
|
|
0x01U, 0xFFU, 0xC0U, 0x00U, 0x00U, 0x00U, 0xFFU, 0xFFU, 0x80U, 0x00U, 0x1FU, 0xFFU, 0x00U, 0x1FU, 0xFFU, 0x00U,
|
|
|
|
0x01U, 0xFFU, 0xC0U, 0x00U, 0x00U, 0x07U, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0x87U, 0xFFU, 0xFFU, 0xFFU, 0xFCU, 0x00U,
|
|
|
|
0x01U, 0xFFU, 0xC0U, 0x00U, 0x00U, 0x07U, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0x80U, 0x7FU, 0xFFU, 0xFFU, 0xC0U, 0x00U,
|
|
|
|
0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U};
|
2018-06-13 11:07:06 +00:00
|
|
|
|
2018-04-12 12:36:17 +00:00
|
|
|
// Logo NXDN_sm, 128x16px
|
2020-11-17 11:50:00 +00:00
|
|
|
const unsigned char logo_NXDN_bmp [] = {
|
2020-11-17 12:06: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x07U, 0xFFU,
|
|
|
|
0xFCU, 0x07U, 0x80U, 0x03U, 0xFCU, 0x00U, 0x01U, 0xFEU, 0x01U, 0xFCU, 0x01U, 0xD0U, 0x1EU, 0x00U, 0x0FU, 0xFFU,
|
|
|
|
0xF8U, 0x0FU, 0xC0U, 0x07U, 0xF0U, 0x0EU, 0x00U, 0xFCU, 0x00U, 0x00U, 0x07U, 0xC0U, 0x3FU, 0x00U, 0x1FU, 0xFFU,
|
|
|
|
0xF0U, 0x1FU, 0xD0U, 0x0FU, 0x80U, 0x3FU, 0x00U, 0x7CU, 0x00U, 0x00U, 0x3FU, 0xC0U, 0x7FU, 0x80U, 0x3FU, 0xFFU,
|
|
|
|
0xD0U, 0x3FU, 0xF0U, 0x0EU, 0x01U, 0xFFU, 0x80U, 0x38U, 0x00U, 0x07U, 0xFFU, 0x80U, 0xFFU, 0x80U, 0x7FU, 0xFFU,
|
|
|
|
0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU,
|
|
|
|
0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU,
|
|
|
|
0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU};
|
2016-11-11 21:26:07 +00:00
|
|
|
|
2020-11-16 16:56:36 +00:00
|
|
|
// Logo M17_sm, 128x16px
|
2020-11-13 16:01:46 +00:00
|
|
|
// XXX FIXME This is the NXDN logo, it needs replacing with the M17 logo
|
2020-11-17 11:50:00 +00:00
|
|
|
const unsigned char logo_M17_bmp [] = {
|
2020-11-17 12:06:10 +00:00
|
|
|
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FFU, 0xDFU, 0xB7U, 0x7EU, 0xFFU, 0xA0U, 0x1EU, 0xFFU, 0xDFU, 0x36U, 0xFFU, 0xFBU, 0xFFU, 0xFFU,
|
|
|
|
0xFFU, 0xFFU, 0xFFU, 0xDFU, 0xBCU, 0xFEU, 0xFFU, 0x6FU, 0xEEU, 0xFFU, 0xDFU, 0xB6U, 0xFFU, 0xFBU, 0xFFU, 0xFFU,
|
|
|
|
0xFFU, 0xFFU, 0xFFU, 0xDFU, 0xBFU, 0xFEU, 0xFFU, 0x6FU, 0xEEU, 0xFFU, 0xDFU, 0xD6U, 0xFFU, 0xFBU, 0xFFU, 0xFFU,
|
|
|
|
0xFFU, 0xFFU, 0xFFU, 0xDFU, 0xBFU, 0xFEU, 0xFEU, 0xDFU, 0xF6U, 0xFFU, 0xDFU, 0xE6U, 0xFFU, 0xFBU, 0xFFU, 0xFFU,
|
|
|
|
0xFFU, 0xFFU, 0xFFU, 0xDFU, 0x7FU, 0xFEU, 0xF9U, 0xDFU, 0xF6U, 0xFFU, 0xDFU, 0xE6U, 0xFFU, 0xFBU, 0xFFU, 0xFFU,
|
|
|
|
0xFFU, 0xFFU, 0xFFU, 0xE6U, 0x7FU, 0xFEU, 0x07U, 0xFFU, 0xF6U, 0xFFU, 0xDFU, 0xF6U, 0x00U, 0xFBU, 0xFFU, 0xFFU,
|
|
|
|
0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU};
|
2018-06-13 11:36:28 +00:00
|
|
|
|
2020-11-17 16:56:12 +00:00
|
|
|
COLED::COLED(II2CPort* port, unsigned char displayType, unsigned char displayBrightness, bool displayInvert, bool displayScroll, bool displayRotate, bool displayLogoScreensaver, bool slot1Enabled, bool slot2Enabled) :
|
|
|
|
m_port(port),
|
2020-11-17 12:06:10 +00:00
|
|
|
m_mode(MODE_IDLE),
|
2016-05-06 23:03:39 +00:00
|
|
|
m_displayType(displayType),
|
|
|
|
m_displayBrightness(displayBrightness),
|
2017-08-13 09:57:02 +00:00
|
|
|
m_displayInvert(displayInvert),
|
2018-04-08 22:29:35 +00:00
|
|
|
m_displayScroll(displayScroll),
|
2018-10-30 14:30:41 +00:00
|
|
|
m_displayRotate(displayRotate),
|
2019-09-27 20:28:57 +00:00
|
|
|
m_displayLogoScreensaver(displayLogoScreensaver),
|
2018-04-08 22:29:35 +00:00
|
|
|
m_slot1Enabled(slot1Enabled),
|
2018-10-31 16:54:57 +00:00
|
|
|
m_slot2Enabled(slot2Enabled),
|
2020-11-17 11:50:00 +00:00
|
|
|
m_ipAddress(),
|
|
|
|
m_passCounter(0U),
|
2020-11-17 15:30:59 +00:00
|
|
|
m_oledBuffer(NULL),
|
|
|
|
m_width(0U),
|
|
|
|
m_height(0U),
|
|
|
|
m_textWrap(true),
|
|
|
|
m_cursorX(0U),
|
|
|
|
m_cursorY(0U),
|
|
|
|
m_textSize(1U),
|
|
|
|
m_textColor(0xFFFFU),
|
|
|
|
m_textBGColor(0xFFFFU)
|
2016-05-06 23:03:39 +00:00
|
|
|
{
|
2020-11-17 16:56:12 +00:00
|
|
|
assert(port != NULL);
|
2016-05-06 23:03:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
COLED::~COLED()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
bool COLED::open()
|
|
|
|
{
|
2020-11-17 15:30:59 +00:00
|
|
|
// I2C change parameters to fit to your LCD
|
|
|
|
if (!m_display.init(OLED_I2C_RESET, m_displayType))
|
|
|
|
return false;
|
2016-05-06 23:03:39 +00:00
|
|
|
|
2020-11-17 16:56:12 +00:00
|
|
|
bool ret = m_port->open();
|
|
|
|
if (!ret)
|
|
|
|
return false;
|
|
|
|
|
2020-11-17 12:06:10 +00:00
|
|
|
m_display.begin();
|
2016-05-06 23:03:39 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
m_oledBuffer = new uint8_t[m_width * m_height];
|
|
|
|
|
|
|
|
invertDisplay(m_displayInvert);
|
2020-11-17 12:06:10 +00:00
|
|
|
if (m_displayBrightness > 0U)
|
2020-11-17 15:30:59 +00:00
|
|
|
setBrightness(m_displayBrightness);
|
2016-05-06 23:03:39 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
if (m_displayRotate) {
|
|
|
|
sendCommand(0xC0U);
|
|
|
|
sendCommand(0xA0U);
|
2020-11-17 12:06:10 +00:00
|
|
|
}
|
2018-10-30 14:30:41 +00:00
|
|
|
|
2020-11-17 12:06:10 +00:00
|
|
|
// init done
|
2020-11-17 15:30:59 +00:00
|
|
|
m_textWrap = false; // disable text wrap as default
|
|
|
|
clearDisplay(); // clears the screen buffer
|
|
|
|
display(); // display it (clear display)
|
2016-05-06 23:03:39 +00:00
|
|
|
|
2020-11-17 12:06:10 +00:00
|
|
|
statusbar();
|
2020-11-17 11:50:00 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
m_cursorX = 0U;
|
|
|
|
m_cursorY = OLED_LINE3;
|
|
|
|
print("Startup");
|
2020-11-17 11:50:00 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
display();
|
2016-05-06 23:03:39 +00:00
|
|
|
|
2020-11-17 12:06:10 +00:00
|
|
|
return true;
|
2016-05-06 23:03:39 +00:00
|
|
|
}
|
|
|
|
|
2016-05-10 15:17:49 +00:00
|
|
|
void COLED::setIdleInt()
|
2016-05-06 23:03:39 +00:00
|
|
|
{
|
2020-11-17 12:06:10 +00:00
|
|
|
m_mode = MODE_IDLE;
|
2016-05-06 23:03:39 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
clearDisplay();
|
2020-11-17 12:06:10 +00:00
|
|
|
statusbar();
|
2017-08-06 16:35:10 +00:00
|
|
|
|
2020-11-17 12:06:10 +00:00
|
|
|
if (m_displayScroll && m_displayLogoScreensaver)
|
2020-11-17 15:30:59 +00:00
|
|
|
startscrolldiagleft(0x00U, 0x0FU); //the MMDVM logo scrolls the whole screen
|
|
|
|
display();
|
2018-06-13 11:07:06 +00:00
|
|
|
|
2020-11-17 12:06:10 +00:00
|
|
|
m_passCounter++;
|
|
|
|
if (m_passCounter > 253U)
|
|
|
|
m_ipAddress.clear();
|
2018-06-13 11:07:06 +00:00
|
|
|
|
2020-11-17 12:06:10 +00:00
|
|
|
if (m_ipAddress.empty()) {
|
|
|
|
unsigned char info[100U] = { 0x00U };
|
2018-06-13 11:07:06 +00:00
|
|
|
|
2020-11-17 12:06:10 +00:00
|
|
|
CNetworkInfo network;
|
|
|
|
network.getNetworkInterface(info);
|
|
|
|
m_ipAddress = (char*)info;
|
2018-06-13 11:07:06 +00:00
|
|
|
|
2020-11-17 12:06:10 +00:00
|
|
|
m_passCounter = 0U;
|
|
|
|
}
|
2016-05-06 23:03:39 +00:00
|
|
|
}
|
|
|
|
|
2016-05-10 15:17:49 +00:00
|
|
|
void COLED::setErrorInt(const char* text)
|
2016-05-06 23:03:39 +00:00
|
|
|
{
|
2020-11-17 12:06:10 +00:00
|
|
|
m_mode = MODE_ERROR;
|
2016-05-06 23:03:39 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
clearDisplay();
|
2020-11-17 12:06:10 +00:00
|
|
|
statusbar();
|
2017-08-06 16:35:10 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
m_textWrap = true; // text wrap temorally enable
|
2020-11-17 11:50:00 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
m_cursorX = 0U;
|
|
|
|
m_cursorY = OLED_LINE1;
|
|
|
|
print(text);
|
2020-11-17 11:50:00 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
m_textWrap = false;
|
2017-08-06 16:35:10 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
display();
|
2016-05-06 23:03:39 +00:00
|
|
|
}
|
|
|
|
|
2016-05-10 15:17:49 +00:00
|
|
|
void COLED::setLockoutInt()
|
2016-05-06 23:03:39 +00:00
|
|
|
{
|
2020-11-17 12:06:10 +00:00
|
|
|
m_mode = MODE_LOCKOUT;
|
2016-05-06 23:03:39 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
clearDisplay();
|
2020-11-17 12:06:10 +00:00
|
|
|
statusbar();
|
2017-08-06 16:35:10 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
m_cursorX = 0U;
|
|
|
|
m_cursorY = 30U;
|
|
|
|
m_textSize = 3U;
|
|
|
|
print("Lockout");
|
2017-08-06 16:35:10 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
m_textSize = 1U;
|
|
|
|
display();
|
2016-05-06 23:03:39 +00:00
|
|
|
}
|
|
|
|
|
2018-08-15 16:17:42 +00:00
|
|
|
void COLED::setQuitInt()
|
|
|
|
{
|
2020-11-17 12:06:10 +00:00
|
|
|
m_mode = MODE_QUIT;
|
2018-08-15 16:17:42 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
clearDisplay();
|
2020-11-17 12:06:10 +00:00
|
|
|
statusbar();
|
2018-08-15 16:17:42 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
m_cursorX = 0U;
|
|
|
|
m_cursorY = 30U;
|
|
|
|
m_textSize = 3U;
|
|
|
|
print("Stopped");
|
2018-08-15 16:17:42 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
m_textSize = 1U;
|
|
|
|
display();
|
2018-08-15 16:17:42 +00:00
|
|
|
}
|
|
|
|
|
2020-05-02 19:42:54 +00:00
|
|
|
void COLED::setFMInt()
|
|
|
|
{
|
2020-11-17 12:06:10 +00:00
|
|
|
m_mode = MODE_FM;
|
2020-05-02 19:42:54 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
clearDisplay();
|
2020-11-17 12:06:10 +00:00
|
|
|
statusbar();
|
2020-05-02 19:42:54 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
m_cursorX = 0U;
|
|
|
|
m_cursorY = 30U;
|
|
|
|
m_textSize = 3U;
|
|
|
|
print("FM");
|
2020-05-02 19:42:54 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
m_textSize = 1U;
|
|
|
|
display();
|
2020-05-02 19:42:54 +00:00
|
|
|
}
|
|
|
|
|
2016-05-10 15:17:49 +00:00
|
|
|
void COLED::writeDStarInt(const char* my1, const char* my2, const char* your, const char* type, const char* reflector)
|
2016-05-06 23:03:39 +00:00
|
|
|
{
|
2020-11-17 12:06:10 +00:00
|
|
|
m_mode = MODE_DSTAR;
|
2017-08-06 16:35:10 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
clearDisplay();
|
|
|
|
fillRect(0U, OLED_LINE3, m_width, m_height, BLACK); //clear everything beneath logo
|
2017-08-06 16:35:10 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
m_cursorX = 0U;
|
|
|
|
m_cursorY = OLED_LINE3;
|
2017-08-06 16:35:10 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
char text[100U];
|
|
|
|
::sprintf(text, "%s %.8s/%4.4s", type, my1, my2);
|
|
|
|
print(text);
|
2017-08-06 16:35:10 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
m_cursorX = 0U;
|
|
|
|
m_cursorY = OLED_LINE4;
|
|
|
|
::sprintf(text, "-> %.8s", your);
|
|
|
|
print(text);
|
2018-06-13 11:07:06 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
m_cursorX = 0U;
|
|
|
|
m_cursorY = OLED_LINE5;
|
|
|
|
::sprintf(text, "via %.8s", reflector);
|
|
|
|
print(text);
|
|
|
|
|
|
|
|
m_cursorX = 0U;
|
|
|
|
m_cursorY = OLED_LINE6;
|
|
|
|
print(m_ipAddress.c_str());
|
2017-08-14 22:07:09 +00:00
|
|
|
|
2020-11-17 12:06:10 +00:00
|
|
|
statusbar();
|
2020-11-17 15:30:59 +00:00
|
|
|
display();
|
2016-05-06 23:03:39 +00:00
|
|
|
}
|
|
|
|
|
2016-05-10 15:17:49 +00:00
|
|
|
void COLED::clearDStarInt()
|
2016-05-06 23:03:39 +00:00
|
|
|
{
|
2020-11-17 15:30:59 +00:00
|
|
|
fillRect(0U, OLED_LINE3, m_width, m_height, BLACK); //clear everything beneath the logo
|
2017-08-14 22:07:09 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
m_cursorX = 40U;
|
|
|
|
m_cursorY = OLED_LINE3;
|
|
|
|
print("Listening");
|
2018-06-13 11:07:06 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
m_cursorX = 0U;
|
|
|
|
m_cursorY = OLED_LINE5;
|
|
|
|
print(m_ipAddress.c_str());
|
2017-08-06 16:35:10 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
display();
|
2016-05-06 23:03:39 +00:00
|
|
|
}
|
|
|
|
|
2020-11-17 11:50:00 +00:00
|
|
|
void COLED::writeDMRInt(unsigned int slotNo, const std::string& src, bool group, const std::string& dst, const char* type)
|
2020-09-24 10:58:10 +00:00
|
|
|
{
|
2020-11-17 12:06:10 +00:00
|
|
|
CUserDBentry tmp;
|
2020-09-24 10:58:10 +00:00
|
|
|
|
2020-11-17 12:06:10 +00:00
|
|
|
tmp.set(keyCALLSIGN, src);
|
|
|
|
writeDMRIntEx(slotNo, tmp, group, dst, type);
|
2020-09-24 10:58:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#define CALLandNAME(u) ((u).get(keyCALLSIGN) + " " + (u).get(keyFIRST_NAME))
|
|
|
|
|
|
|
|
int COLED::writeDMRIntEx(unsigned int slotNo, const class CUserDBentry& src, bool group, const std::string& dst, const char* type)
|
2016-05-06 23:03:39 +00:00
|
|
|
{
|
2020-11-17 12:06:10 +00:00
|
|
|
if (m_mode != MODE_DMR) {
|
2020-11-17 15:30:59 +00:00
|
|
|
clearDisplay();
|
2020-11-17 12:06:10 +00:00
|
|
|
m_mode = MODE_DMR;
|
|
|
|
clearDMRInt(slotNo);
|
|
|
|
}
|
2018-06-13 11:07:06 +00:00
|
|
|
|
2020-11-17 12:06:10 +00:00
|
|
|
// If both slots, use lines 2-3 for slot 1, lines 4-5 for slot 2
|
|
|
|
// If single slot, use lines 2-3
|
|
|
|
if (m_slot1Enabled && m_slot2Enabled) {
|
|
|
|
if (slotNo == 1U) {
|
2020-11-17 15:30:59 +00:00
|
|
|
fillRect(0U, OLED_LINE2, m_width, 40U, BLACK);
|
|
|
|
|
|
|
|
m_cursorX = 0U;
|
|
|
|
m_cursorY = OLED_LINE2;
|
|
|
|
print(CALLandNAME(src).c_str());
|
2020-11-17 11:50:00 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
m_cursorX = 0U;
|
|
|
|
m_cursorY = OLED_LINE3;
|
2020-11-17 11:50:00 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
char text[100U];
|
|
|
|
::sprintf(text, "Slot: %i %s %s%s", slotNo, type, group ? "TG: " : "", dst.c_str());
|
|
|
|
print(text);
|
2020-11-17 12:06:10 +00:00
|
|
|
} else {
|
2020-11-17 15:30:59 +00:00
|
|
|
fillRect(0U, OLED_LINE4, m_width, 40U, BLACK);
|
|
|
|
|
|
|
|
m_cursorX = 0U;
|
|
|
|
m_cursorY = OLED_LINE4;
|
|
|
|
print(CALLandNAME(src).c_str());
|
2020-11-17 11:50:00 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
m_cursorX = 0U;
|
|
|
|
m_cursorY = OLED_LINE5;
|
2020-11-17 11:50:00 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
char text[100U];
|
|
|
|
::sprintf(text, "Slot: %i %s %s%s",slotNo,type,group ? "TG: " : "", dst.c_str());
|
|
|
|
print(text);
|
2020-11-17 12:06:10 +00:00
|
|
|
}
|
2018-06-13 11:07:06 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
fillRect(0U, OLED_LINE6, m_width, 20U, BLACK);
|
2020-11-17 11:50:00 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
m_cursorX = 0U;
|
|
|
|
m_cursorY = OLED_LINE6;
|
|
|
|
print(m_ipAddress.c_str());
|
2020-11-17 12:06:10 +00:00
|
|
|
} else {
|
2020-11-17 15:30:59 +00:00
|
|
|
fillRect(0U, OLED_LINE2, m_width, m_height, BLACK);
|
2020-11-17 11:50:00 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
m_cursorX = 0U;
|
|
|
|
m_cursorY = OLED_LINE2;
|
|
|
|
print(CALLandNAME(src).c_str());
|
2020-11-17 11:50:00 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
m_cursorX = 0U;
|
|
|
|
m_cursorY = OLED_LINE3;
|
2020-11-17 11:50:00 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
char text[100U];
|
|
|
|
::printf(text, "Slot: %i %s %s%s", slotNo, type, group ? "TG: " : "", dst.c_str());
|
|
|
|
print(text);
|
2020-11-17 11:50:00 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
m_cursorX = 0U;
|
|
|
|
m_cursorY = OLED_LINE4;
|
|
|
|
print(src.get(keyCITY).c_str());
|
2020-11-17 11:50:00 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
m_cursorX = 0U;
|
|
|
|
m_cursorY = OLED_LINE5;
|
|
|
|
print(src.get(keySTATE).c_str());
|
|
|
|
|
|
|
|
m_cursorX = 0U;
|
|
|
|
m_cursorY = OLED_LINE6;
|
|
|
|
print(src.get(keyCOUNTRY).c_str());
|
2020-11-17 12:06:10 +00:00
|
|
|
}
|
2018-06-13 11:07:06 +00:00
|
|
|
|
2020-11-17 12:06:10 +00:00
|
|
|
statusbar();
|
2020-11-17 15:30:59 +00:00
|
|
|
display();
|
2018-04-09 21:24:03 +00:00
|
|
|
|
2020-11-17 12:06:10 +00:00
|
|
|
// must be 0, to avoid calling writeDMRInt() from CDisplay::writeDMR()
|
|
|
|
return 0;
|
2018-10-31 16:54:57 +00:00
|
|
|
}
|
2016-05-06 23:03:39 +00:00
|
|
|
|
2016-05-10 15:17:49 +00:00
|
|
|
void COLED::clearDMRInt(unsigned int slotNo)
|
2016-05-06 23:03:39 +00:00
|
|
|
{
|
2020-11-17 12:06:10 +00:00
|
|
|
// If both slots, use lines 2-3 for slot 1, lines 4-5 for slot 2
|
|
|
|
// If single slot, use lines 2-3
|
|
|
|
if (m_slot1Enabled && m_slot2Enabled) {
|
|
|
|
if (slotNo == 1U) {
|
2020-11-17 15:30:59 +00:00
|
|
|
fillRect(0U, OLED_LINE3, m_width, 40U, BLACK);
|
2020-11-17 11:50:00 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
m_cursorX = 0U;
|
|
|
|
m_cursorY = OLED_LINE3;
|
|
|
|
print("Slot: 1 Listening");
|
2020-11-17 12:06:10 +00:00
|
|
|
} else {
|
2020-11-17 15:30:59 +00:00
|
|
|
fillRect(0U, OLED_LINE5, m_width, 40U, BLACK);
|
2020-11-17 11:50:00 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
m_cursorX = 0U;
|
|
|
|
m_cursorY = OLED_LINE5;
|
|
|
|
print("Slot: 2 Listening");
|
2020-11-17 12:06:10 +00:00
|
|
|
}
|
|
|
|
} else {
|
2020-11-17 15:30:59 +00:00
|
|
|
fillRect(0U, OLED_LINE2, m_width, m_height, BLACK);
|
|
|
|
|
|
|
|
m_cursorX = 0U;
|
|
|
|
m_cursorY = OLED_LINE3;
|
2020-11-17 11:50:00 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
char text[100U];
|
|
|
|
::sprintf(text, "Slot: %i Listening", slotNo);
|
|
|
|
print(text);
|
2020-11-17 12:06:10 +00:00
|
|
|
}
|
2018-06-13 11:07:06 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
fillRect(0U, OLED_LINE6, m_width, 20U, BLACK);
|
2020-11-17 11:50:00 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
m_cursorX = 0U;
|
|
|
|
m_cursorY = OLED_LINE6;
|
|
|
|
print(m_ipAddress.c_str());
|
2020-11-17 11:50:00 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
display();
|
2016-05-06 23:03:39 +00:00
|
|
|
}
|
|
|
|
|
OLED: fix build after f070410f7 and c7fbeecc5
============================
Display.cpp: In static member function 'static CDisplay* CDisplay::createDisplay(const CConf&, CUMP*, CModem*)':
Display.cpp:645:128: error: invalid new-expression of abstract class type 'COLED'
645 | display = new COLED(type, brightness, invert, scroll, rotate, logosaver, conf.getDMRNetworkSlot1(), conf.getDMRNetworkSlot2());
| ^
In file included from Display.cpp:39:
OLED.h:40:7: note: because the following virtual functions are pure within 'COLED':
40 | class COLED : public CDisplay
| ^~~~~
In file included from Display.cpp:19:
Display.h:105:15: note: 'virtual void CDisplay::writeFusionInt(const char*, const char*, unsigned char, const char*, const char*)'
105 | virtual void writeFusionInt(const char* source, const char* dest, unsigned char dgid, const char* type, const char* origin) = 0;
============================
2020-08-10 13:25:51 +00:00
|
|
|
void COLED::writeFusionInt(const char* source, const char* dest, unsigned char dgid, const char* type, const char* origin)
|
2016-05-06 23:03:39 +00:00
|
|
|
{
|
2020-11-17 12:06:10 +00:00
|
|
|
m_mode = MODE_YSF;
|
2017-08-06 16:35:10 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
clearDisplay();
|
|
|
|
fillRect(0U, OLED_LINE2, m_width, m_height, BLACK);
|
|
|
|
|
|
|
|
m_cursorX = 0U;
|
|
|
|
m_cursorY = OLED_LINE4;
|
|
|
|
|
|
|
|
char text[100U];
|
|
|
|
::sprintf(text, "%s %.10s", type, source);
|
|
|
|
print(text);
|
2017-08-06 16:35:10 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
m_cursorX = 0U;
|
|
|
|
m_cursorY = OLED_LINE5;
|
2017-08-06 16:35:10 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
::sprintf(text, " DG-ID %u", dgid);
|
|
|
|
print(text);
|
2017-08-06 16:35:10 +00:00
|
|
|
|
2020-11-17 12:06:10 +00:00
|
|
|
statusbar();
|
2020-11-17 15:30:59 +00:00
|
|
|
display();
|
2016-05-06 23:03:39 +00:00
|
|
|
}
|
|
|
|
|
2016-05-10 15:17:49 +00:00
|
|
|
void COLED::clearFusionInt()
|
2016-05-06 23:03:39 +00:00
|
|
|
{
|
2020-11-17 15:30:59 +00:00
|
|
|
fillRect(0U, OLED_LINE2, m_width, m_height, BLACK);
|
2017-08-06 16:35:10 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
m_cursorX = 40U;
|
|
|
|
m_cursorY = OLED_LINE4;
|
|
|
|
print("Listening");
|
2018-06-13 11:07:06 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
m_cursorX = 0U;
|
|
|
|
m_cursorY = OLED_LINE6;
|
|
|
|
print(m_ipAddress.c_str());
|
2017-08-06 16:35:10 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
display();
|
2016-05-06 23:03:39 +00:00
|
|
|
}
|
|
|
|
|
2016-09-12 19:23:50 +00:00
|
|
|
void COLED::writeP25Int(const char* source, bool group, unsigned int dest, const char* type)
|
2016-09-12 17:12:32 +00:00
|
|
|
{
|
2020-11-17 12:06:10 +00:00
|
|
|
m_mode = MODE_P25;
|
2017-08-06 16:35:10 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
clearDisplay();
|
|
|
|
fillRect(0U, OLED_LINE2, m_width, m_height, BLACK);
|
2017-08-06 16:35:10 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
m_cursorX = 0U;
|
|
|
|
m_cursorY = OLED_LINE3;
|
2017-08-06 16:35:10 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
char text[100U];
|
|
|
|
::sprintf(text, "%s %.10s", type, source);
|
|
|
|
print(text);
|
|
|
|
|
|
|
|
m_cursorX = 0U;
|
|
|
|
m_cursorY = OLED_LINE4;
|
|
|
|
|
|
|
|
::sprintf(text, " %s%u", group ? "TG" : "", dest);
|
|
|
|
print(text);
|
2017-08-06 16:35:10 +00:00
|
|
|
|
2020-11-17 12:06:10 +00:00
|
|
|
statusbar();
|
2020-11-17 15:30:59 +00:00
|
|
|
display();
|
2016-09-12 17:12:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void COLED::clearP25Int()
|
|
|
|
{
|
2020-11-17 15:30:59 +00:00
|
|
|
fillRect(0U, OLED_LINE2, m_width, m_height, BLACK);
|
2017-08-06 16:35:10 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
m_cursorX = 40U;
|
|
|
|
m_cursorY = OLED_LINE4;
|
|
|
|
print("Listening");
|
2018-06-13 11:07:06 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
m_cursorX = 0U;
|
|
|
|
m_cursorY = OLED_LINE6;
|
|
|
|
print(m_ipAddress.c_str());
|
2017-08-06 16:35:10 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
display();
|
2016-09-12 17:12:32 +00:00
|
|
|
}
|
|
|
|
|
2018-01-17 19:04:00 +00:00
|
|
|
void COLED::writeNXDNInt(const char* source, bool group, unsigned int dest, const char* type)
|
2020-09-24 10:58:10 +00:00
|
|
|
{
|
2020-11-17 12:06:10 +00:00
|
|
|
CUserDBentry tmp;
|
2020-09-24 10:58:10 +00:00
|
|
|
|
2020-11-17 12:06:10 +00:00
|
|
|
tmp.set(keyCALLSIGN, source);
|
|
|
|
writeNXDNIntEx(tmp, group, dest, type);
|
2020-09-24 10:58:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int COLED::writeNXDNIntEx(const class CUserDBentry& source, bool group, unsigned int dest, const char* type)
|
2018-01-17 19:04:00 +00:00
|
|
|
{
|
2020-11-17 12:06:10 +00:00
|
|
|
m_mode = MODE_NXDN;
|
2018-01-17 19:04:00 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
clearDisplay();
|
|
|
|
fillRect(0U, OLED_LINE2, m_width, m_height, BLACK);
|
|
|
|
|
|
|
|
m_cursorX = 0U;
|
|
|
|
m_cursorY = OLED_LINE2;
|
2018-01-17 19:04:00 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
char text[100U];
|
|
|
|
::sprintf(text, "%s %s", type, CALLandNAME(source).c_str());
|
|
|
|
print(text);
|
2020-09-24 10:58:10 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
m_cursorX = 0U;
|
|
|
|
m_cursorY = OLED_LINE3;
|
2020-09-24 10:58:10 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
::sprintf(text, " %s%u", group ? "TG" : "", dest);
|
|
|
|
print(text);
|
2018-01-17 19:04:00 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
m_cursorX = 0U;
|
|
|
|
m_cursorY = OLED_LINE4;
|
|
|
|
print(source.get(keyCITY).c_str());
|
2020-09-24 10:58:10 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
m_cursorX = 0U;
|
|
|
|
m_cursorY = OLED_LINE5;
|
|
|
|
print(source.get(keySTATE).c_str());
|
|
|
|
|
|
|
|
m_cursorX = 0U;
|
|
|
|
m_cursorY = OLED_LINE6;
|
|
|
|
print(source.get(keyCOUNTRY).c_str());
|
2018-01-17 19:04:00 +00:00
|
|
|
|
2020-11-17 12:06:10 +00:00
|
|
|
statusbar();
|
2020-11-17 15:30:59 +00:00
|
|
|
display();
|
2018-10-31 16:54:57 +00:00
|
|
|
|
2020-11-17 12:06:10 +00:00
|
|
|
// must be 0, to avoid calling writeNXDNInt() from CDisplay::writeNXDN()
|
|
|
|
return 0;
|
2018-01-17 19:04:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void COLED::clearNXDNInt()
|
|
|
|
{
|
2020-11-17 15:30:59 +00:00
|
|
|
fillRect(0U, OLED_LINE2, m_width, m_height, BLACK);
|
2018-01-17 19:04:00 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
m_cursorX = 40U;
|
|
|
|
m_cursorY = OLED_LINE3;
|
|
|
|
print("Listening");
|
2018-06-13 11:07:06 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
m_cursorX = 0U;
|
|
|
|
m_cursorY = OLED_LINE6;
|
|
|
|
print(m_ipAddress.c_str());
|
2018-01-17 19:04:00 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
display();
|
2018-01-17 19:04:00 +00:00
|
|
|
}
|
|
|
|
|
2020-11-15 18:12:38 +00:00
|
|
|
void COLED::writeM17Int(const char* source, const char* dest, const char* type)
|
|
|
|
{
|
2020-11-17 12:06:10 +00:00
|
|
|
m_mode = MODE_M17;
|
2020-11-15 18:12:38 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
clearDisplay();
|
|
|
|
fillRect(0U, OLED_LINE2, m_width, m_height, BLACK);
|
|
|
|
|
|
|
|
m_cursorX = 0U;
|
|
|
|
m_cursorY = OLED_LINE3;
|
2020-11-15 18:12:38 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
char text[100U];
|
|
|
|
::sprintf(text, "%s %s", type, source);
|
|
|
|
print(text);
|
2020-11-15 18:12:38 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
m_cursorX = 0U;
|
|
|
|
m_cursorY = OLED_LINE4;
|
|
|
|
|
|
|
|
::sprintf(text, " %s", dest);
|
|
|
|
print(text);
|
2020-11-15 18:12:38 +00:00
|
|
|
|
2020-11-17 12:06:10 +00:00
|
|
|
statusbar();
|
2020-11-17 15:30:59 +00:00
|
|
|
display();
|
2020-11-15 18:12:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void COLED::clearM17Int()
|
|
|
|
{
|
2020-11-17 15:30:59 +00:00
|
|
|
fillRect(0U, OLED_LINE2, m_width, m_height, BLACK);
|
2020-11-15 18:12:38 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
m_cursorX = 40U;
|
|
|
|
m_cursorY = OLED_LINE4;
|
|
|
|
print("Listening");
|
2020-11-15 18:12:38 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
m_cursorX = 0U;
|
|
|
|
m_cursorY = OLED_LINE6;
|
|
|
|
print(m_ipAddress.c_str());
|
2020-11-15 18:12:38 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
display();
|
2020-11-15 18:12:38 +00:00
|
|
|
}
|
|
|
|
|
2018-06-13 10:54:02 +00:00
|
|
|
void COLED::writePOCSAGInt(uint32_t ric, const std::string& message)
|
|
|
|
{
|
2020-11-17 12:06:10 +00:00
|
|
|
m_mode = MODE_POCSAG;
|
2018-06-13 10:54:02 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
clearDisplay();
|
|
|
|
fillRect(0U, OLED_LINE1, m_width, m_height, BLACK);
|
|
|
|
|
|
|
|
m_cursorX = 0U;
|
|
|
|
m_cursorY = OLED_LINE3;
|
2018-06-13 10:54:02 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
char text[100U];
|
|
|
|
::sprintf(text, "RIC: %u", ric);
|
|
|
|
print(text);
|
2018-06-13 10:54:02 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
m_textWrap = true; // text wrap temorally enable
|
2020-11-17 11:50:00 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
m_cursorX = 0U;
|
|
|
|
m_cursorY = OLED_LINE5;
|
2020-11-17 11:50:00 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
::sprintf(text, "MSG: %s", message.c_str());
|
|
|
|
print(text);
|
|
|
|
|
|
|
|
m_textWrap = false;
|
2018-06-13 10:54:02 +00:00
|
|
|
|
2020-11-17 12:06:10 +00:00
|
|
|
statusbar();
|
2020-11-17 15:30:59 +00:00
|
|
|
display();
|
2018-06-13 10:54:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void COLED::clearPOCSAGInt()
|
|
|
|
{
|
2020-11-17 15:30:59 +00:00
|
|
|
fillRect(0U, OLED_LINE1, m_width, m_height, BLACK);
|
|
|
|
|
|
|
|
m_cursorX = 40U;
|
|
|
|
m_cursorY = OLED_LINE4;
|
|
|
|
print("Listening");
|
2018-06-13 11:07:06 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
m_cursorX = 0U;
|
|
|
|
m_cursorY = OLED_LINE6;
|
|
|
|
print(m_ipAddress.c_str());
|
2018-06-13 10:54:02 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
display();
|
2018-06-13 10:54:02 +00:00
|
|
|
}
|
|
|
|
|
2016-10-20 08:59:12 +00:00
|
|
|
void COLED::writeCWInt()
|
|
|
|
{
|
2020-11-17 15:30:59 +00:00
|
|
|
clearDisplay();
|
2017-08-06 16:35:10 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
m_cursorX = 0U;
|
|
|
|
m_cursorY = 30U;
|
|
|
|
m_textSize = 3U;
|
2020-11-17 11:50:00 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
print("CW TX");
|
2017-08-06 16:35:10 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
m_textSize = 1U;
|
|
|
|
display();
|
2020-11-17 11:50:00 +00:00
|
|
|
|
2020-11-17 12:06:10 +00:00
|
|
|
if (m_displayScroll)
|
2020-11-17 15:30:59 +00:00
|
|
|
startscrollleft(0x02U, 0x0FU);
|
2016-10-20 08:59:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void COLED::clearCWInt()
|
|
|
|
{
|
2020-11-17 15:30:59 +00:00
|
|
|
clearDisplay();
|
2017-08-06 16:35:10 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
m_cursorX = 0U;
|
|
|
|
m_cursorY = 30U;
|
|
|
|
m_textSize = 3U;
|
2020-11-17 11:50:00 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
print("Idle");
|
2017-08-06 16:35:10 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
m_textSize = 1U;
|
|
|
|
display();
|
2020-11-17 11:50:00 +00:00
|
|
|
|
2020-11-17 12:06:10 +00:00
|
|
|
if (m_displayScroll)
|
2020-11-17 15:30:59 +00:00
|
|
|
startscrollleft(0x02U, 0x0FU);
|
2016-10-20 08:59:12 +00:00
|
|
|
}
|
|
|
|
|
2016-05-06 23:03:39 +00:00
|
|
|
void COLED::close()
|
|
|
|
{
|
2020-11-17 15:30:59 +00:00
|
|
|
clearDisplay();
|
|
|
|
fillRect(0U, 0, m_width, 16, BLACK);
|
2020-11-17 11:50:00 +00:00
|
|
|
|
2020-11-17 12:06:10 +00:00
|
|
|
if (m_displayScroll)
|
2020-11-17 15:30:59 +00:00
|
|
|
startscrollleft(0x00U, 0x01U);
|
2020-11-17 11:50:00 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
m_cursorX = 0U;
|
|
|
|
m_cursorY = 0U;
|
|
|
|
m_textSize = 2U;
|
2020-11-17 11:50:00 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
print("-CLOSE-");
|
2020-11-17 11:50:00 +00:00
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
display();
|
2018-11-01 09:29:49 +00:00
|
|
|
|
2020-11-17 12:06:10 +00:00
|
|
|
m_display.close();
|
2020-11-17 15:30:59 +00:00
|
|
|
|
2020-11-17 16:56:12 +00:00
|
|
|
m_port->close();
|
|
|
|
|
2020-11-17 15:30:59 +00:00
|
|
|
delete[] m_oledBuffer;
|
2016-05-06 23:03:39 +00:00
|
|
|
}
|
|
|
|
|
2020-11-17 12:06:10 +00:00
|
|
|
void COLED::statusbar()
|
2016-05-06 23:03:39 +00:00
|
|
|
{
|
2020-11-17 15:30:59 +00:00
|
|
|
stopscroll();
|
|
|
|
fillRect(0U, 0, m_width, 16, BLACK);
|
|
|
|
m_textColor = WHITE;
|
|
|
|
|
|
|
|
m_cursorX = 0U;
|
|
|
|
m_cursorY = 0U;
|
2020-11-17 12:06:10 +00:00
|
|
|
|
|
|
|
if (m_mode == MODE_DMR)
|
2020-11-17 15:30:59 +00:00
|
|
|
drawBitmap(0U, 0U, logo_dmr_bmp, 128U, 16U, WHITE);
|
2020-11-17 12:06:10 +00:00
|
|
|
else if (m_mode == MODE_DSTAR)
|
2020-11-17 15:30:59 +00:00
|
|
|
drawBitmap(0U, 0U, logo_dstar_bmp, 128U, 16U, WHITE);
|
2020-11-17 12:06:10 +00:00
|
|
|
else if (m_mode == MODE_YSF)
|
2020-11-17 15:30:59 +00:00
|
|
|
drawBitmap(0U, 0U, logo_fusion_bmp, 128U, 16U, WHITE);
|
2020-11-17 12:06:10 +00:00
|
|
|
else if (m_mode == MODE_P25)
|
2020-11-17 15:30:59 +00:00
|
|
|
drawBitmap(0U, 0U, logo_P25_bmp, 128U, 16U, WHITE);
|
2020-11-17 12:06:10 +00:00
|
|
|
else if (m_mode == MODE_NXDN)
|
2020-11-17 15:30:59 +00:00
|
|
|
drawBitmap(0U, 0U, logo_NXDN_bmp, 128U, 16U, WHITE);
|
2020-11-17 12:06:10 +00:00
|
|
|
else if (m_mode == MODE_M17)
|
2020-11-17 15:30:59 +00:00
|
|
|
drawBitmap(0U, 0U, logo_M17_bmp, 128U, 16U, WHITE);
|
2020-11-17 12:06:10 +00:00
|
|
|
else if (m_mode == MODE_POCSAG)
|
2020-11-17 15:30:59 +00:00
|
|
|
drawBitmap(0U, 0U, logo_POCSAG_bmp, 128U, 16U, WHITE);
|
2020-11-17 12:06:10 +00:00
|
|
|
else if (m_displayLogoScreensaver)
|
2020-11-17 15:30:59 +00:00
|
|
|
drawBitmap(0U, 0U, logo_glcd_bmp, 128U, 16U, WHITE);
|
2020-11-17 12:06:10 +00:00
|
|
|
|
|
|
|
if (m_displayScroll)
|
2020-11-17 15:30:59 +00:00
|
|
|
startscrollleft(0x00U, 0x01U);
|
|
|
|
}
|
|
|
|
|
|
|
|
// clear everything (in the buffer)
|
|
|
|
void COLED::clearDisplay()
|
|
|
|
{
|
|
|
|
::memset(m_oledBuffer, 0x00U, m_width * m_height);
|
|
|
|
}
|
|
|
|
|
|
|
|
// startscrollleft
|
|
|
|
// Activate a right handed scroll for rows start through stop
|
|
|
|
// Hint, the display is 16 rows tall. To scroll the whole display, run:
|
|
|
|
// display.scrollright(0x00U, 0x0F)
|
|
|
|
void COLED::startscrollleft(uint8_t start, uint8_t stop)
|
|
|
|
{
|
|
|
|
sendCommand(SSD_Left_Horizontal_Scroll);
|
|
|
|
sendCommand(0X00);
|
|
|
|
sendCommand(start);
|
|
|
|
sendCommand(0X00);
|
|
|
|
sendCommand(stop);
|
|
|
|
sendCommand(0X01);
|
|
|
|
sendCommand(0XFF);
|
|
|
|
sendCommand(SSD_Activate_Scroll);
|
|
|
|
}
|
|
|
|
|
|
|
|
// startscrolldiagleft
|
|
|
|
// Activate a diagonal scroll for rows start through stop
|
|
|
|
// Hint, the display is 16 rows tall. To scroll the whole display, run:
|
|
|
|
// display.scrollright(0x00U, 0x0F)
|
|
|
|
void COLED::startscrolldiagleft(uint8_t start, uint8_t stop)
|
|
|
|
{
|
|
|
|
sendCommand(SSD1306_SET_VERTICAL_SCROLL_AREA);
|
|
|
|
sendCommand(0X00);
|
|
|
|
sendCommand(m_height);
|
|
|
|
sendCommand(SSD1306_VERTICAL_AND_LEFT_HORIZONTAL_SCROLL);
|
|
|
|
sendCommand(0X00);
|
|
|
|
sendCommand(start);
|
|
|
|
sendCommand(0X00);
|
|
|
|
sendCommand(stop);
|
|
|
|
sendCommand(0X01);
|
|
|
|
sendCommand(SSD_Activate_Scroll);
|
|
|
|
}
|
|
|
|
|
|
|
|
void COLED::stopscroll(void)
|
|
|
|
{
|
|
|
|
sendCommand(SSD_Deactivate_Scroll);
|
|
|
|
}
|
|
|
|
|
|
|
|
void COLED::setBrightness(uint8_t brightness)
|
|
|
|
{
|
|
|
|
sendCommand(SSD_Set_ContrastLevel);
|
|
|
|
sendCommand(brightness);
|
|
|
|
}
|
|
|
|
|
|
|
|
void COLED::invertDisplay(bool invert)
|
|
|
|
{
|
|
|
|
if (invert)
|
|
|
|
sendCommand(SSD_Inverse_Display);
|
|
|
|
else
|
|
|
|
sendCommand(SSD1306_Normal_Display);
|
|
|
|
}
|
|
|
|
|
|
|
|
void COLED::fillRect(uint16_t x, uint16_t y, uint16_t w, uint16_t h, uint16_t color)
|
|
|
|
{
|
|
|
|
// stupidest version - update in subclasses if desired!
|
|
|
|
for (uint16_t i = x; i < x + w; i++)
|
|
|
|
drawLine(i, y, i, y + h - 1, color);
|
|
|
|
}
|
|
|
|
|
|
|
|
// bresenham's algorithm - thx wikpedia
|
|
|
|
void COLED::drawLine(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t color)
|
|
|
|
{
|
|
|
|
int16_t steep = abs(y1 - y0) > abs(x1 - x0);
|
|
|
|
|
|
|
|
if (steep) {
|
|
|
|
uint16_t temp = x0;
|
|
|
|
x0 = y0;
|
|
|
|
y0 = temp;
|
|
|
|
|
|
|
|
temp = x1;
|
|
|
|
x1 = y1;
|
|
|
|
y1 = temp;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (x0 > x1) {
|
|
|
|
uint16_t temp = x0;
|
|
|
|
x0 = x1;
|
|
|
|
x1 = temp;
|
|
|
|
|
|
|
|
temp = y0;
|
|
|
|
y0 = y1;
|
|
|
|
y1 = temp;
|
|
|
|
}
|
|
|
|
|
|
|
|
int16_t dx, dy;
|
|
|
|
dx = x1 - x0;
|
|
|
|
dy = abs(y1 - y0);
|
|
|
|
|
|
|
|
int16_t err = dx / 2;
|
|
|
|
int16_t ystep;
|
|
|
|
|
|
|
|
if (y0 < y1)
|
|
|
|
ystep = 1;
|
|
|
|
else
|
|
|
|
ystep = -1;
|
|
|
|
|
|
|
|
for (; x0 <= x1; x0++) {
|
|
|
|
if (steep)
|
|
|
|
drawPixel(y0, x0, color);
|
|
|
|
else
|
|
|
|
drawPixel(x0, y0, color);
|
|
|
|
err -= dy;
|
|
|
|
|
|
|
|
if (err < 0) {
|
|
|
|
y0 += ystep;
|
|
|
|
err += dx;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void COLED::drawBitmap(uint16_t x, uint16_t y, const uint8_t* bitmap, uint16_t w, uint16_t h, uint16_t color)
|
|
|
|
{
|
|
|
|
uint16_t byteWidth = (w + 7U) / 8U;
|
|
|
|
|
|
|
|
for (uint16_t j = 0U; j < h; j++) {
|
|
|
|
for (uint16_t i = 0U; i < w; i++) {
|
|
|
|
if (*(bitmap + j * byteWidth + i / 8) & (128 >> (i & 7)))
|
|
|
|
drawPixel(x + i, y + j, color);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// the most basic function, set a single pixel
|
|
|
|
void COLED::drawPixel(uint16_t x, uint16_t y, uint16_t color)
|
|
|
|
{
|
|
|
|
if ((x < 0) || (x >= m_width) || (y < 0) || (y >= m_height))
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (oled_type == OLED_SEEED_I2C_96x96) {
|
|
|
|
// Get where to do the change in the buffer
|
|
|
|
uint8_t* p = m_oledBuffer + (x + (y / 2) * m_width);
|
|
|
|
|
|
|
|
// Get old value to not touch the other nible
|
|
|
|
uint8_t c = *p;
|
|
|
|
|
|
|
|
// We are on High nible ?
|
|
|
|
if (((y / 2) & 1) == 1) {
|
|
|
|
c &= 0x0F;
|
|
|
|
c |= (color == WHITE ? GRAY_H : 0x00) << 4;
|
|
|
|
} else {
|
|
|
|
c &= 0xF0;
|
|
|
|
c |= (color == WHITE ? GRAY_L : 0x00);
|
|
|
|
}
|
|
|
|
|
|
|
|
// set new nible value leaving the other untouched
|
|
|
|
*p = c;
|
|
|
|
} else {
|
|
|
|
// Get where to do the change in the buffer
|
|
|
|
uint8_t* p = m_oledBuffer + (x + (y / 8) * m_width);
|
|
|
|
|
|
|
|
// x is which column
|
|
|
|
if (color == WHITE)
|
|
|
|
*p |= _BV((y % 8));
|
|
|
|
else
|
|
|
|
*p &= ~_BV((y % 8));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// the print function
|
|
|
|
void COLED::print(const char* text)
|
|
|
|
{
|
|
|
|
const char* p = text;
|
|
|
|
|
|
|
|
while (*p != 0x00U)
|
|
|
|
write(uint8_t(*p++));
|
|
|
|
}
|
|
|
|
|
|
|
|
void COLED::display(void)
|
|
|
|
{
|
|
|
|
sendCommand(SSD1306_Set_Lower_Column_Start_Address | 0x0); // low col = 0
|
|
|
|
sendCommand(SSD1306_Set_Higher_Column_Start_Address | 0x0); // hi col = 0
|
|
|
|
sendCommand(SSD1306_Set_Start_Line | 0x0); // line #0
|
|
|
|
|
|
|
|
// pointer to OLED data buffer
|
|
|
|
uint8_t* p = m_oledBuffer;
|
|
|
|
|
|
|
|
uint8_t buff[17U];
|
|
|
|
|
|
|
|
// Setup D/C to switch to data mode
|
|
|
|
buff[0] = SSD_Data_Mode;
|
|
|
|
|
|
|
|
if (oled_type == OLED_SH1106_I2C_128x64) {
|
|
|
|
for (uint8_t k = 0U; k < 8U; k++) {
|
|
|
|
sendCommand(0xB0U + k);//set page addressSSD_Data_Mode;
|
|
|
|
sendCommand(0x02U);//set lower column address
|
|
|
|
sendCommand(0x10U);//set higher column address
|
|
|
|
|
|
|
|
for (uint8_t i = 0U; i < 8U; i++) {
|
|
|
|
for (uint8_t x = 1U; x <= 16U; x++)
|
|
|
|
buff[x] = *p++;
|
|
|
|
|
2020-11-17 16:56:12 +00:00
|
|
|
m_port->write(buff, 17U);
|
2020-11-17 15:30:59 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
// loop trough all OLED buffer and
|
|
|
|
// send a bunch of 16 data byte in one xmission
|
|
|
|
for (uint16_t i = 0U; i < (m_width * m_height); i += 16U) {
|
|
|
|
for (uint8_t x = 1U; x <= 16U; x++)
|
|
|
|
buff[x] = *p++;
|
|
|
|
|
2020-11-17 16:56:12 +00:00
|
|
|
m_port->write(buff, 17U);
|
2020-11-17 15:30:59 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void COLED::sendCommand(uint8_t c)
|
|
|
|
{
|
2020-11-17 16:56:12 +00:00
|
|
|
uint8_t buff[2U];
|
2020-11-17 15:30:59 +00:00
|
|
|
|
|
|
|
// Clear D/C to switch to command mode
|
|
|
|
buff[0] = SSD_Command_Mode;
|
|
|
|
buff[1] = c;
|
|
|
|
|
|
|
|
// Write Data on I2C
|
2020-11-17 16:56:12 +00:00
|
|
|
m_port->write(buff, 2U);
|
2020-11-17 15:30:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
size_t COLED::write(uint8_t c)
|
|
|
|
{
|
|
|
|
if (c == '\n') {
|
|
|
|
m_cursorY += m_textSize * 8U;
|
|
|
|
m_cursorX = 0U;
|
|
|
|
} else if (c == '\r') {
|
|
|
|
// skip em
|
|
|
|
} else {
|
|
|
|
drawChar(m_cursorX, m_cursorY, c, m_textColor, m_textBGColor, m_textSize);
|
|
|
|
m_cursorX += m_textSize * 6U;
|
|
|
|
|
|
|
|
if (m_textWrap && (m_cursorX > (m_width - m_textSize * 6U))) {
|
|
|
|
m_cursorY += m_textSize * 8U;
|
|
|
|
m_cursorX = 0U;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// draw a character
|
|
|
|
void COLED::drawChar(uint16_t x, uint16_t y, unsigned char c, uint16_t color, uint16_t bg, uint8_t size)
|
|
|
|
{
|
|
|
|
if ((x >= m_width) || // Clip right
|
|
|
|
(y >= m_height) || // Clip bottom
|
|
|
|
((x + 5 * size - 1) < 0) || // Clip left
|
|
|
|
((y + 8 * size - 1) < 0)) // Clip top
|
|
|
|
return;
|
|
|
|
|
|
|
|
for (int8_t i = 0; i < 6; i++) {
|
|
|
|
uint8_t line;
|
|
|
|
if (i == 5)
|
|
|
|
line = 0x0;
|
|
|
|
else
|
|
|
|
line = FONT[(c * 5) + i];
|
|
|
|
|
|
|
|
for (uint8_t j = 0U; j < 8U; j++) {
|
|
|
|
if (line & 0x1) {
|
|
|
|
if (size == 1) // default size
|
|
|
|
drawPixel(x + i, y + j, color);
|
|
|
|
else // big size
|
|
|
|
fillRect(x + (i * size), y + (j * size), size, size, color);
|
|
|
|
} else if (bg != color) {
|
|
|
|
if (size == 1) // default size
|
|
|
|
drawPixel(x + i, y + j, bg);
|
|
|
|
else
|
|
|
|
// big size
|
|
|
|
fillRect(x + i * size, y + j * size, size, size, bg);
|
|
|
|
}
|
|
|
|
|
|
|
|
line >>= 1;
|
|
|
|
}
|
|
|
|
}
|
2016-05-06 23:03:39 +00:00
|
|
|
}
|