센서보드 RF IRQ 테스트 중

Fork of stm-spirit1-rf-driver by ST

Committer:
Wolfgang Betz
Date:
Thu Jul 06 11:13:31 2017 +0200
Revision:
67:93bec0baf1de
Parent:
34:edda6a7238ec
Clarify some comments

Who changed what in which revision?

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