Skip to content

Instantly share code, notes, and snippets.

@rahuldeo2047
Created October 18, 2017 18:45
Show Gist options
  • Save rahuldeo2047/72111a3385af0e985020a0492c183774 to your computer and use it in GitHub Desktop.
Save rahuldeo2047/72111a3385af0e985020a0492c183774 to your computer and use it in GitHub Desktop.
Files for special untracked changes
// This file should be pasted in
// /home/<user>/.platformio/packages/framework-simba/src/boards/esp12e
/**
* @section License
*
* The MIT License (MIT)
*
* Copyright (c) 2014-2017, Erik Moqvist
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use, copy,
* modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* This file is part of the Simba project.
*/
#ifndef __BOARD_H__
#define __BOARD_H__
#define pin_gpio0_dev pin_device[0]
#define pin_gpio2_dev pin_device[2]
#define pin_gpio4_dev pin_device[5]
#define pin_gpio5_dev pin_device[4]
#define pin_gpio12_dev pin_device[12]
#define pin_gpio13_dev pin_device[13]
#define pin_gpio14_dev pin_device[14]
#define pin_gpio15_dev pin_device[15]
#define pin_gpio16_dev pin_device[16]
#define pin_d0_dev pin_device[0]
#define pin_d2_dev pin_device[2]
#define pin_d4_dev pin_device[5]
#define pin_d5_dev pin_device[4]
#define pin_d12_dev pin_device[12]
#define pin_d13_dev pin_device[13]
#define pin_d14_dev pin_device[14]
#define pin_d15_dev pin_device[15]
#define pin_d16_dev pin_device[16]
// board: d1_mini : start
// gpio
#define pin_D3_dev pin_device[0]
#define pin_D4_dev pin_device[2]
#define pin_D2_dev pin_device[4]
#define pin_D1_dev pin_device[5]
#define pin_D6_dev pin_device[12]
#define pin_D7_dev pin_device[13]
#define pin_D5_dev pin_device[14]
#define pin_D8_dev pin_device[15]
#define pin_D0_dev pin_device[16]
// interrupt
#define exti_D3_dev exti_device[0]
#define exti_D4_dev exti_device[2]
#define exti_D2_dev exti_device[4]
#define exti_D1_dev exti_device[5]
#define exti_D6_dev exti_device[12]
#define exti_D7_dev exti_device[13]
#define exti_D5_dev exti_device[14]
#define exti_D8_dev exti_device[15]
#define exti_D0_dev exti_device[16]
// board: d1_mini : end
#define exti_d0_dev exti_device[0]
//#define exti_d1_dev exti_device[1]
#define exti_d2_dev exti_device[2]
//#define exti_d3_dev exti_device[3]
#define exti_d4_dev exti_device[4]
#define exti_d5_dev exti_device[5]
//#define exti_d6_dev exti_device[6]
//#define exti_d7_dev exti_device[7]
//#define exti_d8_dev exti_device[8]
//#define exti_d9_dev exti_device[9]
//#define exti_d10_dev exti_device[10]
//#define exti_d11_dev exti_device[11]
#define exti_d12_dev exti_device[12]
#define exti_d13_dev exti_device[13]
#define exti_d14_dev exti_device[14]
#define exti_d15_dev exti_device[15]
//#define exti_d16_dev exti_device[16] // ?
#define pin_led_dev pin_d2_dev
#define pin_a0_dev pin_device[0]
#define adc_0_dev adc_device[0]
#define i2c_0_dev i2c_device[0]
#define i2c_1_dev i2c_device[1]
#define flash_0_dev flash_device[0]
#define ADC_PINS_MAX 1
/**
* Convert given pin string to the pin number.
*
* @param[in] str_p Pin as a string.
*
* @return Pin number or negative error code.
*/
int board_pin_string_to_device_index(const char *str_p);
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment