Пример #1
0
// Echoes anything received via UART2 using interrupts
void echo_task(void *pvParameters)
{
	while(1) {
		while(!c_common_usart_available(USART2)) { vTaskDelay(10/portTICK_RATE_MS); }
		c_common_usart_puts(USART2, "Got: ");
		c_common_usart_putchar(USART2, c_common_usart_read(USART2));
		c_common_usart_puts(USART2, " \n\r");
	}
}
Пример #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();
}