reference.rst 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. Reference
  2. =========
  3. This page contains the API documentation of the ``flipperzero`` module and some built-in functions.
  4. Vibration
  5. ---------
  6. Control the vibration motor of your Flipper.
  7. .. autofunction:: flipperzero.vibro_set
  8. Light
  9. -----
  10. Control the RGB LED and display backlight of your Flipper.
  11. .. autodata:: flipperzero.LIGHT_RED
  12. .. autodata:: flipperzero.LIGHT_GREEN
  13. .. autodata:: flipperzero.LIGHT_BLUE
  14. .. autodata:: flipperzero.LIGHT_BACKLIGHT
  15. .. autofunction:: flipperzero.light_set
  16. .. autofunction:: flipperzero.light_blink_start
  17. .. autofunction:: flipperzero.light_blink_set_color
  18. .. autofunction:: flipperzero.light_blink_stop
  19. Speaker
  20. -------
  21. Full control over the built-in speaker module.
  22. .. autofunction:: flipperzero.speaker_start
  23. .. autofunction:: flipperzero.speaker_set_volume
  24. .. autofunction:: flipperzero.speaker_stop
  25. Input
  26. -----
  27. Make your application interactive with full control over the Flipper's hardware buttons.
  28. .. autodata:: flipperzero.INPUT_BUTTON_UP
  29. .. autodata:: flipperzero.INPUT_BUTTON_DOWN
  30. .. autodata:: flipperzero.INPUT_BUTTON_RIGHT
  31. .. autodata:: flipperzero.INPUT_BUTTON_LEFT
  32. .. autodata:: flipperzero.INPUT_BUTTON_OK
  33. .. autodata:: flipperzero.INPUT_BUTTON_BACK
  34. .. autodata:: flipperzero.INPUT_TYPE_PRESS
  35. .. autodata:: flipperzero.INPUT_TYPE_RELEASE
  36. .. autodata:: flipperzero.INPUT_TYPE_SHORT
  37. .. autodata:: flipperzero.INPUT_TYPE_LONG
  38. .. autodata:: flipperzero.INPUT_TYPE_REPEAT
  39. .. autodecorator:: flipperzero.on_input
  40. Canvas
  41. ------
  42. Write text and draw dots and shapes on the the display.
  43. .. autofunction:: flipperzero.canvas_update
  44. .. autofunction:: flipperzero.canvas_clear
  45. .. autofunction:: flipperzero.canvas_width
  46. .. autofunction:: flipperzero.canvas_height
  47. .. autodata:: flipperzero.COLOR_BLACK
  48. .. autodata:: flipperzero.COLOR_WHITE
  49. .. autofunction:: flipperzero.canvas_set_color
  50. .. autodata:: flipperzero.ALIGN_BEGIN
  51. .. autodata:: flipperzero.ALIGN_END
  52. .. autodata:: flipperzero.ALIGN_CENTER
  53. .. autofunction:: flipperzero.canvas_set_text_align
  54. .. autodata:: flipperzero.FONT_PRIMARY
  55. .. autodata:: flipperzero.FONT_SECONDARY
  56. .. autofunction:: flipperzero.canvas_set_font
  57. .. autofunction:: flipperzero.canvas_set_text
  58. .. autofunction:: flipperzero.canvas_draw_dot
  59. .. autofunction:: flipperzero.canvas_draw_box
  60. .. autofunction:: flipperzero.canvas_draw_frame
  61. .. autofunction:: flipperzero.canvas_draw_line
  62. .. autofunction:: flipperzero.canvas_draw_circle
  63. .. autofunction:: flipperzero.canvas_draw_disc
  64. Dialog
  65. ------
  66. Display message dialogs on the display for user infos and confirm actions.
  67. .. autofunction:: flipperzero.dialog_message_set_header
  68. .. autofunction:: flipperzero.dialog_message_set_text
  69. .. autofunction:: flipperzero.dialog_message_set_button
  70. Built-In
  71. --------
  72. The functions in this section are `not` part of the ``flipperzero`` module.
  73. They're members of the global namespace instead.
  74. .. py:function:: print(*objects, sep=' ', end='\n', file=None, flush=False) -> None
  75. The standard Python `print <https://docs.python.org/3/library/functions.html#print>`_ function.
  76. :param objects: The objects to print (mostly a single string).
  77. :param sep: The separator to use between the objects.
  78. :param end: The line terminator character to use.
  79. .. attention::
  80. This function prints to the internal log buffer.
  81. Check out the `Flipper Zero docs <https://docs.flipper.net/development/cli#_yZ2E>`_ on how to reveal them in the CLI interface.