STM8S/A Standard Peripherals Firmware Library
|
stm8_128_eval.h
Go to the documentation of this file.
00001 /** 00002 ****************************************************************************** 00003 * @file stm8_128_eval.h 00004 * @author MCD Application Team 00005 * @version V1.0.1 00006 * @date 30-September-2014 00007 * @brief This file contains definitions for STM8_128_EVAL's Leds, push-buttons 00008 * and COM ports hardware resources. 00009 ****************************************************************************** 00010 * 00011 * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); 00012 * You may not use this file except in compliance with the License. 00013 * You may obtain a copy of the License at: 00014 * 00015 * http://www.st.com/software_license_agreement_liberty_v2 00016 * 00017 * Unless required by applicable law or agreed to in writing, software 00018 * distributed under the License is distributed on an "AS IS" BASIS, 00019 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00020 * See the License for the specific language governing permissions and 00021 * limitations under the License. 00022 * 00023 ****************************************************************************** 00024 */ 00025 00026 /* Define to prevent recursive inclusion -------------------------------------*/ 00027 #ifndef __STM8_128_EVAL_H 00028 #define __STM8_128_EVAL_H 00029 00030 /* Includes ------------------------------------------------------------------*/ 00031 #include "stm8s_eval.h" 00032 00033 /** @addtogroup Utilities 00034 * @{ 00035 */ 00036 00037 /** @addtogroup STM8S_EVAL 00038 * @{ 00039 */ 00040 00041 /** @addtogroup STM8_128_EVAL 00042 * @{ 00043 */ 00044 /** @addtogroup STM8_128_EVAL_LOW_LEVEL 00045 * @{ 00046 */ 00047 00048 /* Exported types ------------------------------------------------------------*/ 00049 00050 /** @defgroup STM8_128_EVAL_LOW_LEVEL_Exported_Constants 00051 * @{ 00052 */ 00053 /** @addtogroup STM8_128_EVAL_LOW_LEVEL_LED 00054 * @{ 00055 */ 00056 00057 #define LEDn 4 00058 #define LED1_GPIO_PORT GPIOH 00059 #define LED1_GPIO_PIN GPIO_PIN_3 00060 00061 00062 #define LED2_GPIO_PORT GPIOH 00063 #define LED2_GPIO_PIN GPIO_PIN_2 00064 00065 #define LED3_GPIO_PORT GPIOH 00066 #define LED3_GPIO_PIN GPIO_PIN_1 00067 00068 #define LED4_GPIO_PORT GPIOH 00069 #define LED4_GPIO_PIN GPIO_PIN_0 00070 00071 00072 /** 00073 * @} 00074 */ 00075 00076 /** @addtogroup STM8_128_EVAL_LOW_LEVEL_BUTTON 00077 * @{ 00078 */ 00079 #define BUTTONn 6 00080 00081 /** 00082 * @brief Key push-button 00083 */ 00084 #define KEY_BUTTON_PORT GPIOC 00085 #define KEY_BUTTON_PIN GPIO_PIN_0 00086 00087 /** 00088 * @brief Joystick Right push-button 00089 */ 00090 #define RIGHT_BUTTON_PORT GPIOB 00091 #define RIGHT_BUTTON_PIN GPIO_PIN_5 00092 00093 /** 00094 * @brief Joystick Left push-button 00095 */ 00096 #define LEFT_BUTTON_PORT GPIOB 00097 #define LEFT_BUTTON_PIN GPIO_PIN_4 00098 00099 /** 00100 * @brief Joystick Up push-button 00101 */ 00102 #define UP_BUTTON_PORT GPIOB 00103 #define UP_BUTTON_PIN GPIO_PIN_6 00104 00105 /** 00106 * @brief Joystick Down push-button 00107 */ 00108 #define DOWN_BUTTON_PORT GPIOB 00109 #define DOWN_BUTTON_PIN GPIO_PIN_7 00110 00111 /** 00112 * @brief Joystick Sel push-button 00113 */ 00114 #define SEL_BUTTON_PORT GPIOD 00115 #define SEL_BUTTON_PIN GPIO_PIN_7 00116 00117 /** 00118 * @brief EXTI push-button definition 00119 */ 00120 #define KEY_BUTTON_EXTI_PORT EXTI_PORT_GPIOC 00121 #define RIGHT_BUTTON_EXTI_PORT EXTI_PORT_GPIOB 00122 #define LEFT_BUTTON_EXTI_PORT EXTI_PORT_GPIOB 00123 #define UP_BUTTON_EXTI_PORT EXTI_PORT_GPIOB 00124 #define DOWN_BUTTON_EXTI_PORT EXTI_PORT_GPIOB 00125 #define SEL_BUTTON_EXTI_PORT EXTI_PORT_GPIOD 00126 00127 /** 00128 * @} 00129 */ 00130 00131 /** @addtogroup STM8_128_EVAL_SD_SPI 00132 * @{ 00133 */ 00134 /** 00135 * @brief SD SPI Interface pins 00136 */ 00137 #define SD_SPI_CLK CLK_PERIPHERAL_SPI 00138 #define SD_SPI_SCK_PIN GPIO_PIN_5 /* PC.05 */ 00139 #define SD_SPI_SCK_GPIO_PORT GPIOC /* GPIOC */ 00140 #define SD_SPI_MISO_PIN GPIO_PIN_7 /* PC.05 */ 00141 #define SD_SPI_MISO_GPIO_PORT GPIOC /* GPIOC */ 00142 #define SD_SPI_MOSI_PIN GPIO_PIN_6 /* PC.06 */ 00143 #define SD_SPI_MOSI_GPIO_PORT GPIOC /* GPIOC */ 00144 #define SD_CS_PIN GPIO_PIN_5 /* PE.05 */ 00145 #define SD_CS_GPIO_PORT GPIOE /* GPIOE */ 00146 #define SD_DETECT_PIN GPIO_PIN_4 /* PE.04 */ 00147 #define SD_DETECT_GPIO_PORT GPIOE /* GPIOE */ 00148 00149 /** 00150 * @} 00151 */ 00152 00153 /** @addtogroup STM8_128_EVAL_LOW_LEVEL_I2C_EE 00154 * @{ 00155 */ 00156 /** 00157 * @brief I2C EEPROM Interface pins 00158 */ 00159 #define sEE_I2C I2C 00160 #define sEE_I2C_CLK CLK_PERIPHERAL_I2C 00161 #define sEE_I2C_SCL_PIN GPIO_PIN_1 /* PC.01 */ 00162 #define sEE_I2C_SCL_GPIO_PORT GPIOE /* GPIOE */ 00163 #define sEE_I2C_SDA_PIN GPIO_PIN_2 /* PC.00 */ 00164 #define sEE_I2C_SDA_GPIO_PORT GPIOE /* GPIOE */ 00165 #define sEE_M24C64_32 00166 00167 00168 #define sEE_DIRECTION_TX 0 00169 #define sEE_DIRECTION_RX 1 00170 00171 /** 00172 * @} 00173 */ 00174 00175 /* Exported macro ------------------------------------------------------------*/ 00176 00177 /** @defgroup STM8_128_EVAL_LOW_LEVEL_Exported_Functions 00178 * @{ 00179 */ 00180 void STM_EVAL_LEDInit(Led_TypeDef Led); 00181 void STM_EVAL_LEDOn(Led_TypeDef Led); 00182 void STM_EVAL_LEDOff(Led_TypeDef Led); 00183 void STM_EVAL_LEDToggle(Led_TypeDef Led); 00184 void STM_EVAL_PBInit(Button_TypeDef Button, ButtonMode_TypeDef Button_Mode); 00185 uint8_t STM_EVAL_PBGetState(Button_TypeDef Button); 00186 void SD_LowLevel_DeInit(void); 00187 void SD_LowLevel_Init(void); 00188 void sEE_LowLevel_DeInit(void); 00189 void sEE_LowLevel_Init(void); 00190 00191 00192 /** 00193 * @} 00194 */ 00195 00196 #endif /* __STM8_128_EVAL_H */ 00197 00198 /** 00199 * @} 00200 */ 00201 00202 /** 00203 * @} 00204 */ 00205 00206 /** 00207 * @} 00208 */ 00209 00210 /** 00211 * @} 00212 */ 00213 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/