ether2ser 0.1.0
Ethernet <-> synchronous V.24 bridge firmware for RP2040 + W5500
Loading...
Searching...
No Matches
blink_cpu.c
Go to the documentation of this file.
1/*
2 * ether2ser — Ethernet ↔ synchronous V.24 (RS-232/V.28) bridge
3 *
4 * File: src/examples/blink/blink_apu.c
5 * Purpose: CPU-side helper to blink a GPIO for the blink example.
6 *
7 * SPDX-License-Identifier: Apache-2.0
8 *
9 * Copyright (c) 2026 Florian <f.leuze@outlook.de>
10 */
11
12// Related headers
13
14// Standard library headers
15#include <stdio.h>
16
17// Project Headers
18#include "hardware/pio.h"
19#include "pico/stdio.h"
20#include "pico/time.h"
21#include "pico/types.h"
22
23// Generated headers
24#include "led_blink.pio.h"
25
26void start_cpu_led_blink(uint pin)
27{
28 gpio_init(pin);
29 gpio_set_dir(pin, GPIO_OUT);
30
31 bool on = false;
32 while (true)
33 {
34 on = !on;
35 gpio_put(pin, on);
36 printf("tick: led=%d\r\n", on ? 1 : 0);
37 sleep_ms(500);
38 }
39}