ESP32 Register Programming
Posted: Fri Apr 25, 2025 8:16 am
Hey Guys,
im new to ESP32 Programming, i have knowledge in Atmega328p programming on register level. So now i want to programm the ESP32 on register level, but the technical reference is not that easy to read and follow.
I have written some code for ESP32 so activate the ESP32 permanently, but the code wont work, maybe you could help me. What have i done wrong?
#include "soc/gpio_reg.h"
#include "soc/io_mux_reg.h"
#include "driver/gpio.h"
#include <stdio.h>
void app_main(void){
REG_WRITE(GPIO_FUNC16_OUT_SEL_CFG_REG, (1 << GPIO_FUNC16_OEN_SEL)); // Das ist der richtige Shift-Wert
// Aktiviere GPIO16 als Ausgang
REG_WRITE(GPIO_ENABLE_REG, (1 << 16));
// Setze GPIO16 auf HIGH
REG_WRITE(GPIO_OUT_REG, (1 << 16));
}
im new to ESP32 Programming, i have knowledge in Atmega328p programming on register level. So now i want to programm the ESP32 on register level, but the technical reference is not that easy to read and follow.
I have written some code for ESP32 so activate the ESP32 permanently, but the code wont work, maybe you could help me. What have i done wrong?
#include "soc/gpio_reg.h"
#include "soc/io_mux_reg.h"
#include "driver/gpio.h"
#include <stdio.h>
void app_main(void){
REG_WRITE(GPIO_FUNC16_OUT_SEL_CFG_REG, (1 << GPIO_FUNC16_OEN_SEL)); // Das ist der richtige Shift-Wert
// Aktiviere GPIO16 als Ausgang
REG_WRITE(GPIO_ENABLE_REG, (1 << 16));
// Setze GPIO16 auf HIGH
REG_WRITE(GPIO_OUT_REG, (1 << 16));
}