Advertisement
wandrake

Untitled

Dec 11th, 2014
516
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.68 KB | None | 0 0
  1. #include "ch.h"
  2. #include "hal.h"
  3. #include "chprintf.h"
  4.  
  5.  
  6. int main(void){
  7.     halInit(); // initialize Hardware Abstraction Layer
  8.     chSysInit(); // initialize ChibiOS kernel
  9.     sdStart(&SD1, NULL); // starts the serial driver with uartCfg as a config
  10.     char data[] = "Hello World ! \n \r";
  11.     while(1){
  12.         chprintf((BaseSequentialStream *)&SD1, "**********************");
  13.         chprintf((BaseSequentialStream *)&SD1, "* TM4C123x I2C Demo. *");
  14.         chprintf((BaseSequentialStream *)&SD1, "**********************\n");
  15.         chThdSleepMilliseconds(1000);
  16.         sdWrite(&SD1, (uint8_t *) data, strlen(data)); // Writes "Hello World in the UART output
  17.  
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement