Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "ch.h"
- #include "hal.h"
- #include "chprintf.h"
- int main(void){
- halInit(); // initialize Hardware Abstraction Layer
- chSysInit(); // initialize ChibiOS kernel
- sdStart(&SD1, NULL); // starts the serial driver with uartCfg as a config
- char data[] = "Hello World ! \n \r";
- while(1){
- chprintf((BaseSequentialStream *)&SD1, "**********************");
- chprintf((BaseSequentialStream *)&SD1, "* TM4C123x I2C Demo. *");
- chprintf((BaseSequentialStream *)&SD1, "**********************\n");
- chThdSleepMilliseconds(1000);
- sdWrite(&SD1, (uint8_t *) data, strlen(data)); // Writes "Hello World in the UART output
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement