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