/**
  ******************************************************************************
  * @file    hw_config.h 
  * @author  VMA RF Application Team
  * @version V1.0.0
  * @date    July-2015
  * @brief   
  ******************************************************************************
  * @attention
  *
  * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
  * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
  * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
  * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
  * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
  * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
  *
  * <h2><center>&copy; COPYRIGHT 2015 STMicroelectronics</center></h2>
  ******************************************************************************
  */ 

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef HW_CONFIG_H
#define HW_CONFIG_H

/* Includes ------------------------------------------------------------------*/
#include <stdint.h>

/* Exported defines ------------------------------------------------------------*/
#define UART_DR_ADDRESS        (UART_BASE)
#define DMA_CH_UART_TX          DMA_CH1
#define DMA_FLAG_TC_UART_TX     DMA_FLAG_TC1

#define DMA_CH_UART_RX          DMA_CH0
#define DMA_FLAG_TC_UART_RX     DMA_FLAG_TC0

/* SPI DMA channels */
#define DMA_CH_SPI_TX                   (DMA_CH5)
#define DMA_CH_SPI_RX                   (DMA_CH4)

/* SPI port */
#define SPI_CS_PIN      GPIO_Pin_11
#define SPI_MOSI_PIN    GPIO_Pin_2
#define SPI_MISO_PIN    GPIO_Pin_3
#define SPI_CLCK_PIN    GPIO_Pin_0
#define GPIO_MODE_SPI   Serial0_Mode

#define SPI_IRQ_PIN     GPIO_Pin_7

#ifdef UART_INTERFACE
#define IO_WAKEUP_PIN   0
#endif
#ifdef SPI_INTERFACE
#define IO_WAKEUP_PIN   4
#endif

/* Exported constants --------------------------------------------------------*/
/* Exported macro ------------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */

void WDG_Configuration(void);
void NVIC_Configuration(void);
void GPIO_Configuration(void);
void UART_Configuration(void);
void DMA_Configuration(void);
void SPI_Slave_Configuration(void);

uint8_t DMA_Rearm(DMA_CH_Type* DMAy_Channelx, uint32_t buffer, uint32_t size);
uint8_t DMAUart_SendData(uint32_t address, uint8_t size);
void NVIC_DisableRadioIrq(void);
void NVIC_EnableRadioIrq(void);

#endif /* HW_CONFIG_H */

/******************* (C) COPYRIGHT 2015 STMicroelectronics *****END OF FILE****/
