view_direct_sampling.c 846 B

123456789101112131415161718192021222324252627
  1. /* Copyright (C) 2022-2023 Salvatore Sanfilippo -- All Rights Reserved
  2. * See the LICENSE file for information about the license. */
  3. #include "app.h"
  4. #include <cc1101.h>
  5. /* Read directly from the G0 CC1101 pin, and draw a black or white
  6. * dot depending on the level. */
  7. void render_view_direct_sampling(Canvas *const canvas, ProtoViewApp *app) {
  8. UNUSED(app);
  9. for (int y = 0; y < 64; y++) {
  10. for (int x = 0; x < 128; x++) {
  11. bool level = furi_hal_gpio_read(&gpio_cc1101_g0);
  12. if (level) canvas_draw_dot(canvas,x,y);
  13. }
  14. }
  15. canvas_set_font(canvas, FontSecondary);
  16. canvas_draw_str_with_border(canvas,40,60,"Direct sampling",
  17. ColorWhite,ColorBlack);
  18. }
  19. /* Handle input */
  20. void process_input_direct_sampling(ProtoViewApp *app, InputEvent input) {
  21. UNUSED(app);
  22. UNUSED(input);
  23. }