void gpio_set(int on) = (1 << 5); else data &= ~(1 << 5); (volatile unsigned int )GPIO_DATA = data;
void gpio_init() = (1 << 5); (volatile unsigned int )GPIO_DIR = dir; bcm63381b0 firmware
// minimal.c - for BCM63381B0 bare-metal (CFE environment) #include <stdio.h> #include <cfe_api.h> // GPIO base address - you need BCM63381 datasheet for exact address #define GPIO_BASE 0x18000000 // example only, not real #define GPIO_DIR (GPIO_BASE + 0x00) #define GPIO_DATA (GPIO_BASE + 0x08) void gpio_set(int on) = (1 << 5); else
Example: a minimal C program to blink an LED via GPIO. void gpio_set(int on) = (1 <
CFE> load -raw -addr=0x80800000 minimal.bin CFE> go 0x80800000 If you want to develop a full router firmware , use OpenWrt (supports many BCM63xx chips).
gpio-leds compatible = "gpio-leds"; led_power label = "power"; gpios = <&gpio0 5 GPIO_ACTIVE_HIGH>; ; ; ;