Fork of my original MQTTGateway

Dependencies:   mbed-http

Committer:
vpcola
Date:
Sat Apr 08 14:43:14 2017 +0000
Revision:
0:a1734fe1ec4b
Initial commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
vpcola 0:a1734fe1ec4b 1 /**
vpcola 0:a1734fe1ec4b 2 ******************************************************************************
vpcola 0:a1734fe1ec4b 3 * @file hw-config.h
vpcola 0:a1734fe1ec4b 4 * @author System LAB
vpcola 0:a1734fe1ec4b 5 * @version V1.0.0
vpcola 0:a1734fe1ec4b 6 * @date 17-May-2015
vpcola 0:a1734fe1ec4b 7 * @brief Header file for Hardware Configuration & Setup
vpcola 0:a1734fe1ec4b 8 ******************************************************************************
vpcola 0:a1734fe1ec4b 9 * @attention
vpcola 0:a1734fe1ec4b 10 *
vpcola 0:a1734fe1ec4b 11 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
vpcola 0:a1734fe1ec4b 12 *
vpcola 0:a1734fe1ec4b 13 * Redistribution and use in source and binary forms, with or without modification,
vpcola 0:a1734fe1ec4b 14 * are permitted provided that the following conditions are met:
vpcola 0:a1734fe1ec4b 15 * 1. Redistributions of source code must retain the above copyright notice,
vpcola 0:a1734fe1ec4b 16 * this list of conditions and the following disclaimer.
vpcola 0:a1734fe1ec4b 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
vpcola 0:a1734fe1ec4b 18 * this list of conditions and the following disclaimer in the documentation
vpcola 0:a1734fe1ec4b 19 * and/or other materials provided with the distribution.
vpcola 0:a1734fe1ec4b 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
vpcola 0:a1734fe1ec4b 21 * may be used to endorse or promote products derived from this software
vpcola 0:a1734fe1ec4b 22 * without specific prior written permission.
vpcola 0:a1734fe1ec4b 23 *
vpcola 0:a1734fe1ec4b 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
vpcola 0:a1734fe1ec4b 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
vpcola 0:a1734fe1ec4b 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
vpcola 0:a1734fe1ec4b 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
vpcola 0:a1734fe1ec4b 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
vpcola 0:a1734fe1ec4b 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
vpcola 0:a1734fe1ec4b 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
vpcola 0:a1734fe1ec4b 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
vpcola 0:a1734fe1ec4b 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
vpcola 0:a1734fe1ec4b 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
vpcola 0:a1734fe1ec4b 34 *
vpcola 0:a1734fe1ec4b 35 ******************************************************************************
vpcola 0:a1734fe1ec4b 36 */
vpcola 0:a1734fe1ec4b 37 /*---------------------------------------------------------------------------*/
vpcola 0:a1734fe1ec4b 38 #ifndef __HW_CONFIG_H
vpcola 0:a1734fe1ec4b 39 #define __HW_CONFIG_H
vpcola 0:a1734fe1ec4b 40 /*---------------------------------------------------------------------------*/
vpcola 0:a1734fe1ec4b 41 #include "stm32l-spirit1-config.h"
vpcola 0:a1734fe1ec4b 42 /*---------------------------------------------------------------------------*/
vpcola 0:a1734fe1ec4b 43 #define UART_RxBufferSize 512
vpcola 0:a1734fe1ec4b 44 /*---------------------------------------------------------------------------*/
vpcola 0:a1734fe1ec4b 45 #define I2Cx I2C1
vpcola 0:a1734fe1ec4b 46 #define I2Cx_CLK_ENABLE() __I2C1_CLK_ENABLE()
vpcola 0:a1734fe1ec4b 47 #define I2Cx_SDA_GPIO_CLK_ENABLE() __GPIOB_CLK_ENABLE()
vpcola 0:a1734fe1ec4b 48 #define I2Cx_SCL_GPIO_CLK_ENABLE() __GPIOB_CLK_ENABLE()
vpcola 0:a1734fe1ec4b 49 /*---------------------------------------------------------------------------*/
vpcola 0:a1734fe1ec4b 50 #define I2Cx_FORCE_RESET() __I2C1_FORCE_RESET()
vpcola 0:a1734fe1ec4b 51 #define I2Cx_RELEASE_RESET() __I2C1_RELEASE_RESET()
vpcola 0:a1734fe1ec4b 52 /*---------------------------------------------------------------------------*/
vpcola 0:a1734fe1ec4b 53 /* Definition for I2Cx Pins */
vpcola 0:a1734fe1ec4b 54 #define I2Cx_SCL_PIN GPIO_PIN_8
vpcola 0:a1734fe1ec4b 55 #define I2Cx_SCL_GPIO_PORT GPIOB
vpcola 0:a1734fe1ec4b 56 #define I2Cx_SDA_PIN GPIO_PIN_9
vpcola 0:a1734fe1ec4b 57 #define I2Cx_SDA_GPIO_PORT GPIOB
vpcola 0:a1734fe1ec4b 58 #define I2Cx_SCL_SDA_AF GPIO_AF4_I2C1
vpcola 0:a1734fe1ec4b 59
vpcola 0:a1734fe1ec4b 60 /* Definition for I2Cx's NVIC */
vpcola 0:a1734fe1ec4b 61 #define I2Cx_EV_IRQn I2C1_EV_IRQn
vpcola 0:a1734fe1ec4b 62 #define I2Cx_ER_IRQn I2C1_ER_IRQn
vpcola 0:a1734fe1ec4b 63 #define I2Cx_EV_IRQHandler I2C1_EV_IRQHandler
vpcola 0:a1734fe1ec4b 64 #define I2Cx_ER_IRQHandler I2C1_ER_IRQHandler
vpcola 0:a1734fe1ec4b 65
vpcola 0:a1734fe1ec4b 66
vpcola 0:a1734fe1ec4b 67 #define I2Cx I2C1
vpcola 0:a1734fe1ec4b 68 #define I2Cx_CLK_ENABLE() __I2C1_CLK_ENABLE()
vpcola 0:a1734fe1ec4b 69 #define I2Cx_SDA_GPIO_CLK_ENABLE() __GPIOB_CLK_ENABLE()
vpcola 0:a1734fe1ec4b 70 #define I2Cx_SCL_GPIO_CLK_ENABLE() __GPIOB_CLK_ENABLE()
vpcola 0:a1734fe1ec4b 71
vpcola 0:a1734fe1ec4b 72 #define I2Cx_FORCE_RESET() __I2C1_FORCE_RESET()
vpcola 0:a1734fe1ec4b 73 #define I2Cx_RELEASE_RESET() __I2C1_RELEASE_RESET()
vpcola 0:a1734fe1ec4b 74
vpcola 0:a1734fe1ec4b 75 /* Definition for I2Cx Pins */
vpcola 0:a1734fe1ec4b 76 #define I2Cx_SCL_PIN GPIO_PIN_8
vpcola 0:a1734fe1ec4b 77 #define I2Cx_SCL_GPIO_PORT GPIOB
vpcola 0:a1734fe1ec4b 78 #define I2Cx_SDA_PIN GPIO_PIN_9
vpcola 0:a1734fe1ec4b 79 #define I2Cx_SDA_GPIO_PORT GPIOB
vpcola 0:a1734fe1ec4b 80 #define I2Cx_SCL_SDA_AF GPIO_AF4_I2C1
vpcola 0:a1734fe1ec4b 81
vpcola 0:a1734fe1ec4b 82 /* Definition for I2Cx's NVIC */
vpcola 0:a1734fe1ec4b 83 #define I2Cx_EV_IRQn I2C1_EV_IRQn
vpcola 0:a1734fe1ec4b 84 #define I2Cx_ER_IRQn I2C1_ER_IRQn
vpcola 0:a1734fe1ec4b 85 #define I2Cx_EV_IRQHandler I2C1_EV_IRQHandler
vpcola 0:a1734fe1ec4b 86 #define I2Cx_ER_IRQHandler I2C1_ER_IRQHandler
vpcola 0:a1734fe1ec4b 87
vpcola 0:a1734fe1ec4b 88 /* User can use this section to tailor USARTx/UARTx instance used and associated
vpcola 0:a1734fe1ec4b 89 resources */
vpcola 0:a1734fe1ec4b 90 /* Definition for USARTx clock resources */
vpcola 0:a1734fe1ec4b 91 #define USARTx USART2
vpcola 0:a1734fe1ec4b 92 #define USARTx_CLK_ENABLE() __USART2_CLK_ENABLE();
vpcola 0:a1734fe1ec4b 93 #define DMAx_CLK_ENABLE() __DMA1_CLK_ENABLE()
vpcola 0:a1734fe1ec4b 94 #define USARTx_RX_GPIO_CLK_ENABLE() __GPIOA_CLK_ENABLE()
vpcola 0:a1734fe1ec4b 95 #define USARTx_TX_GPIO_CLK_ENABLE() __GPIOA_CLK_ENABLE()
vpcola 0:a1734fe1ec4b 96
vpcola 0:a1734fe1ec4b 97 #define USARTx_FORCE_RESET() __USART2_FORCE_RESET()
vpcola 0:a1734fe1ec4b 98 #define USARTx_RELEASE_RESET() __USART2_RELEASE_RESET()
vpcola 0:a1734fe1ec4b 99
vpcola 0:a1734fe1ec4b 100 /* Definition for USARTx Pins */
vpcola 0:a1734fe1ec4b 101 #define USARTx_TX_PIN GPIO_PIN_2
vpcola 0:a1734fe1ec4b 102 #define USARTx_TX_GPIO_PORT GPIOA
vpcola 0:a1734fe1ec4b 103
vpcola 0:a1734fe1ec4b 104 #define USARTx_RX_PIN GPIO_PIN_3
vpcola 0:a1734fe1ec4b 105 #define USARTx_RX_GPIO_PORT GPIOA
vpcola 0:a1734fe1ec4b 106
vpcola 0:a1734fe1ec4b 107 /* Definition for USARTx's NVIC */
vpcola 0:a1734fe1ec4b 108 #define USARTx_IRQn USART2_IRQn
vpcola 0:a1734fe1ec4b 109 #define USARTx_IRQHandler USART2_IRQHandler
vpcola 0:a1734fe1ec4b 110
vpcola 0:a1734fe1ec4b 111 #define USARTx_TX_AF GPIO_AF7_USART2
vpcola 0:a1734fe1ec4b 112 #define USARTx_RX_AF GPIO_AF7_USART2
vpcola 0:a1734fe1ec4b 113
vpcola 0:a1734fe1ec4b 114
vpcola 0:a1734fe1ec4b 115 /* Enable sensor mask */
vpcola 0:a1734fe1ec4b 116 #define PRESSURE_SENSOR 0x00000001
vpcola 0:a1734fe1ec4b 117 #define TEMPERATURE_SENSOR 0x00000002
vpcola 0:a1734fe1ec4b 118 #define HUMIDITY_SENSOR 0x00000004
vpcola 0:a1734fe1ec4b 119 #define UV_SENSOR 0x00000008
vpcola 0:a1734fe1ec4b 120 #define ACCELEROMETER_SENSOR 0x00000010
vpcola 0:a1734fe1ec4b 121 #define GYROSCOPE_SENSOR 0x00000020
vpcola 0:a1734fe1ec4b 122 #define MAGNETIC_SENSOR 0x00000040
vpcola 0:a1734fe1ec4b 123 /*---------------------------------------------------------------------------*/
vpcola 0:a1734fe1ec4b 124 #endif /*__HW_CONFIG_H*/
vpcola 0:a1734fe1ec4b 125 /*---------------------------------------------------------------------------*/