From 385a3627114686d2caadc8f2c0c80e5f04a70f55 Mon Sep 17 00:00:00 2001 From: MDC Service Date: Wed, 25 May 2022 13:10:39 +0200 Subject: added drivers in own folder --- software/drivers/board_rev_B.cpp | 117 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 software/drivers/board_rev_B.cpp (limited to 'software/drivers/board_rev_B.cpp') diff --git a/software/drivers/board_rev_B.cpp b/software/drivers/board_rev_B.cpp new file mode 100644 index 0000000..da2b00e --- /dev/null +++ b/software/drivers/board_rev_B.cpp @@ -0,0 +1,117 @@ +/* + * board_rev_B.cpp + * + * Created on: 26.02.2022 + * Author: michi + * SPDX-FileCopyrightText: 2022 MDC Service + * SPDX-License-Identifier: GPL-3.0-or-later + */ + + +#include +#include +#include +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" +#include "freertos/queue.h" +#include "driver/gpio.h" +#include "driver/i2c.h" +#include "schrank_ant_pcb.h" //contains setting of board revision + +#ifdef ESP32_BOARD_REV_B +#include "board_rev_B.hpp" + +/** + * io_init: initalize Rev. B boards + * + */ + +void io_init(void) +{ + #define GPO_BIT_MASK 0 //we dont have GPIO as outputs, all output is done via I2C Port Expander +/* as we have not ouput, leave default settings + gpio_config_t o_conf; + o_conf.intr_type = GPIO_INTR_DISABLE; + o_conf.mode = GPIO_MODE_OUTPUT; + o_conf.pin_bit_mask = GPO_BIT_MASK; + o_conf.pull_down_en = GPIO_PULLDOWN_ENABLE; + o_conf.pull_up_en = GPIO_PULLUP_DISABLE; + gpio_config(&o_conf); +*/ + //gpio_set_level((gpio_num_t) PHY_PWR, 1); + + // inputs + + #define IRQ2Esp 34 + #define I2Cext_INT 35 + #define GPI_BIT_MASK ((1ULL<