/*
 * main.h
 *
 *  Created on: 13. 2. 2017
 *      Author: Steave
 */

#ifndef MAIN_H_
#define MAIN_H_

#define MAXCLISTRING          100

/* Encoders handlers declaration */
TIM_HandleTypeDef 		TimHandle1;
TIM_Encoder_InitTypeDef EncConf1;
TIM_HandleTypeDef 		TimHandle2;
TIM_Encoder_InitTypeDef EncConf2;
TIM_HandleTypeDef 		TimHandle7;

//UART handle
UART_HandleTypeDef UartHandle;
__IO ITStatus UartReady;

//RTC Handle
//RTC_HandleTypeDef hrtc;
//RTC_TimeTypeDef sTimeGlobal;
//RTC_DateTypeDef sDateGlobal;
//RTC_TimeTypeDef sTimeGlobalOld;

/* Buffer used for UART */
uint8_t aTxBuffer[55];
uint8_t aRxBuffer[55];
uint8_t aState[6];
int32_t counterValue1;
int32_t counterValue2;

uint16_t count;
uint32_t uwPrescalerValue;
uint32_t uwCapturedValue;

uint16_t ms;
uint8_t s;
uint8_t min;
uint8_t h;

#define FILTER 0x8f;

/* Private function prototypes -----------------------------------------------*/
void Error_Handler(void);
void SystemClock_Config(void);
HAL_StatusTypeDef HAL_UART_Receive_N(UART_HandleTypeDef *huart, uint8_t *pData,
		uint32_t Timeout);

/* Private functions ---------------------------------------------------------*/

/* Size of Transmission buffer */
//#define TXBUFFERSIZE                      (COUNTOF(aTxBuffer) - 1)
/* Size of Reception buffer */
//#define RXBUFFERSIZE                      TXBUFFERSIZE
/* Exported macro ------------------------------------------------------------*/
//#define COUNTOF(__BUFFER__)   (sizeof(__BUFFER__) / sizeof(*(__BUFFER__)))
/* Exported functions ------------------------------------------------------- */

#endif /* MAIN_H_ */
