void UserInit(void)
{
  RCC_Conf();
  GPIO_Conf();
  SPI_Conf();
  TIMER_Conf();
  PWM_Conf();
  USART_Conf();
  I2C_Conf();
  NVIC_Conf();

  DelayInit(72);
}
Exemple #2
0
/**
  * @brief  Configures the accelerometer
  * @param  None
  * @retval I2C success/error code
  */
I2C_Returntype Acc_Init() {							//Initialises accel
	uint8_t init[LEN_A]=ACCEL_SETUP;
	return I2C_Conf(init,LEN_A);
}
Exemple #3
0
/**
  * @brief  Configures the rate gyro
  * @param  None
  * @retval I2C success/error code
  */
I2C_Returntype Gyr_Init() {							//Initialises itg gyro
	uint8_t init[LEN_ITG_S]=ITG_SETUP;
	uint8_t initc[LEN_ITG_C]=ITG_CLOCK;
	I2C_Returntype r=I2C_Conf(init,LEN_ITG_S);				//Sets up the config registers
	return r|=I2C_Conf(initc,LEN_ITG_C);					//Initialises gyro clk config
}
Exemple #4
0
/**
  * @brief  Configures the magnetometer
  * @param  None
  * @retval I2C success/error code
  */
I2C_Returntype Mag_Init() {							//Initialises magno, pointer is left at data registers
	uint8_t init[LEN_M]=MAGNO_SETUP;
	return I2C_Conf(init,LEN_M);
}