/** * @brief Low level serial driver configuration and (re)start. * * @param[in] sdp pointer to a @p SerialDriver object * @param[in] config the architecture-dependent serial driver configuration. * If this parameter is set to @p NULL then a default * configuration is used. * * @notapi */ void sd_lld_start(SerialDriver * sdp, const SerialConfig * config) { if (config == NULL) { config = &default_config; } if (sdp->state == SD_STOP) { #if MSP430X_SERIAL_USE_USART0 == TRUE if (&SD0 == sdp) { usart0_init(config); } #endif #if MSP430X_SERIAL_USE_USART1 == TRUE if (&SD1 == sdp) { usart1_init(config); } #endif #if MSP430X_SERIAL_USE_USART2 == TRUE if (&SD2 == sdp) { usart2_init(config); } #endif #if MSP430X_SERIAL_USE_USART3 == TRUE if (&SD3 == sdp) { usart3_init(config); } #endif } }
/* ================================================================================================================================== init function ==================================================================================================================================== */ void init(void){ /* Inicjalizacjia zegarów */ SystemClock_Config(); /* Inicjalizacja portu LED */ led_port_init(); /* Inicjalizacja uartu2 */ usart2_init(); //Powitanie usart2_WriteS("-->> NUCLEO L46 <<--\n\rTEST\n\rCompile time: "); usart2_WriteS(__TIME__); /* USART 1 */ // usart1_init(); /*USART 3 */ // usart3_init(); /*UART 4 */ // usart_stat = uart4_init(); /*UART 5 */ // usart_stat = uart5_init(); /* TIM2 */ //procent++; tim2_stat = tim2_init(); /* TIM3 */ tim3_stat = tim3_init(); /* TIM5 INIT */ //tim5_stat = tim5_init(); /* I2C1 INIT */ //i2c1_status = i2c_init(I2C1, 0x00702991 , I2C1_PORT_SDA , I2C1_PIN_SDA , I2C1_PORT_SCL, I2C1_PIN_SCL , I2C1_GPIO_AF); /*GPIO INIT FOR TIME MESURE */ //gpio_init(GPIOB , GPIO_PIN_8 , GPIO_MODE_OUTPUT_PP , GPIO_PULLUP); /* INIT SPI */ spi2_nRF_init(); spi3_nRF_init(); }
int main(){ usart2_init(); delay_init(); MPU6050_I2C_Init(); MPU6050_Initialize(); MPU6050_Exti_Config(); TIM3_Init(72,10000); printf("start\n"); while(1) { } return 0; }
void dma_and_usart2_init(int baudrate){ usart2_init(baudrate); dma_channel_usart2_init(); usart2_enable_dma(); }