47 #include "esos_pc_stdio.h"
50 #include <sys/select.h>
61 #define DS1631ADDR 0x90 //DS1631 address with all pins tied low
62 #define ACCESS_CONFIG 0xAC
63 #define CONFIG_COMMAND 0x0C //continuous conversion, 12-bit mode
64 #define START_CONVERT 0x51
65 #define READ_TEMP 0xAA
68 #define CONFIG_LED1() CONFIG_RB15_AS_DIG_OUTPUT()
71 #define CONFIG_LED1() printf("called CONFIG_LED1()\n");
79 char psz_CRNL[3]= {0x0D, 0x0A, 0};
80 char psz_prompt[] =
"Temp is ";
81 char psz_done[9]= {
' ',
'D',
'O',
'N',
'E',
'!',0x0D, 0x0A, 0};
101 __esos_tmrSvcsExecute();
172 U16_raw.
u8Msb = u8_hi;
173 U16_raw.
u8Lsb = u8_lo;
175 i16_temp = ((i16_temp<<8)|u8_lo);
190 float f_tempC, f_tempF;
195 f_tempC = (float) i16_temp;
196 f_tempC = f_tempC/256;
197 f_tempF = f_tempC*9/5 + 32;
198 printf(
"Temp is: 0x%0X, %4.4f (C), %4.4f (F)\n", i16_temp, (
double) f_tempC, (
double) f_tempF);
217 __esos_unsafe_PutString( HELLO_MSG );