86 lines
4.0 KiB
C
86 lines
4.0 KiB
C
/**
|
|
******************************************************************************
|
|
* @file hw_config.h
|
|
* @author MCD Application Team
|
|
* @version V4.1.0
|
|
* @date 26-May-2017
|
|
* @brief Hardware Configuration & Setup
|
|
******************************************************************************
|
|
* @attention
|
|
*
|
|
* <h2><center>© COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
|
|
*
|
|
* Redistribution and use in source and binary forms, with or without modification,
|
|
* are permitted provided that the following conditions are met:
|
|
* 1. Redistributions of source code must retain the above copyright notice,
|
|
* this list of conditions and the following disclaimer.
|
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
* this list of conditions and the following disclaimer in the documentation
|
|
* and/or other materials provided with the distribution.
|
|
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
|
* may be used to endorse or promote products derived from this software
|
|
* without specific prior written permission.
|
|
*
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
*
|
|
******************************************************************************
|
|
*/
|
|
|
|
|
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
|
#ifndef __HAL_H
|
|
#define __HAL_H
|
|
|
|
/* Includes ------------------------------------------------------------------*/
|
|
#include "stm32f10x.h"
|
|
#include "usb_type.h"
|
|
|
|
/* Exported types ------------------------------------------------------------*/
|
|
/* Exported constants --------------------------------------------------------*/
|
|
/* Exported macro ------------------------------------------------------------*/
|
|
/* Exported define -----------------------------------------------------------*/
|
|
#define LED_ON 0xF0
|
|
#define LED_OFF 0xFF
|
|
|
|
/*Unique Devices IDs register set*/
|
|
|
|
#define ID1 (0x1FFFF7E8)
|
|
#define ID2 (0x1FFFF7EC)
|
|
#define ID3 (0x1FFFF7F0)
|
|
|
|
|
|
|
|
/* Define the STM32F10x hardware depending on the used evaluation board */
|
|
#define USB_DISCONNECT GPIOB
|
|
#define USB_DISCONNECT_PIN GPIO_Pin_5
|
|
#define RCC_APB2Periph_GPIO_DISCONNECT RCC_APB2Periph_GPIOB
|
|
#define RCC_APB2Periph_ALLGPIO (RCC_APB2Periph_GPIOA \
|
|
| RCC_APB2Periph_GPIOB \
|
|
| RCC_APB2Periph_GPIOC \
|
|
| RCC_APB2Periph_GPIOD \
|
|
| RCC_APB2Periph_GPIOE )
|
|
|
|
/* Exported functions ------------------------------------------------------- */
|
|
void Set_System(void);
|
|
void Set_USBClock(void);
|
|
void Enter_LowPowerMode(void);
|
|
void Leave_LowPowerMode(void);
|
|
void USB_Interrupts_Config(void);
|
|
void USB_Cable_Config (FunctionalState NewState);
|
|
uint64_t HAL_GetHwSerialNum(void);
|
|
uint32_t CDC_Send_DATA (uint8_t *ptrBuffer, uint8_t Send_length);
|
|
uint32_t CDC_Receive_DATA(void);
|
|
/* External variables --------------------------------------------------------*/
|
|
|
|
#endif /*__HW_CONFIG_H*/
|
|
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|