remove A LOT of dead ASF lcd driver code

This commit is contained in:
Joey Castillo 2021-12-02 22:50:47 -05:00
parent 25d54101b1
commit b8c824419f
4 changed files with 0 additions and 2750 deletions

File diff suppressed because it is too large Load diff

View file

@ -35,8 +35,6 @@
#include <utils_assert.h>
#include <hpl_slcd_sync.h>
#include <hpl_slcd_config.h>
#include <hpl_slcd_cm_7_seg_mapping.h>
#include <hpl_slcd_cm_14_seg_mapping.h>
static int32_t _slcd_sync_set_segment(struct _slcd_sync_device *dev, const uint32_t com, const uint32_t seg,
const bool on);
@ -62,9 +60,6 @@ static struct slcd_configuration _slcd
CONF_SLCD_BBEN << SLCD_CTRLB_BBEN_Pos | SLCD_CTRLB_BBD(CONF_SLCD_BBD - 1),
SLCD_CTRLC_CTST(CONF_SLCD_CONTRAST_ADJUST),
SLCD_CTRLD_DISPEN};
static const struct slcd_char_setting cm_setting[] = SLCD_CHAR_SETTING_TABLE;
static const struct slcd_char_mapping cm7_lut[] = SLCD_SEG7_LUT;
static const struct slcd_char_mapping cm14_lut[] = SLCD_SEG14_LUT;
/**
* \brief Initialize SLCD Device Descriptor
*/
@ -200,48 +195,6 @@ int32_t _slcd_sync_seg_blink(struct _slcd_sync_device *dev, uint32_t seg, const
return ERR_NONE;
}
/**
* \brief Displays a character
*/
int32_t _slcd_sync_write_char(struct _slcd_sync_device *dev, const uint8_t character, uint32_t index)
{
uint32_t i;
uint32_t data = ~0;
if (cm_setting[index].size == 7) {
for (i = 0; i<sizeof(cm7_lut)>> 2; i++) {
if (cm7_lut[i].character == character) {
data = cm7_lut[i].mapping;
break;
}
}
} else if (cm_setting[index].size == 14) {
for (i = 0; i<sizeof(cm14_lut)>> 2; i++) {
if (cm14_lut[i].character == character) {
data = cm14_lut[i].mapping;
break;
}
}
}
if (data == 0xFFFFFFFF) {
return ERR_INVALID_ARG;
}
hri_slcd_write_CMCFG_NSEG_bf(dev->hw, cm_setting[index].nseg);
hri_slcd_write_CMINDEX_CINDEX_bf(dev->hw, cm_setting[index].com_index);
hri_slcd_write_CMINDEX_SINDEX_bf(dev->hw, cm_setting[index].seg_index);
if (cm_setting[index].size == 7) {
hri_slcd_write_CMDMASK_reg(dev->hw, SEG7_MASK);
} else if (cm_setting[index].size == 14) {
hri_slcd_write_CMDMASK_reg(dev->hw, SEG14_MASK);
}
while (hri_slcd_get_STATUS_CMWRBUSY_bit(dev->hw))
;
hri_slcd_write_CMDATA_reg(dev->hw, data);
return ERR_NONE;
}
/**
* \brief Start animation play by a segment array
*/

View file

@ -1,104 +0,0 @@
#include <hpl_slcd_config.h>
/**
* character segments position index
*
* For a 14-segments character, each segment has an unique position index.
* The segment layout and position index value is shown as below.
* The symbol '-', '|', '/', '\' represent the SLCD character segment, and the
* number represent each segment's position index, which equals to macro
* SEG14_0 to SEG14_7.
* The character lookup mapping table use those position index
* (SEG14_0..SEG14_14) to compose some visible arabic numerals, letters or some
* specific ASCII.
* For example char '1' can be represented by use position index 1,2.
* (SEG7_1 | SEG7_2).
* More predefined character lookup can be found at below "14-segment character
* lookup mapping table"
*
* -0
* |5 \6 |7 /8 |1
* -9 -10
* |4 /11 |12 \13 |2
* -3
*/
/**
* Character segment position remapping setting
*
* An SLCD screen typically use several hardware segments to display a
* character(for example from COM3/SEG0 to COM4/SEG7).
* The lowest COM and SEG index is 0 (COM3/SEG0 index is 0).
* The "hardware character segments index" maybe different with the "character
* segments position index". The remapping setting allow application to adjust
* those sequence.
*
*/
#define SEG14_0 (0x1 << CONF_SLCD_CM_14SEGS_0_SETTING)
#define SEG14_1 (0x1 << CONF_SLCD_CM_14SEGS_1_SETTING)
#define SEG14_2 (0x1 << CONF_SLCD_CM_14SEGS_2_SETTING)
#define SEG14_3 (0x1 << CONF_SLCD_CM_14SEGS_3_SETTING)
#define SEG14_4 (0x1 << CONF_SLCD_CM_14SEGS_4_SETTING)
#define SEG14_5 (0x1 << CONF_SLCD_CM_14SEGS_5_SETTING)
#define SEG14_6 (0x1 << CONF_SLCD_CM_14SEGS_6_SETTING)
#define SEG14_7 (0x1 << CONF_SLCD_CM_14SEGS_7_SETTING)
#define SEG14_8 (0x1 << CONF_SLCD_CM_14SEGS_8_SETTING)
#define SEG14_9 (0x1 << CONF_SLCD_CM_14SEGS_9_SETTING)
#define SEG14_10 (0x1 << CONF_SLCD_CM_14SEGS_10_SETTING)
#define SEG14_11 (0x1 << CONF_SLCD_CM_14SEGS_11_SETTING)
#define SEG14_12 (0x1 << CONF_SLCD_CM_14SEGS_12_SETTING)
#define SEG14_13 (0x1 << CONF_SLCD_CM_14SEGS_13_SETTING)
/**
* 17-segments character mask value
*/
#define SEG14_MASK \
(0xFFFFFF \
& ~(SEG14_0 | SEG14_1 | SEG14_2 | SEG14_3 | SEG14_4 | SEG14_5 | SEG14_6 | SEG14_7 | SEG14_8 | SEG14_9 | SEG14_10 \
| SEG14_11 | SEG14_12 | SEG14_13))
/**
* 14-segment character lookup mapping table
* struct slcd_char_mapping;
*/
#define SLCD_SEG14_LUT \
{ \
{'0', SEG14_0 | SEG14_1 | SEG14_2 | SEG14_3 | SEG14_4 | SEG14_5 | SEG14_8 | SEG14_11}, \
{'1', SEG14_1 | SEG14_2}, {'2', SEG14_0 | SEG14_1 | SEG14_3 | SEG14_4 | SEG14_9 | SEG14_10}, \
{'3', SEG14_0 | SEG14_1 | SEG14_2 | SEG14_3 | SEG14_9 | SEG14_10}, \
{'4', SEG14_1 | SEG14_2 | SEG14_5 | SEG14_9 | SEG14_10}, \
{'5', SEG14_0 | SEG14_2 | SEG14_3 | SEG14_5 | SEG14_9 | SEG14_10}, \
{'6', SEG14_0 | SEG14_2 | SEG14_3 | SEG14_4 | SEG14_5 | SEG14_9 | SEG14_10}, \
{'7', SEG14_0 | SEG14_1 | SEG14_2}, \
{'8', SEG14_0 | SEG14_1 | SEG14_2 | SEG14_3 | SEG14_4 | SEG14_5 | SEG14_9 | SEG14_10}, \
{'9', SEG14_0 | SEG14_1 | SEG14_2 | SEG14_3 | SEG14_5 | SEG14_9 | SEG14_10}, \
{'a', SEG14_0 | SEG14_1 | SEG14_2 | SEG14_4 | SEG14_5 | SEG14_9 | SEG14_10}, \
{'b', SEG14_0 | SEG14_1 | SEG14_2 | SEG14_3 | SEG14_7 | SEG14_10 | SEG14_12}, \
{'c', SEG14_0 | SEG14_3 | SEG14_4 | SEG14_5}, \
{'d', SEG14_0 | SEG14_1 | SEG14_2 | SEG14_3 | SEG14_7 | SEG14_12}, \
{'e', SEG14_0 | SEG14_3 | SEG14_4 | SEG14_5 | SEG14_9 | SEG14_10}, \
{'f', SEG14_0 | SEG14_4 | SEG14_5 | SEG14_9 | SEG14_10}, \
{'g', SEG14_0 | SEG14_2 | SEG14_3 | SEG14_4 | SEG14_5 | SEG14_10}, \
{'h', SEG14_1 | SEG14_2 | SEG14_4 | SEG14_5 | SEG14_9 | SEG14_10}, \
{'i', SEG14_1 | SEG14_2 | SEG14_4 | SEG14_5 | SEG14_9 | SEG14_10}, \
{'j', SEG14_1 | SEG14_2 | SEG14_3 | SEG14_4}, {'k', SEG14_4 | SEG14_5 | SEG14_8 | SEG14_9 | SEG14_13}, \
{'l', SEG14_3 | SEG14_4 | SEG14_5}, {'m', SEG14_1 | SEG14_2 | SEG14_4 | SEG14_5 | SEG14_6 | SEG14_8}, \
{'n', SEG14_1 | SEG14_2 | SEG14_4 | SEG14_5 | SEG14_6 | SEG14_13}, \
{'o', SEG14_0 | SEG14_1 | SEG14_2 | SEG14_3 | SEG14_4 | SEG14_5}, \
{'p', SEG14_0 | SEG14_1 | SEG14_4 | SEG14_5 | SEG14_9 | SEG14_10}, \
{'q', SEG14_0 | SEG14_1 | SEG14_2 | SEG14_3 | SEG14_4 | SEG14_5 | SEG14_13}, \
{'r', SEG14_0 | SEG14_1 | SEG14_4 | SEG14_5 | SEG14_9 | SEG14_10 | SEG14_13}, \
{'s', SEG14_0 | SEG14_3 | SEG14_5 | SEG14_9 | SEG14_13}, {'t', SEG14_0 | SEG14_7 | SEG14_12}, \
{'u', SEG14_1 | SEG14_2 | SEG14_3 | SEG14_4 | SEG14_5}, {'v', SEG14_4 | SEG14_5 | SEG14_8 | SEG14_11}, \
{'w', SEG14_1 | SEG14_2 | SEG14_4 | SEG14_5 | SEG14_11 | SEG14_13}, \
{'x', SEG14_6 | SEG14_8 | SEG14_11 | SEG14_13}, \
{'y', SEG14_1 | SEG14_2 | SEG14_3 | SEG14_5 | SEG14_9 | SEG14_10}, \
{'z', SEG14_0 | SEG14_3 | SEG14_8 | SEG14_11}, {'-', SEG14_9 | SEG14_10}, \
{'+', SEG14_7 | SEG14_9 | SEG14_10 | SEG14_12}, {'/', SEG14_8 | SEG14_11}, \
{'=', SEG14_3 | SEG14_9 | SEG14_10}, \
{'#', SEG14_1 | SEG14_2 | SEG14_3 | SEG14_7 | SEG14_9 | SEG14_10 | SEG14_12}, \
{'*', SEG14_6 | SEG14_8 | SEG14_11 | SEG14_13}, {'\'', SEG14_13}, {')', SEG14_6 | SEG14_11}, \
{'(', SEG14_8 | SEG14_13}, {'@', SEG14_0 | SEG14_1 | SEG14_2 | SEG14_3 | SEG14_4 | SEG14_9 | SEG14_13}, \
{'$', SEG14_0 | SEG14_2 | SEG14_3 | SEG14_5 | SEG14_7 | SEG14_9 | SEG14_10 | SEG14_12}, \
{'%', SEG14_2 | SEG14_5 | SEG14_8 | SEG14_11}, {'\\', SEG14_6 | SEG14_13}, {'_', SEG14_3}, {0, 0}, \
}

View file

@ -1,68 +0,0 @@
#include <hpl_slcd_config.h>
/**
* character segments position index
*
* For a 7 segments character, each segment has an unique position index.
* The segment layout and position index value is shown as below.
* The symbol '-', '|' represent the SLCD character segment, and the
* number represent each segment's position index, which equals to macro
* SEG7_0 to SEG7_7.
* The character lookup mapping table use those position index (SEG7_0..SEG7_7)
* to compose some visible arabic numerals, letters or some specific ASCII.
* For example char '0' can be represented by use position index 0,1,2,3,4,5.
* (SEG7_0 | SEG7_1 | SEG7_2 | SEG7_3 | SEG7_4 | SEG7_5).
* More predefined character lookup can be found at below "7-segments character
* lookup mapping table"
* -0
* |5 |1
* -6
* |4 |2
* -3
*/
/**
* Character segment position remapping setting
*
* An SLCD screen typically use several hardware segments to display a
* character(for example from COM3/SEG0 to COM3/SEG7).
* The lowest COM and SEG index is 0 (COM3/SEG0 index is 0).
* The "hardware character segments index" maybe different with the "character
* segments position index". The remapping setting allow application to adjust
* those sequence.
*
*/
#define SEG7_0 (0x1 << CONF_SLCD_CM_7SEGS_0_SETTING)
#define SEG7_1 (0x1 << CONF_SLCD_CM_7SEGS_1_SETTING)
#define SEG7_2 (0x1 << CONF_SLCD_CM_7SEGS_2_SETTING)
#define SEG7_3 (0x1 << CONF_SLCD_CM_7SEGS_3_SETTING)
#define SEG7_4 (0x1 << CONF_SLCD_CM_7SEGS_4_SETTING)
#define SEG7_5 (0x1 << CONF_SLCD_CM_7SEGS_5_SETTING)
#define SEG7_6 (0x1 << CONF_SLCD_CM_7SEGS_6_SETTING)
/**
* 7-segments character mask value
*/
#define SEG7_MASK (0xFFFFFF & ~(SEG7_0 | SEG7_1 | SEG7_2 | SEG7_3 | SEG7_4 | SEG7_5 | SEG7_6))
/**
* 7-segments character lookup mapping table.
*
* Array value of slcd_char_mapping struct, application can add or remove
* item from it.
*/
#define SLCD_SEG7_LUT \
{ \
{0, 0}, {'0', SEG7_0 | SEG7_1 | SEG7_2 | SEG7_3 | SEG7_4 | SEG7_5}, {'1', SEG7_1 | SEG7_2}, \
{'2', SEG7_0 | SEG7_1 | SEG7_3 | SEG7_4 | SEG7_6}, {'3', SEG7_0 | SEG7_1 | SEG7_2 | SEG7_3 | SEG7_6}, \
{'4', SEG7_1 | SEG7_2 | SEG7_5 | SEG7_6}, {'5', SEG7_0 | SEG7_2 | SEG7_3 | SEG7_5 | SEG7_6}, \
{'6', SEG7_0 | SEG7_2 | SEG7_3 | SEG7_4 | SEG7_5 | SEG7_6}, {'7', SEG7_0 | SEG7_1 | SEG7_2}, \
{'8', SEG7_0 | SEG7_1 | SEG7_2 | SEG7_3 | SEG7_4 | SEG7_5 | SEG7_6}, \
{'9', SEG7_0 | SEG7_1 | SEG7_2 | SEG7_5 | SEG7_6}, \
{'a', SEG7_0 | SEG7_1 | SEG7_2 | SEG7_4 | SEG7_5 | SEG7_6}, \
{'b', SEG7_2 | SEG7_3 | SEG7_4 | SEG7_5 | SEG7_6}, {'c', SEG7_0 | SEG7_3 | SEG7_4 | SEG7_5}, \
{'d', SEG7_1 | SEG7_2 | SEG7_3 | SEG7_4 | SEG7_6}, {'e', SEG7_0 | SEG7_3 | SEG7_4 | SEG7_5 | SEG7_6}, \
{ \
'f', SEG7_0 | SEG7_4 | SEG7_5 | SEG7_6 \
} \
}