<commit_before>"""ILI9325 chip driver"""
import time
from gfxlcd.drawing.area import Area
from gfxlcd.abstract.chip import Chip


class ILI9325(Area, Chip):
    """Class for ILI9325 based LCD"""
    rotations = {
        0: {
            'output': 0x0100,
            'mode': 0x1030,
            'output2': 0xa700
        },
        90: {
            'output': 0x0000,
            'mode': 0x1038,
            'output2': 0xa700
        },
        180: {
            'output': 0x0000,
            'mode': 0x1030,
            'output2': 0x2700
        },
        270: {
            'output': 0x0100,
            'mode': 0x1038,
            'output2': 0x2700
        }
    }

    def __init__(self, width, height, driver):
        Chip.__init__(self, width, height, driver, True)
        Area.__init__(self, driver)
        self.rotation = 270

    def _converted_background_color(self):
        """color from 8-8-8 to 5-6-5"""
        rgb = self.options['background_color']['R'] << 16 | \
            self.options['background_color']['G'] << 8 | \
            self.options['background_color']['B']
        return ((rgb & 0x00f80000) >> 8) |\
            ((rgb & 0x0000fc00) >> 5) | ((rgb & 0x000000f8) >> 3)

    def _converted_color(self):
        """color from 8-8-8 to 5-6-5"""
        rgb = self.options['color']['R'] << 16 | \
            self.options['color']['G'] << 8 | \
            self.options['color']['B']
        return ((rgb & 0x00f80000) >> 8) |\
            ((rgb & 0x0000fc00) >> 5) | ((rgb & 0x000000f8) >> 3)

    def init(self):
        """init display"""
        self.driver.init()
        Area.init(self)
        Chip.init(self)
        self.driver.reset()
<commit_msg>default rotation 0<commit_after>"""ILI9325 chip driver"""
import time
from gfxlcd.drawing.area import Area
from gfxlcd.abstract.chip import Chip


class ILI9325(Area, Chip):
    """Class for ILI9325 based LCD"""
    rotations = {
        0: {
            'output': 0x0100,
            'mode': 0x1030,
            'output2': 0xa700
        },
        90: {
            'output': 0x0000,
            'mode': 0x1038,
            'output2': 0xa700
        },
        180: {
            'output': 0x0000,
            'mode': 0x1030,
            'output2': 0x2700
        },
        270: {
            'output': 0x0100,
            'mode': 0x1038,
            'output2': 0x2700
        }
    }

    def __init__(self, width, height, driver):
        Chip.__init__(self, width, height, driver, True)
        Area.__init__(self, driver)
        self.rotation = 0

    def _converted_background_color(self):
        """color from 8-8-8 to 5-6-5"""
        rgb = self.options['background_color']['R'] << 16 | \
            self.options['background_color']['G'] << 8 | \
            self.options['background_color']['B']
        return ((rgb & 0x00f80000) >> 8) |\
            ((rgb & 0x0000fc00) >> 5) | ((rgb & 0x000000f8) >> 3)

    def _converted_color(self):
        """color from 8-8-8 to 5-6-5"""
        rgb = self.options['color']['R'] << 16 | \
            self.options['color']['G'] << 8 | \
            self.options['color']['B']
        return ((rgb & 0x00f80000) >> 8) |\
            ((rgb & 0x0000fc00) >> 5) | ((rgb & 0x000000f8) >> 3)

    def init(self):
        """init display"""
        self.driver.init()
        Area.init(self)
        Chip.init(self)
        self.driver.reset()

{'fraction_non_alphanumeric': 0.16149068322981366, 'fraction_numerical': 0.0919846199349305, 'mean_word_length': 1.72522159548751, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2247504', 'n_tokens_mistral': 1326, 'n_tokens_neox': 1094, 'n_words': 238}