Skip to content
Snippets Groups Projects
Select Git revision
  • d98cabbf54ac579c1dd85a1cc34bf5af2baee3f9
  • master default protected
  • font-fix
  • schneider/ble-stability-new-phy-adv
  • schneider/ble-stability
  • genofire/ble-follow-py
  • msgctl/gfx_rle
  • schneider/ble-stability-new-phy
  • add_menu_vibration
  • plaetzchen/ios-workaround
  • blinkisync-as-preload
  • schneider/max30001-pycardium
  • schneider/max30001-epicaridum
  • schneider/max30001
  • schneider/stream-locks
  • schneider/fundamental-test
  • schneider/ble-buffers
  • schneider/maxim-sdk-update
  • ch3/splashscreen
  • koalo/bhi160-works-but-dirty
  • koalo/wip/i2c-for-python
  • v1.11
  • v1.10
  • v1.9
  • v1.8
  • v1.7
  • v1.6
  • v1.5
  • v1.4
  • v1.3
  • v1.2
  • v1.1
  • v1.0
  • release-1
  • bootloader-v1
  • v0.0
36 results

sleep.c

Blame
  • Forked from card10 / firmware
    Source project has a limited visibility.
    leds.pyi 3.06 KiB
    from typing import Tuple
    
    """
    Leds API.
    
    Index starts above USB-C port and increments clockwise.
    
    There are 8 LEDs per top petal, or 4 LEDs per petal.
    
    After you're ready setting up your blink, call update(), or enable autoupdates.
    """
    
    def set_slew_rate(b: int) -> None:
        """
        Set maximum change rate of channel brightness. Set to 255 to disable.
        Takes the edge off at around 200, mellows things at 150, gets slow at 100,
        takes its time at 50, molasses at 0. Default 235.
        """
    
    def get_slew_rate() -> int:
        """
        Get maximum change rate of brightness. See set_slew_rate()
        """
    
    def get_steady() -> bool:
        """
        Returns true if the LED engine is certain that there is no further color change
        until user input occurs, meaning that the last animation has finished and there
        is no unprocessed data is queued up. The LED task consumes data at 50Hz.
    
        If you use this function to time next animation frames be sure to set a maximum
        rate so that users with a high slew rate setting will not get strobelighted!
        """
    
    def set_rgb(i: int, r: float, g: float, b: float) -> None:
        """Set LED i to rgb value r, g, b
    
        :param i: LED index, from 0 to 39
        :param r: Red value, from 0.0 to 1.0
        :param g: Green value, from 0.0 to 1.0
        :param b: Blue value, from 0.0 to 1.0
        """
    
    def get_rgb(i: int) -> Tuple[float, float, float]:
        """Get rgb tuple of LED i
    
        :param i: LED index, from 0 to 39
        """
    
    def set_all_rgb(r: float, g: float, b: float) -> None:
        """Set all LEDs to rgb value r, g, b
    
        :param r: Red value, from 0.0 to 1.0
        :param g: Green value, from 0.0 to 1.0
        :param b: Blue value, from 0.0 to 1.0
        """
    
    def set_rgba(ix: int, r: float, g: float, b: float, a: float) -> None:
        """Set LED i to rgb alpha value r, g, b, a
    
        :param ix: LED index, from 0 to 39
        :param r: Red value, from 0.0 to 1.0
        :param g: Green value, from 0.0 to 1.0
        :param b: Blue value, from 0.0 to 1.0
        :param a: Alpha value, from 0.0 to 1.0
        """
    
    def set_all_rgba(r: float, g: float, b: float, a: float) -> None:
        """Set all LEDs to rgb alpha value r, g, b, a
    
        :param r: Red value, from 0.0 to 1.0
        :param g: Green value, from 0.0 to 1.0
        :param b: Blue value, from 0.0 to 1.0
        :param a: Alpha value, from 0.0 to 1.0
        """
    
    def update() -> None:
        """
        Update LEDs. Ie., copy the LED state from the first buffer into the second
        buffer, effectively scheduling the LED state to be presented to the user.
        """
    
    def set_brightness(b: int) -> None:
        """
        Set global LED brightness, 0-255. Default 70.
    
        Only affects the LEDs after update(), or if autoupdate is enabled.
        """
    
    def get_brightness() -> int:
        """
        Returns global LED brightness, 0-255. Default 70.
        """
    
    def set_auto_update(on: bool) -> None:
        """
        Make update() be periodically called by the background task for slew rate
        animation when set to 1. This adds user changes immediately. Useful with
        low slew rates.
        """
    
    def get_auto_update() -> bool:
        """
        Returns whether auto updates are on. See set_auto_update()
        """