SHARE
TWEET

Untitled

wandrake Dec 11th, 2014 185 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top