CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Redirecting printf function to SPI I/O

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
rikotech8



Joined: 10 Dec 2011
Posts: 376
Location: Sofiq,Bulgariq

View user's profile Send private message

Redirecting printf function to SPI I/O
PostPosted: Thu Apr 09, 2015 11:56 am     Reply with quote

Hello everyone. Can anyone explain me how can I redirect printf function to stream data on SPI output? In some compilers it is possible by manually modifying putchar function to put the char into the SPI TX buffer. Is something like that possible with CCS compiler? Thank you in advance.
_________________
A person who never made a mistake never tried anything new.
temtronic



Joined: 01 Jul 2010
Posts: 9134
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Thu Apr 09, 2015 12:51 pm     Reply with quote

Yes you can do it...

just look at how the LCD display driver is interfaced to printf....

I'm assuming 8 bit data.....

Jay
Ttelmah



Joined: 11 Mar 2010
Posts: 19258

View user's profile Send private message

PostPosted: Thu Apr 09, 2015 2:13 pm     Reply with quote

and it doesn't involve any 'modifying'... Smile

It's one of the really great abilities in CCS. Just look at the printf manual, and the optional first argument 'fname'.
rikotech8



Joined: 10 Dec 2011
Posts: 376
Location: Sofiq,Bulgariq

View user's profile Send private message

PostPosted: Fri Apr 10, 2015 1:58 am     Reply with quote

Thanks a lot!
_________________
A person who never made a mistake never tried anything new.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group