#include "output.h" #include "usart.h" #include "application.h" #include "timer.h" #include "w5100_spi_interface.h" void print_status() { usart_write_str((pU08)"adc status:\n"); for (U08 i=0; i< VOLTAGE_REGS;++i) { usart_write_U08_bin(adc_enables[i]); usart_write_char(' '); } usart_write_crlf(); for (U08 i=0; i< VOLTAGE_REGS;++i){ usart_write_U08_bin(adc_channels_ready[i]); usart_write_char(' '); } usart_write_crlf(); usart_write_str((pU08)"ad7719 status:\n"); for (U08 i=0; i< RESISTANCE_CHANNELS/8;++i) { usart_write_U08_bin(ad7719_enables[i]); usart_write_char(' '); } usart_write_crlf(); for (U08 i=0; i< RESISTANCE_CHANNELS/8;++i){ usart_write_U08_bin(ad7719_channels_ready[i]); usart_write_char(' '); } usart_write_crlf(); usart_write_str((pU08)"time:"); usart_write_U32(sec,10); usart_write_str((pU08)" sec.\n"); /* usart_write_str((pU08)"adc measured all: "); if (adc_measured_all) usart_write_str((pU08)" true\n"); else usart_write_str((pU08)"false\n"); usart_write_str((pU08)"ad7719 measured all: "); if (ad7719_measured_all) usart_write_str((pU08)" true\n"); else usart_write_str((pU08)"false\n"); usart_write_str((pU08)"adc current channel:"); usart_write_U08(*adc_current_channel,2); usart_write_crlf(); usart_write_str((pU08)"ad7719 current channel:"); usart_write_U08(*ad7719_current_channel,2); usart_write_crlf(); usart_write_str((pU08)"mux SB:"); usart_write_U08_hex(PORTC); usart_write_str((pU08)" SA:"); usart_write_U08_hex(PORTA); usart_write_crlf(); */ } void print_adc_nicely() { usart_write_str((pU08)"\n printing voltages in mV:\n"); // output: U08 adc_values[V_CHANNELS + I_CHANNELS + H_CHANNELS]; for (U08 i=0; i< VOLTAGE_CHANNELS;++i) { if (i%8 == 0) usart_write_char('\n'); adc_output(i, adc_values[i]); usart_write_str((pU08)" "); } usart_write_char('\n'); } void print_ad7719_nicely() { float value; usart_write_str((pU08)"\n printing measured resistance in kohms:\n"); for (U08 i=0; i< RESISTANCE_CHANNELS;++i) { if (i%8 == 0) usart_write_char('\n'); // print channel name: usart_write_str((pU08)"R:"); //R for resistance usart_write_char('A'+i/8); // Letters A,B,C,D,E,F,G,H //usart_write_char(' '); usart_write_U08(i%8+1,1); // Numbers 1...8 usart_write_char(':'); // check if this channel is enabled in the bitmap if (ad7719_enables[i/8] & (1<