Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
22 May, 2013, 11:21:55 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   home   news downloads projects tutorials misc forums rules new posts irc about Login Register  
+-OmnomIRC

You must Register, be logged in and have at least 40 posts to use this shout-box! If it still doesn't show up afterward, it might be that OmnomIRC is disabled for your group or under maintenance.

Note: You can also use an IRC client like mIRC, X-Chat or Mibbit to connect to an EFnet server and #omnimaga.

Pages: [1]   Go Down
  Print  
Author Topic: Non-blocking serial read-function? -  (Read 583 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
compu
LV5 Advanced (Next: 300)
*****
Offline Offline

Gender: Male
Last Login: Yesterday at 21:03:09
Date Registered: 09 January, 2011, 22:45:52
Location: Germany
Posts: 226

Topic starter
Total Post Ratings: +53

View Profile
« on: 27 July, 2011, 12:19:26 »
0

I have a small question about Nspire C:
Is there a non-blocking function to check if data is available for reading at the serial port?
Logged

Nspire I/O Discussion|Website - cross-compatible with Prizm!
TI-Nspire Programming Statistics
ExtendeD
Coder Of Tomorrow
LV8 Addict (Next: 1000)
*
Offline Offline

Gender: Male
Last Login: Today at 10:41:34
Date Registered: 02 January, 2010, 13:03:41
Location: France
Posts: 765

Total Post Ratings: +151

View Profile
« Reply #1 on: 30 July, 2011, 08:59:32 »
+1

You will have to use direct I/O access. It's not different than doing it from a computer: http://hackspire.unsads.com/wiki/index.php/Memory-mapped_I/O_ports#90020000_-_Serial_UART

Here is a code snippet that was once used in Ndless, equivalent to puts():


1
2
3
4
5
6
7
8
void ut_puts(const char *str) {
volatile unsigned *line_status_reg = (unsigned*)0x90020014;
volatile unsigned *xmit_holding_reg = (unsigned*)0x90020000;
while(*str) {
while(!(*line_status_reg & 0b100000)); // wait for empty xmit holding reg
*xmit_holding_reg = *str++;
}
}
Logged

ndlessly - Progress and insights on Ndless
Ndless / Hackspire - Third-party TI-Nspire development
compu
LV5 Advanced (Next: 300)
*****
Offline Offline

Gender: Male
Last Login: Yesterday at 21:03:09
Date Registered: 09 January, 2011, 22:45:52
Location: Germany
Posts: 226

Topic starter
Total Post Ratings: +53

View Profile
« Reply #2 on: 30 July, 2011, 12:20:26 »
0

Thank you! Smiley
Logged

Nspire I/O Discussion|Website - cross-compatible with Prizm!
TI-Nspire Programming Statistics
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Powered by MySQL Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Powered by PHP
Page created in 0.794 seconds with 30 queries.
Skin by DJ Omnimaga edited from SMF default theme with the help of tr1p1ea.
All programs, games and songs avaliable on this website are property of their respective owners.
Best viewed in Opera, Firefox, Chrome and Safari with a resolution of 1024x768 or above.