Ejemplo n.º 1
0
/* PRV -----------------------------------------------------------------------*/
void prvHardwareInit()
{
	c_common_i2c_init();
	c_common_usart2_init(9600);
  c_io_sonar_init();
	//c_io_rx24f_init(1000000);
	//c_rc_receiver_init();
	LED = c_common_gpio_init(GPIOC, GPIO_Pin_13, GPIO_Mode_OUT);
}
Ejemplo n.º 2
0
/** \brief Inicializacao componentes de IO.
  *
  * Incializa o hardware para comunicar com os sensores. Rotinas de teste
  * ainda precisam ser executadas.
  * @param  None
  * @retval None
  */
void module_imu_init()
{
	I2Cn=I2C1;
	/* Inicialização do hardware do módulo */
	LED4 = c_common_gpio_init(GPIOD, GPIO_Pin_12, GPIO_Mode_OUT); //LED4

	/* Inicialização da imu */
	//c_common_i2c_init(I2Cn);
	c_io_imuAdafruit_init(I2Cn);
	//c_io_imu_config(ADAFRUIT);
	//imu_init(I2Cn);
	c_common_usart2_init(BAUDRATE);

	c_common_usart_puts(USARTn,"Adafruit 10DOF Tester");
	c_common_usart_putchar(USARTn,'\n');

	/* Initialise the sensors */
	/*
		if(!c_io_lsm303_initAccel(I2Cn)) {
			// There was a problem detecting the ADXL345 ... check your connections
			c_common_usart_puts(USARTn,"Ooops, no LSM303 detected ... Check your wiring!");
			c_common_usart_putchar(USARTn,'\n');
			while(1);
		}
		if(!c_io_lsm303_initMag(I2Cn)) {
			// There was a problem detecting the LSM303 ... check your connections
			c_common_usart_puts(USARTn,"Ooops, no LSM303 detected ... Check your wiring!");
			c_common_usart_putchar(USARTn,'\n');
			while(1);
		}
		if(!c_io_bmp085_init(I2Cn,BMP085_MODE_ULTRAHIGHRES)) {
			// There was a problem detecting the BMP085 ... check your connections
			c_common_usart_puts(USARTn,"Ooops, no BMP085 detected ... Check your wiring or I2C ADDR!");
			while(1);
		}
		if(!c_io_l3gd20_init(I2Cn,GYRO_RANGE_250DPS)) {
			// There was a problem detecting the L3GD20 ... check your connections
			c_common_usart_puts(USARTn,"Ooops, no L3GD20 detected ... Check your wiring or I2C ADDR!");
			while(1);
		}
*/
	/* Display some basic information on this sensor */
	//displaySensorDetails();
}