1 .file "adc_test.c" 2 __SREG__ = 0x3f 3 __SP_H__ = 0x3e 4 __SP_L__ = 0x3d 5 __CCP__ = 0x34 6 __tmp_reg__ = 0 7 __zero_reg__ = 1 8 .global __do_copy_data 9 .global __do_clear_bss 11 .text 12 .Ltext0: 82 .data 83 .LC0: 84 0000 6865 6C6C .string "hello world\n\r" 84 6F20 776F 84 726C 640A 84 0D00 85 .LC1: 86 000e 5661 6C3A .string "Val: %d\n\r" 86 2025 640A 86 0D00 87 .text 89 .global main 91 main: 0:adc_test.c **** #include "oulib.h" 1:adc_test.c **** 2:adc_test.c **** // Load the ISRs 3:adc_test.c **** #include "oulib_serial_buffered.h" 4:adc_test.c **** 5:adc_test.c **** FILE* fp0; 6:adc_test.c **** #define SERIAL_PORT 0 7:adc_test.c **** #define SERIAL_BAUD 38400 8:adc_test.c **** #define SERIAL_BUFFER_SIZE 40 9:adc_test.c **** 10:adc_test.c **** 11:adc_test.c **** int main(void) 12:adc_test.c **** { 93 .LM0: 94 .LFBB1: 95 0000 0F93 push r16 96 0002 CF93 push r28 97 0004 DF93 push r29 98 /* prologue: function */ 99 /* frame size = 0 */ 13:adc_test.c **** uint16_t val; 14:adc_test.c **** 15:adc_test.c **** // Initialize the serial port connected to the USB cable 16:adc_test.c **** fp0 = serial_init_buffered(SERIAL_PORT, SERIAL_BAUD, SERIAL_BUFFER_SIZE, SERIAL_BUFFER_SIZE); 101 .LM1: 102 0006 80E0 ldi r24,lo8(0) 103 0008 40E0 ldi r20,lo8(38400) 104 000a 56E9 ldi r21,hi8(38400) 105 000c 60E0 ldi r22,hlo8(38400) 106 000e 70E0 ldi r23,hhi8(38400) 107 0010 28E2 ldi r18,lo8(40) 108 0012 08E2 ldi r16,lo8(40) 109 0014 0E94 0000 call serial_init_buffered 110 0018 BC01 movw r22,r24 111 001a 9093 0000 sts (fp0)+1,r25 112 001e 8093 0000 sts fp0,r24 17:adc_test.c **** 18:adc_test.c **** // Initialize all interrupts 19:adc_test.c **** sei(); 114 .LM2: 115 /* #APP */ 116 ; 20 "adc_test.c" 1 117 0022 7894 sei 118 ; 0 "" 2 20:adc_test.c **** fprintf(fp0, "hello world\n\r"); 120 .LM3: 121 /* #NOAPP */ 122 0024 80E0 ldi r24,lo8(.LC0) 123 0026 90E0 ldi r25,hi8(.LC0) 124 0028 0E94 0000 call fputs 21:adc_test.c **** 22:adc_test.c **** adc_set_reference(ADC_REF_AREF); // Use the reference pin 126 .LM4: 127 002c 80E0 ldi r24,lo8(0) 128 002e 0E94 0000 call adc_set_reference 23:adc_test.c **** adc_set_adlar(0); // For our purposes, always use 0 130 .LM5: 131 0032 80E0 ldi r24,lo8(0) 132 0034 0E94 0000 call adc_set_adlar 24:adc_test.c **** adc_set_prescalar(ADC_PRESCALAR_128); // Minimum necessary with 16MHz clock 134 .LM6: 135 0038 87E0 ldi r24,lo8(7) 136 003a 0E94 0000 call adc_set_prescalar 25:adc_test.c **** // and 10 bit resolution 26:adc_test.c **** 27:adc_test.c **** // Turn on ADC 28:adc_test.c **** adc_set_enable(ADC_ENABLE); 138 .LM7: 139 003e 81E0 ldi r24,lo8(1) 140 0040 0E94 0000 call adc_set_enable 29:adc_test.c **** 30:adc_test.c **** // Set the channel 31:adc_test.c **** adc_set_channel(ADC_CHANNEL_0); // ADC8 142 .LM8: 143 0044 80E0 ldi r24,lo8(0) 144 0046 0E94 0000 call adc_set_channel 32:adc_test.c **** 33:adc_test.c **** while(1) { 34:adc_test.c **** adc_start_conversion(); 35:adc_test.c **** val = adc_read(); 36:adc_test.c **** fprintf(fp0, "Val: %d\n\r", val); 146 .LM9: 147 004a C0E0 ldi r28,lo8(.LC1) 148 004c D0E0 ldi r29,hi8(.LC1) 149 .L2: 150 .LBB4: 151 .LBB5: 153 .Ltext1: 0:../../oulib/include/oulib.h **** /** 1:../../oulib/include/oulib.h **** \defgroup adc Analog-to-Digital Conversion 2:../../oulib/include/oulib.h **** \defgroup buffer Circular Buffer 3:../../oulib/include/oulib.h **** \defgroup delay Time Delays 4:../../oulib/include/oulib.h **** \defgroup serial Serial I/O 5:../../oulib/include/oulib.h **** \defgroup spi Serial Peripheral Interface 6:../../oulib/include/oulib.h **** \defgroup timer0 Timer 0 7:../../oulib/include/oulib.h **** \defgroup timer1 Timer 1 8:../../oulib/include/oulib.h **** \defgroup timer2 Timer 2 9:../../oulib/include/oulib.h **** \defgroup timer3 Timer 3 (only available for processors with Timer 3) 10:../../oulib/include/oulib.h **** \defgroup timer4 Timer 4 (only available for processors with Timer 4) 11:../../oulib/include/oulib.h **** \defgroup timer5 Timer 5 (only available for processors with Timer 5) 12:../../oulib/include/oulib.h **** \defgroup twi Two-Wire Interface 13:../../oulib/include/oulib.h **** \defgroup serial_support Serial Support Functions (not for user code) 14:../../oulib/include/oulib.h **** */ 15:../../oulib/include/oulib.h **** 16:../../oulib/include/oulib.h **** 17:../../oulib/include/oulib.h **** #ifndef OULIB_INCLUDE 18:../../oulib/include/oulib.h **** #define OULIB_INCLUDE 19:../../oulib/include/oulib.h **** 20:../../oulib/include/oulib.h **** #include 21:../../oulib/include/oulib.h **** #include 22:../../oulib/include/oulib.h **** #include 23:../../oulib/include/oulib.h **** #include 24:../../oulib/include/oulib.h **** #include 25:../../oulib/include/oulib.h **** 26:../../oulib/include/oulib.h **** #define OULIB_VERSION "2011_02_21" 27:../../oulib/include/oulib.h **** 28:../../oulib/include/oulib.h **** #ifndef F_CPU 29:../../oulib/include/oulib.h **** #error "F_CPU must be defined" 30:../../oulib/include/oulib.h **** #endif 31:../../oulib/include/oulib.h **** 32:../../oulib/include/oulib.h **** // The latter test allows us to deal with the fact that AVRstudio 33:../../oulib/include/oulib.h **** // resets our F_CPU parameter 34:../../oulib/include/oulib.h **** #if (F_CPU == 160000UL) 35:../../oulib/include/oulib.h **** #define MS_SHIFT 4 36:../../oulib/include/oulib.h **** #define MS_GATE 0x0f 37:../../oulib/include/oulib.h **** #undef F_CPU 38:../../oulib/include/oulib.h **** #define F_CPU 16000000 39:../../oulib/include/oulib.h **** #elif (F_CPU == 16000000) 40:../../oulib/include/oulib.h **** #define MS_SHIFT 4 41:../../oulib/include/oulib.h **** #define MS_GATE 0x0f 42:../../oulib/include/oulib.h **** #elif (F_CPU == 8000000) 43:../../oulib/include/oulib.h **** #define MS_SHIFT 5 44:../../oulib/include/oulib.h **** #define MS_GATE 0x1f 45:../../oulib/include/oulib.h **** #elif (F_CPU == 1000000) 46:../../oulib/include/oulib.h **** #define MS_SHIFT 8 47:../../oulib/include/oulib.h **** #define MS_GATE 0xff 48:../../oulib/include/oulib.h **** #else 49:../../oulib/include/oulib.h **** #error "Bad F_CPU specification" 50:../../oulib/include/oulib.h **** #endif 51:../../oulib/include/oulib.h **** 52:../../oulib/include/oulib.h **** //Using AtMega168: define standard register names 53:../../oulib/include/oulib.h **** #ifdef atmega168 54:../../oulib/include/oulib.h **** # define TCCR0 TCCR0B 55:../../oulib/include/oulib.h **** # define TCCR2 TCCR2B 56:../../oulib/include/oulib.h **** # define UCSRA UCSR0A 57:../../oulib/include/oulib.h **** # define UCSRB UCSR0B 58:../../oulib/include/oulib.h **** # define UDR UDR0 59:../../oulib/include/oulib.h **** # define UDRE UDRE0 60:../../oulib/include/oulib.h **** # define RXC RXC0 61:../../oulib/include/oulib.h **** # define RXEN RXEN0 62:../../oulib/include/oulib.h **** # define TXEN TXEN0 63:../../oulib/include/oulib.h **** # define UBRRH UBRR0H 64:../../oulib/include/oulib.h **** # define UBRRL UBRR0L 65:../../oulib/include/oulib.h **** # define TICIE1 ICIE1 66:../../oulib/include/oulib.h **** # define RXCIE RXCIE0 67:../../oulib/include/oulib.h **** # define UDRIE UDRIE0 68:../../oulib/include/oulib.h **** //# define TIMSK TIMSK1 69:../../oulib/include/oulib.h **** #define CPU_DEFINED 70:../../oulib/include/oulib.h **** #endif 71:../../oulib/include/oulib.h **** 72:../../oulib/include/oulib.h **** #ifdef at90usb1287 73:../../oulib/include/oulib.h **** # define TCCR0 TCCR0B 74:../../oulib/include/oulib.h **** # define TCCR2 TCCR2B 75:../../oulib/include/oulib.h **** # define UCSRA UCSR1A 76:../../oulib/include/oulib.h **** # define UCSRB UCSR1B 77:../../oulib/include/oulib.h **** //# define TIMSK2 TIMSK 78:../../oulib/include/oulib.h **** # define UDR UDR1 79:../../oulib/include/oulib.h **** # define UDRE UDRE1 80:../../oulib/include/oulib.h **** # define RXC RXC1 81:../../oulib/include/oulib.h **** # define RXEN RXEN1 82:../../oulib/include/oulib.h **** # define TXEN TXEN1 83:../../oulib/include/oulib.h **** # define UBRRH UBRR1H 84:../../oulib/include/oulib.h **** # define UBRRL UBRR1L 85:../../oulib/include/oulib.h **** //# define TICIE1 ICIE1 86:../../oulib/include/oulib.h **** # define RXCIE RXCIE1 87:../../oulib/include/oulib.h **** # define UDRIE UDRIE1 88:../../oulib/include/oulib.h **** //# define TIMSK TIMSK1 89:../../oulib/include/oulib.h **** #define USART_RXC_vect USART1_RX_vect 90:../../oulib/include/oulib.h **** #define USART_UDRE_vect USART1_UDRE_vect 91:../../oulib/include/oulib.h **** #define CPU_DEFINED 92:../../oulib/include/oulib.h **** #endif 93:../../oulib/include/oulib.h **** 94:../../oulib/include/oulib.h **** #ifdef atmega644p 95:../../oulib/include/oulib.h **** # define TCCR0 TCCR0B 96:../../oulib/include/oulib.h **** # define TCCR2 TCCR2B 97:../../oulib/include/oulib.h **** # define UCSRA UCSR0A 98:../../oulib/include/oulib.h **** # define UCSRB UCSR0B 99:../../oulib/include/oulib.h **** # define UDR UDR0 100:../../oulib/include/oulib.h **** # define UDRE UDRE0 101:../../oulib/include/oulib.h **** # define RXC RXC0 102:../../oulib/include/oulib.h **** # define RXEN RXEN0 103:../../oulib/include/oulib.h **** # define TXEN TXEN0 104:../../oulib/include/oulib.h **** # define UBRRH UBRR0H 105:../../oulib/include/oulib.h **** # define UBRRL UBRR0L 106:../../oulib/include/oulib.h **** //# define TICIE1 ICIE1 107:../../oulib/include/oulib.h **** //# define TIMSK TIMSK1 108:../../oulib/include/oulib.h **** // Indicate that we have more than 1 serial port 109:../../oulib/include/oulib.h **** #define SERIAL_NPORTS_2 110:../../oulib/include/oulib.h **** #define CPU_DEFINED 111:../../oulib/include/oulib.h **** #endif 112:../../oulib/include/oulib.h **** 113:../../oulib/include/oulib.h **** #ifdef atmega2560 114:../../oulib/include/oulib.h **** # define TCCR0 TCCR0B 115:../../oulib/include/oulib.h **** # define TCCR2 TCCR2B 116:../../oulib/include/oulib.h **** # define UCSRA UCSR0A 117:../../oulib/include/oulib.h **** # define UCSRB UCSR0B 118:../../oulib/include/oulib.h **** # define UDR UDR0 119:../../oulib/include/oulib.h **** # define UDRE UDRE0 120:../../oulib/include/oulib.h **** # define RXC RXC0 121:../../oulib/include/oulib.h **** # define RXEN RXEN0 122:../../oulib/include/oulib.h **** # define TXEN TXEN0 123:../../oulib/include/oulib.h **** # define UBRRH UBRR0H 124:../../oulib/include/oulib.h **** # define UBRRL UBRR0L 125:../../oulib/include/oulib.h **** # define RXCIE RXCIE0 126:../../oulib/include/oulib.h **** # define UDRIE UDRIE0 127:../../oulib/include/oulib.h **** //# define TICIE1 ICIE1 128:../../oulib/include/oulib.h **** //# define TIMSK TIMSK1 129:../../oulib/include/oulib.h **** // Indicate that we have 4 serial ports 130:../../oulib/include/oulib.h **** #define SERIAL_NPORTS_4 131:../../oulib/include/oulib.h **** #define TIMER1B 132:../../oulib/include/oulib.h **** #define TIMER1C 133:../../oulib/include/oulib.h **** #define CPU_DEFINED 134:../../oulib/include/oulib.h **** #define TIMER3 135:../../oulib/include/oulib.h **** #define TIMER4 136:../../oulib/include/oulib.h **** #define TIMER5 137:../../oulib/include/oulib.h **** #define ADC_CHANS_16 138:../../oulib/include/oulib.h **** #endif 139:../../oulib/include/oulib.h **** 140:../../oulib/include/oulib.h **** 141:../../oulib/include/oulib.h **** #ifdef atmega8 142:../../oulib/include/oulib.h **** #define UCSR0B UCSRB 143:../../oulib/include/oulib.h **** #define UDRIE0 UDRIE 144:../../oulib/include/oulib.h **** #define RXCIE0 RXCIE 145:../../oulib/include/oulib.h **** 146:../../oulib/include/oulib.h **** #define CPU_DEFINED 147:../../oulib/include/oulib.h **** #endif 148:../../oulib/include/oulib.h **** 149:../../oulib/include/oulib.h **** #ifdef atmega88 150:../../oulib/include/oulib.h **** #define CPU_DEFINED 151:../../oulib/include/oulib.h **** #endif 152:../../oulib/include/oulib.h **** 153:../../oulib/include/oulib.h **** #ifndef CPU_DEFINED 154:../../oulib/include/oulib.h **** #error "Missing definitions: CDEFS = -DF_CPU=16000000 -D$(MCU)" 155:../../oulib/include/oulib.h **** #endif 156:../../oulib/include/oulib.h **** 157:../../oulib/include/oulib.h **** /////////////////////////////////////////////////// 158:../../oulib/include/oulib.h **** // Serial 159:../../oulib/include/oulib.h **** /** 160:../../oulib/include/oulib.h **** File pointer structure for unbuffered serial ports. 161:../../oulib/include/oulib.h **** */ 162:../../oulib/include/oulib.h **** struct OU_FILE { 163:../../oulib/include/oulib.h **** /** Reference to physical serial port. 0 .. 3, depending on hardware */ 164:../../oulib/include/oulib.h **** uint8_t port; 165:../../oulib/include/oulib.h **** }; 166:../../oulib/include/oulib.h **** 167:../../oulib/include/oulib.h **** /** 168:../../oulib/include/oulib.h **** struct OU_FILE_BUF 169:../../oulib/include/oulib.h **** 170:../../oulib/include/oulib.h **** File pointer structure for buffered serial ports. 171:../../oulib/include/oulib.h **** 172:../../oulib/include/oulib.h **** */ 173:../../oulib/include/oulib.h **** struct OU_FILE_BUF { 174:../../oulib/include/oulib.h **** /** Reference to physical serial port. 0 .. 3, depending on hardware */ 175:../../oulib/include/oulib.h **** uint8_t port; 176:../../oulib/include/oulib.h **** /** Number of bytes in input buffer. */ 177:../../oulib/include/oulib.h **** uint8_t buf_size_in; 178:../../oulib/include/oulib.h **** /** Number of bytes in output buffer. */ 179:../../oulib/include/oulib.h **** uint8_t buf_size_out; 180:../../oulib/include/oulib.h **** /** Index of the front of the input buffer. */ 181:../../oulib/include/oulib.h **** volatile uint8_t buf_in_front; 182:../../oulib/include/oulib.h **** /** Index of the back of the input buffer (index of the next char spot). */ 183:../../oulib/include/oulib.h **** volatile uint8_t buf_in_back; 184:../../oulib/include/oulib.h **** /** Index of the front of the output buffer. */ 185:../../oulib/include/oulib.h **** volatile uint8_t buf_out_front; 186:../../oulib/include/oulib.h **** /** Index of the back of the output buffer (index of the next char spot). */ 187:../../oulib/include/oulib.h **** volatile uint8_t buf_out_back; 188:../../oulib/include/oulib.h **** /** Reference to the buffer space. */ 189:../../oulib/include/oulib.h **** char *buffer; 190:../../oulib/include/oulib.h **** }; 191:../../oulib/include/oulib.h **** 192:../../oulib/include/oulib.h **** // Having this global variable is ugly: need to clean this up 193:../../oulib/include/oulib.h **** // There must be a way to get to the stdlib stream list... 194:../../oulib/include/oulib.h **** 195:../../oulib/include/oulib.h **** #ifndef SERIAL_NPORTS_2 196:../../oulib/include/oulib.h **** #ifndef SERIAL_NPORTS_4 197:../../oulib/include/oulib.h **** extern struct OU_FILE_BUF *ou_file_buf[1]; 198:../../oulib/include/oulib.h **** #else 199:../../oulib/include/oulib.h **** extern struct OU_FILE_BUF *ou_file_buf[4]; 200:../../oulib/include/oulib.h **** #endif 201:../../oulib/include/oulib.h **** #else 202:../../oulib/include/oulib.h **** extern struct OU_FILE_BUF *ou_file_buf[2]; 203:../../oulib/include/oulib.h **** #endif 204:../../oulib/include/oulib.h **** 205:../../oulib/include/oulib.h **** /////////////////////////////////////////////////////////////// 206:../../oulib/include/oulib.h **** // Serial interrupt enable/disable 207:../../oulib/include/oulib.h **** /** 208:../../oulib/include/oulib.h **** Enable the receive interrupt for serial port 0. 209:../../oulib/include/oulib.h **** 210:../../oulib/include/oulib.h **** @author Andrew H. Fagg 211:../../oulib/include/oulib.h **** 212:../../oulib/include/oulib.h **** \ingroup serial 213:../../oulib/include/oulib.h **** 214:../../oulib/include/oulib.h **** */ 215:../../oulib/include/oulib.h **** inline void serial0_receive_enable(void) { 216:../../oulib/include/oulib.h **** UCSR0B |= _BV(RXCIE0); 217:../../oulib/include/oulib.h **** } 218:../../oulib/include/oulib.h **** 219:../../oulib/include/oulib.h **** 220:../../oulib/include/oulib.h **** /** 221:../../oulib/include/oulib.h **** Disable the receive interrupt for serial port 0. 222:../../oulib/include/oulib.h **** 223:../../oulib/include/oulib.h **** @author Andrew H. Fagg 224:../../oulib/include/oulib.h **** 225:../../oulib/include/oulib.h **** \ingroup serial 226:../../oulib/include/oulib.h **** 227:../../oulib/include/oulib.h **** */ 228:../../oulib/include/oulib.h **** inline void serial0_receive_disable(void) { 229:../../oulib/include/oulib.h **** UCSR0B &= ~_BV(RXCIE0); 230:../../oulib/include/oulib.h **** } 231:../../oulib/include/oulib.h **** 232:../../oulib/include/oulib.h **** /** 233:../../oulib/include/oulib.h **** Enable the transmit interrupt for serial port 0. 234:../../oulib/include/oulib.h **** 235:../../oulib/include/oulib.h **** @author Andrew H. Fagg 236:../../oulib/include/oulib.h **** 237:../../oulib/include/oulib.h **** \ingroup serial 238:../../oulib/include/oulib.h **** 239:../../oulib/include/oulib.h **** */ 240:../../oulib/include/oulib.h **** inline void serial0_transmit_enable(void) { 241:../../oulib/include/oulib.h **** UCSR0B |= _BV(UDRIE0); 242:../../oulib/include/oulib.h **** } 243:../../oulib/include/oulib.h **** 244:../../oulib/include/oulib.h **** /** 245:../../oulib/include/oulib.h **** Disable the transmit interrupt for serial port 0. 246:../../oulib/include/oulib.h **** 247:../../oulib/include/oulib.h **** @author Andrew H. Fagg 248:../../oulib/include/oulib.h **** 249:../../oulib/include/oulib.h **** \ingroup serial 250:../../oulib/include/oulib.h **** 251:../../oulib/include/oulib.h **** */ 252:../../oulib/include/oulib.h **** inline void serial0_transmit_disable(void) { 253:../../oulib/include/oulib.h **** UCSR0B &= ~_BV(UDRIE0); 254:../../oulib/include/oulib.h **** } 255:../../oulib/include/oulib.h **** 256:../../oulib/include/oulib.h **** 257:../../oulib/include/oulib.h **** #if defined(SERIAL_NPORTS_2) || defined(SERIAL_NPORTS_4) 258:../../oulib/include/oulib.h **** /** 259:../../oulib/include/oulib.h **** Enable the receive interrupt for serial port 1. 260:../../oulib/include/oulib.h **** 261:../../oulib/include/oulib.h **** Note: only available for chips with two or more serial ports. 262:../../oulib/include/oulib.h **** 263:../../oulib/include/oulib.h **** @author Andrew H. Fagg 264:../../oulib/include/oulib.h **** 265:../../oulib/include/oulib.h **** \ingroup serial 266:../../oulib/include/oulib.h **** 267:../../oulib/include/oulib.h **** */ 268:../../oulib/include/oulib.h **** inline void serial1_receive_enable(void) { 269:../../oulib/include/oulib.h **** UCSR1B |= _BV(RXCIE1); 270:../../oulib/include/oulib.h **** } 271:../../oulib/include/oulib.h **** 272:../../oulib/include/oulib.h **** /** 273:../../oulib/include/oulib.h **** Disable the receive interrupt for serial port 1. 274:../../oulib/include/oulib.h **** 275:../../oulib/include/oulib.h **** Note: only available for chips with two or more serial ports. 276:../../oulib/include/oulib.h **** 277:../../oulib/include/oulib.h **** @author Andrew H. Fagg 278:../../oulib/include/oulib.h **** 279:../../oulib/include/oulib.h **** \ingroup serial 280:../../oulib/include/oulib.h **** 281:../../oulib/include/oulib.h **** */ 282:../../oulib/include/oulib.h **** inline void serial1_receive_disable(void) { 283:../../oulib/include/oulib.h **** UCSR1B &= ~_BV(RXCIE1); 284:../../oulib/include/oulib.h **** } 285:../../oulib/include/oulib.h **** 286:../../oulib/include/oulib.h **** 287:../../oulib/include/oulib.h **** /** 288:../../oulib/include/oulib.h **** Enable the transmit interrupt for serial port 1. 289:../../oulib/include/oulib.h **** 290:../../oulib/include/oulib.h **** Note: only available for chips with two or more serial ports. 291:../../oulib/include/oulib.h **** 292:../../oulib/include/oulib.h **** @author Andrew H. Fagg 293:../../oulib/include/oulib.h **** 294:../../oulib/include/oulib.h **** \ingroup serial 295:../../oulib/include/oulib.h **** 296:../../oulib/include/oulib.h **** */ 297:../../oulib/include/oulib.h **** inline void serial1_transmit_enable(void) { 298:../../oulib/include/oulib.h **** UCSR1B |= _BV(UDRIE1); 299:../../oulib/include/oulib.h **** } 300:../../oulib/include/oulib.h **** 301:../../oulib/include/oulib.h **** /** 302:../../oulib/include/oulib.h **** Disable the transmit interrupt for serial port 1. 303:../../oulib/include/oulib.h **** 304:../../oulib/include/oulib.h **** Note: only available for chips with two or more serial ports. 305:../../oulib/include/oulib.h **** 306:../../oulib/include/oulib.h **** @author Andrew H. Fagg 307:../../oulib/include/oulib.h **** 308:../../oulib/include/oulib.h **** \ingroup serial 309:../../oulib/include/oulib.h **** 310:../../oulib/include/oulib.h **** */ 311:../../oulib/include/oulib.h **** inline void serial1_transmit_disable(void) { 312:../../oulib/include/oulib.h **** UCSR1B &= ~_BV(UDRIE1); 313:../../oulib/include/oulib.h **** } 314:../../oulib/include/oulib.h **** #endif 315:../../oulib/include/oulib.h **** 316:../../oulib/include/oulib.h **** 317:../../oulib/include/oulib.h **** #if defined(SERIAL_NPORTS_4) 318:../../oulib/include/oulib.h **** 319:../../oulib/include/oulib.h **** /** 320:../../oulib/include/oulib.h **** Enable the transmit interrupt for serial port 2. 321:../../oulib/include/oulib.h **** 322:../../oulib/include/oulib.h **** Note: only available for chips with four or more serial ports. 323:../../oulib/include/oulib.h **** 324:../../oulib/include/oulib.h **** @author Andrew H. Fagg 325:../../oulib/include/oulib.h **** 326:../../oulib/include/oulib.h **** \ingroup serial 327:../../oulib/include/oulib.h **** 328:../../oulib/include/oulib.h **** */ 329:../../oulib/include/oulib.h **** inline void serial2_transmit_enable(void) { 330:../../oulib/include/oulib.h **** UCSR2B |= _BV(UDRIE2); 331:../../oulib/include/oulib.h **** } 332:../../oulib/include/oulib.h **** 333:../../oulib/include/oulib.h **** /** 334:../../oulib/include/oulib.h **** Disable the transmit interrupt for serial port 2. 335:../../oulib/include/oulib.h **** 336:../../oulib/include/oulib.h **** Note: only available for chips with four or more serial ports. 337:../../oulib/include/oulib.h **** 338:../../oulib/include/oulib.h **** @author Andrew H. Fagg 339:../../oulib/include/oulib.h **** 340:../../oulib/include/oulib.h **** \ingroup serial 341:../../oulib/include/oulib.h **** 342:../../oulib/include/oulib.h **** */ 343:../../oulib/include/oulib.h **** inline void serial2_transmit_disable(void) { 344:../../oulib/include/oulib.h **** UCSR2B &= ~_BV(UDRIE2); 345:../../oulib/include/oulib.h **** } 346:../../oulib/include/oulib.h **** 347:../../oulib/include/oulib.h **** /** 348:../../oulib/include/oulib.h **** Enable the transmit interrupt for serial port 3. 349:../../oulib/include/oulib.h **** 350:../../oulib/include/oulib.h **** Note: only available for chips with four or more serial ports. 351:../../oulib/include/oulib.h **** 352:../../oulib/include/oulib.h **** @author Andrew H. Fagg 353:../../oulib/include/oulib.h **** 354:../../oulib/include/oulib.h **** \ingroup serial 355:../../oulib/include/oulib.h **** 356:../../oulib/include/oulib.h **** */ 357:../../oulib/include/oulib.h **** inline void serial3_transmit_enable(void) { 358:../../oulib/include/oulib.h **** UCSR3B |= _BV(UDRIE3); 359:../../oulib/include/oulib.h **** } 360:../../oulib/include/oulib.h **** 361:../../oulib/include/oulib.h **** /** 362:../../oulib/include/oulib.h **** Disable the transmit interrupt for serial port 3. 363:../../oulib/include/oulib.h **** 364:../../oulib/include/oulib.h **** Note: only available for chips with four or more serial ports. 365:../../oulib/include/oulib.h **** 366:../../oulib/include/oulib.h **** @author Andrew H. Fagg 367:../../oulib/include/oulib.h **** 368:../../oulib/include/oulib.h **** \ingroup serial 369:../../oulib/include/oulib.h **** 370:../../oulib/include/oulib.h **** */ 371:../../oulib/include/oulib.h **** inline void serial3_transmit_disable(void) { 372:../../oulib/include/oulib.h **** UCSR3B &= ~_BV(UDRIE3); 373:../../oulib/include/oulib.h **** } 374:../../oulib/include/oulib.h **** 375:../../oulib/include/oulib.h **** /** 376:../../oulib/include/oulib.h **** Enable the receive interrupt for serial port 2. 377:../../oulib/include/oulib.h **** 378:../../oulib/include/oulib.h **** Note: only available for chips with four or more serial ports. 379:../../oulib/include/oulib.h **** 380:../../oulib/include/oulib.h **** @author Andrew H. Fagg 381:../../oulib/include/oulib.h **** 382:../../oulib/include/oulib.h **** \ingroup serial 383:../../oulib/include/oulib.h **** 384:../../oulib/include/oulib.h **** */ 385:../../oulib/include/oulib.h **** inline void serial2_receive_enable(void) { 386:../../oulib/include/oulib.h **** UCSR2B |= _BV(RXCIE2); 387:../../oulib/include/oulib.h **** } 388:../../oulib/include/oulib.h **** 389:../../oulib/include/oulib.h **** /** 390:../../oulib/include/oulib.h **** Disable the receive interrupt for serial port 2. 391:../../oulib/include/oulib.h **** 392:../../oulib/include/oulib.h **** Note: only available for chips with four or more serial ports. 393:../../oulib/include/oulib.h **** 394:../../oulib/include/oulib.h **** @author Andrew H. Fagg 395:../../oulib/include/oulib.h **** 396:../../oulib/include/oulib.h **** \ingroup serial 397:../../oulib/include/oulib.h **** 398:../../oulib/include/oulib.h **** */ 399:../../oulib/include/oulib.h **** inline void serial2_receive_disable(void) { 400:../../oulib/include/oulib.h **** UCSR2B &= ~_BV(RXCIE2); 401:../../oulib/include/oulib.h **** } 402:../../oulib/include/oulib.h **** 403:../../oulib/include/oulib.h **** /** 404:../../oulib/include/oulib.h **** Enable the receive interrupt for serial port 3. 405:../../oulib/include/oulib.h **** 406:../../oulib/include/oulib.h **** Note: only available for chips with four or more serial ports. 407:../../oulib/include/oulib.h **** 408:../../oulib/include/oulib.h **** @author Andrew H. Fagg 409:../../oulib/include/oulib.h **** 410:../../oulib/include/oulib.h **** \ingroup serial 411:../../oulib/include/oulib.h **** 412:../../oulib/include/oulib.h **** */ 413:../../oulib/include/oulib.h **** inline void serial3_receive_enable(void) { 414:../../oulib/include/oulib.h **** UCSR3B |= _BV(RXCIE3); 415:../../oulib/include/oulib.h **** } 416:../../oulib/include/oulib.h **** 417:../../oulib/include/oulib.h **** /** 418:../../oulib/include/oulib.h **** Disable the receive interrupt for serial port 3. 419:../../oulib/include/oulib.h **** 420:../../oulib/include/oulib.h **** Note: only available for chips with four or more serial ports. 421:../../oulib/include/oulib.h **** 422:../../oulib/include/oulib.h **** @author Andrew H. Fagg 423:../../oulib/include/oulib.h **** 424:../../oulib/include/oulib.h **** \ingroup serial 425:../../oulib/include/oulib.h **** 426:../../oulib/include/oulib.h **** */ 427:../../oulib/include/oulib.h **** inline void serial3_receive_disable(void) { 428:../../oulib/include/oulib.h **** UCSR3B &= ~_BV(RXCIE3); 429:../../oulib/include/oulib.h **** } 430:../../oulib/include/oulib.h **** 431:../../oulib/include/oulib.h **** #endif 432:../../oulib/include/oulib.h **** 433:../../oulib/include/oulib.h **** 434:../../oulib/include/oulib.h **** /////////////////////////////////////////////////// 435:../../oulib/include/oulib.h **** // Delay 436:../../oulib/include/oulib.h **** 437:../../oulib/include/oulib.h **** extern void delay_ms(unsigned int); 438:../../oulib/include/oulib.h **** extern void delay_us(unsigned int); 439:../../oulib/include/oulib.h **** 440:../../oulib/include/oulib.h **** /////////////////////////////////////////////////// 441:../../oulib/include/oulib.h **** // Timer0 442:../../oulib/include/oulib.h **** extern void timer0_config(uint8_t config); 443:../../oulib/include/oulib.h **** 444:../../oulib/include/oulib.h **** // Possible configuration parameters for timer0_config() 445:../../oulib/include/oulib.h **** 446:../../oulib/include/oulib.h **** #define TIMER0_NOCLK 0 447:../../oulib/include/oulib.h **** #define TIMER0_NOPRE 1 448:../../oulib/include/oulib.h **** #define TIMER0_PRE_8 2 449:../../oulib/include/oulib.h **** #define TIMER0_PRE_64 3 450:../../oulib/include/oulib.h **** #define TIMER0_PRE_256 4 451:../../oulib/include/oulib.h **** #define TIMER0_PRE_1024 5 452:../../oulib/include/oulib.h **** #define TIMER0_EXT_FALLING 6 453:../../oulib/include/oulib.h **** #define TIMER0_EXT_RISING 7 454:../../oulib/include/oulib.h **** 455:../../oulib/include/oulib.h **** //extern inline void timer0_enable(void); 456:../../oulib/include/oulib.h **** //extern inline void timer0_disable(void); 457:../../oulib/include/oulib.h **** //extern inline unsigned char timer0_read(void); 458:../../oulib/include/oulib.h **** //extern inline void timer0_set(unsigned char val); 459:../../oulib/include/oulib.h **** 460:../../oulib/include/oulib.h **** ///////////////////////////////////////////////////////////////////// 461:../../oulib/include/oulib.h **** // Timer 1 462:../../oulib/include/oulib.h **** extern void timer1_config(uint8_t config); 463:../../oulib/include/oulib.h **** 464:../../oulib/include/oulib.h **** #define TIMER1_NOCLK 0 465:../../oulib/include/oulib.h **** #define TIMER1_NOPRE 1 466:../../oulib/include/oulib.h **** #define TIMER1_PRE_8 2 467:../../oulib/include/oulib.h **** #define TIMER1_PRE_64 3 468:../../oulib/include/oulib.h **** #define TIMER1_PRE_256 4 469:../../oulib/include/oulib.h **** #define TIMER1_PRE_1024 5 470:../../oulib/include/oulib.h **** #define TIMER1_EXT_FALLING 6 471:../../oulib/include/oulib.h **** #define TIMER1_EXT_RISING 7 472:../../oulib/include/oulib.h **** 473:../../oulib/include/oulib.h **** //extern inline void timer1_enable(void); 474:../../oulib/include/oulib.h **** //extern inline void timer1_disable(void); 475:../../oulib/include/oulib.h **** 476:../../oulib/include/oulib.h **** 477:../../oulib/include/oulib.h **** extern uint16_t timer1_read(void); 478:../../oulib/include/oulib.h **** extern void timer1_set(uint16_t); 479:../../oulib/include/oulib.h **** 480:../../oulib/include/oulib.h **** extern void timer1_output_compare_config(uint8_t config); 481:../../oulib/include/oulib.h **** 482:../../oulib/include/oulib.h **** #define TIMER1_OUTPUT_COMPARE_CONFIG_NORMAL 0x0 483:../../oulib/include/oulib.h **** #define TIMER1_OUTPUT_COMPARE_CONFIG_PWM_PC_08 0x1 484:../../oulib/include/oulib.h **** #define TIMER1_OUTPUT_COMPARE_CONFIG_PWM_PC_09 0x2 485:../../oulib/include/oulib.h **** #define TIMER1_OUTPUT_COMPARE_CONFIG_PWM_PC_10 0x3 486:../../oulib/include/oulib.h **** #define TIMER1_OUTPUT_COMPARE_CONFIG_CTC_OCR1A 0x4 487:../../oulib/include/oulib.h **** #define TIMER1_OUTPUT_COMPARE_CONFIG_PWM_F_08 0x5 488:../../oulib/include/oulib.h **** #define TIMER1_OUTPUT_COMPARE_CONFIG_PWM_F_09 0x6 489:../../oulib/include/oulib.h **** #define TIMER1_OUTPUT_COMPARE_CONFIG_PWM_F_10 0x7 490:../../oulib/include/oulib.h **** #define TIMER1_OUTPUT_COMPARE_CONFIG_PWM_PFC_ICR1 0x8 491:../../oulib/include/oulib.h **** #define TIMER1_OUTPUT_COMPARE_CONFIG_PWM_PFC_OCR1A 0x9 492:../../oulib/include/oulib.h **** #define TIMER1_OUTPUT_COMPARE_CONFIG_PWM_PC_ICR1 0xa 493:../../oulib/include/oulib.h **** #define TIMER1_OUTPUT_COMPARE_CONFIG_PWM_PC_OCR1A 0xb 494:../../oulib/include/oulib.h **** #define TIMER1_OUTPUT_COMPARE_CONFIG_CTC_ICR1 0xc 495:../../oulib/include/oulib.h **** #define TIMER1_OUTPUT_COMPARE_CONFIG_PWM_F_ICR1 0xe 496:../../oulib/include/oulib.h **** #define TIMER1_OUTPUT_COMPARE_CONFIG_PWM_F_OCR1A 0xf 497:../../oulib/include/oulib.h **** 498:../../oulib/include/oulib.h **** 499:../../oulib/include/oulib.h **** extern void timer1_output_compare_A_set(uint16_t val); 500:../../oulib/include/oulib.h **** extern uint16_t timer1_output_compare_A_read(void); 501:../../oulib/include/oulib.h **** 502:../../oulib/include/oulib.h **** extern void timer1_compare_output_A_mode_set(uint8_t mode); 503:../../oulib/include/oulib.h **** 504:../../oulib/include/oulib.h **** // Valid modes 505:../../oulib/include/oulib.h **** #define TIMER16B_COMPARE_OUTPUT_MODE_NORMAL 0 506:../../oulib/include/oulib.h **** #define TIMER16B_COMPARE_OUTPUT_MODE_TOGGLE 1 507:../../oulib/include/oulib.h **** #define TIMER16B_COMPARE_OUTPUT_MODE_CLEAR 2 508:../../oulib/include/oulib.h **** #define TIMER16B_COMPARE_OUTPUT_MODE_SET 3 509:../../oulib/include/oulib.h **** 510:../../oulib/include/oulib.h **** #ifdef TIMER1B 511:../../oulib/include/oulib.h **** extern void timer1_output_compare_B_set(uint16_t val); 512:../../oulib/include/oulib.h **** extern uint16_t timer1_output_compare_B_read(void); 513:../../oulib/include/oulib.h **** extern void timer1_compare_output_B_mode_set(uint8_t mode); 514:../../oulib/include/oulib.h **** #endif 515:../../oulib/include/oulib.h **** 516:../../oulib/include/oulib.h **** #ifdef TIMER1C 517:../../oulib/include/oulib.h **** extern void timer1_output_compare_C_set(uint16_t val); 518:../../oulib/include/oulib.h **** extern uint16_t timer1_output_compare_C_read(void); 519:../../oulib/include/oulib.h **** extern void timer1_compare_output_C_mode_set(uint8_t mode); 520:../../oulib/include/oulib.h **** #endif 521:../../oulib/include/oulib.h **** 522:../../oulib/include/oulib.h **** 523:../../oulib/include/oulib.h **** 524:../../oulib/include/oulib.h **** 525:../../oulib/include/oulib.h **** //////////////////////////////////////////////////////////// 526:../../oulib/include/oulib.h **** // Timer 2 527:../../oulib/include/oulib.h **** extern void timer2_config(uint8_t config); 528:../../oulib/include/oulib.h **** 529:../../oulib/include/oulib.h **** 530:../../oulib/include/oulib.h **** #define TIMER2_NOCLK 0 531:../../oulib/include/oulib.h **** #define TIMER2_NOPRE 1 532:../../oulib/include/oulib.h **** #define TIMER2_PRE_8 2 533:../../oulib/include/oulib.h **** #define TIMER2_PRE_32 3 534:../../oulib/include/oulib.h **** #define TIMER2_PRE_64 4 535:../../oulib/include/oulib.h **** #define TIMER2_PRE_128 5 536:../../oulib/include/oulib.h **** #define TIMER2_PRE_256 6 537:../../oulib/include/oulib.h **** #define TIMER2_PRE_1024 7 538:../../oulib/include/oulib.h **** 539:../../oulib/include/oulib.h **** ///////////////////////////////////////////////////////////////////// 540:../../oulib/include/oulib.h **** // Timer 3 541:../../oulib/include/oulib.h **** #ifdef TIMER3 542:../../oulib/include/oulib.h **** extern void timer3_config(uint8_t config); 543:../../oulib/include/oulib.h **** 544:../../oulib/include/oulib.h **** #define TIMER3_NOCLK 0 545:../../oulib/include/oulib.h **** #define TIMER3_NOPRE 1 546:../../oulib/include/oulib.h **** #define TIMER3_PRE_8 2 547:../../oulib/include/oulib.h **** #define TIMER3_PRE_64 3 548:../../oulib/include/oulib.h **** #define TIMER3_PRE_256 4 549:../../oulib/include/oulib.h **** #define TIMER3_PRE_1024 5 550:../../oulib/include/oulib.h **** #define TIMER3_EXT_FALLING 6 551:../../oulib/include/oulib.h **** #define TIMER3_EXT_RISING 7 552:../../oulib/include/oulib.h **** 553:../../oulib/include/oulib.h **** extern uint16_t timer3_read(void); 554:../../oulib/include/oulib.h **** extern void timer3_set(uint16_t); 555:../../oulib/include/oulib.h **** 556:../../oulib/include/oulib.h **** extern void timer3_output_compare_config(uint8_t config); 557:../../oulib/include/oulib.h **** 558:../../oulib/include/oulib.h **** #define TIMER3_OUTPUT_COMPARE_CONFIG_NORMAL 0x0 559:../../oulib/include/oulib.h **** #define TIMER3_OUTPUT_COMPARE_CONFIG_PWM_PC_08 0x1 560:../../oulib/include/oulib.h **** #define TIMER3_OUTPUT_COMPARE_CONFIG_PWM_PC_09 0x2 561:../../oulib/include/oulib.h **** #define TIMER3_OUTPUT_COMPARE_CONFIG_PWM_PC_10 0x3 562:../../oulib/include/oulib.h **** #define TIMER3_OUTPUT_COMPARE_CONFIG_CTC_OCR1A 0x4 563:../../oulib/include/oulib.h **** #define TIMER3_OUTPUT_COMPARE_CONFIG_PWM_F_08 0x5 564:../../oulib/include/oulib.h **** #define TIMER3_OUTPUT_COMPARE_CONFIG_PWM_F_09 0x6 565:../../oulib/include/oulib.h **** #define TIMER3_OUTPUT_COMPARE_CONFIG_PWM_F_10 0x7 566:../../oulib/include/oulib.h **** #define TIMER3_OUTPUT_COMPARE_CONFIG_PWM_PFC_ICR1 0x8 567:../../oulib/include/oulib.h **** #define TIMER3_OUTPUT_COMPARE_CONFIG_PWM_PFC_OCR1A 0x9 568:../../oulib/include/oulib.h **** #define TIMER3_OUTPUT_COMPARE_CONFIG_PWM_PC_ICR1 0xa 569:../../oulib/include/oulib.h **** #define TIMER3_OUTPUT_COMPARE_CONFIG_PWM_PC_OCR1A 0xb 570:../../oulib/include/oulib.h **** #define TIMER3_OUTPUT_COMPARE_CONFIG_CTC_ICR1 0xc 571:../../oulib/include/oulib.h **** #define TIMER3_OUTPUT_COMPARE_CONFIG_PWM_F_ICR1 0xe 572:../../oulib/include/oulib.h **** #define TIMER3_OUTPUT_COMPARE_CONFIG_PWM_F_OCR1A 0xf 573:../../oulib/include/oulib.h **** 574:../../oulib/include/oulib.h **** 575:../../oulib/include/oulib.h **** extern void timer3_output_compare_A_set(uint16_t val); 576:../../oulib/include/oulib.h **** extern uint16_t timer3_output_compare_A_read(void); 577:../../oulib/include/oulib.h **** extern void timer3_compare_output_A_mode_set(uint8_t mode); 578:../../oulib/include/oulib.h **** 579:../../oulib/include/oulib.h **** extern void timer3_output_compare_B_set(uint16_t val); 580:../../oulib/include/oulib.h **** extern uint16_t timer3_output_compare_B_read(void); 581:../../oulib/include/oulib.h **** extern void timer3_compare_output_B_mode_set(uint8_t mode); 582:../../oulib/include/oulib.h **** 583:../../oulib/include/oulib.h **** extern void timer3_output_compare_C_set(uint16_t val); 584:../../oulib/include/oulib.h **** extern uint16_t timer3_output_compare_C_read(void); 585:../../oulib/include/oulib.h **** extern void timer3_compare_output_C_mode_set(uint8_t mode); 586:../../oulib/include/oulib.h **** 587:../../oulib/include/oulib.h **** /** 588:../../oulib/include/oulib.h **** Enable the timer 3 overflow interrupt. 589:../../oulib/include/oulib.h **** 590:../../oulib/include/oulib.h **** @author Andrew H. Fagg 591:../../oulib/include/oulib.h **** 592:../../oulib/include/oulib.h **** \ingroup timer3 593:../../oulib/include/oulib.h **** */ 594:../../oulib/include/oulib.h **** inline void timer3_enable(void) { 595:../../oulib/include/oulib.h **** TIMSK3 |= _BV(TOIE3); 596:../../oulib/include/oulib.h **** }; 597:../../oulib/include/oulib.h **** 598:../../oulib/include/oulib.h **** /** 599:../../oulib/include/oulib.h **** Disable the timer 3 overflow interrupt. 600:../../oulib/include/oulib.h **** 601:../../oulib/include/oulib.h **** @author Andrew H. Fagg 602:../../oulib/include/oulib.h **** 603:../../oulib/include/oulib.h **** \ingroup timer3 604:../../oulib/include/oulib.h **** */ 605:../../oulib/include/oulib.h **** inline void timer3_disable(void) { 606:../../oulib/include/oulib.h **** 607:../../oulib/include/oulib.h **** TIMSK3 &= ~_BV(TOIE3); 608:../../oulib/include/oulib.h **** }; 609:../../oulib/include/oulib.h **** 610:../../oulib/include/oulib.h **** 611:../../oulib/include/oulib.h **** #endif 612:../../oulib/include/oulib.h **** 613:../../oulib/include/oulib.h **** 614:../../oulib/include/oulib.h **** ///////////////////////////////////////////////////////////////////// 615:../../oulib/include/oulib.h **** // Timer 4 616:../../oulib/include/oulib.h **** #ifdef TIMER4 617:../../oulib/include/oulib.h **** extern void timer4_config(uint8_t config); 618:../../oulib/include/oulib.h **** 619:../../oulib/include/oulib.h **** #define TIMER4_NOCLK 0 620:../../oulib/include/oulib.h **** #define TIMER4_NOPRE 1 621:../../oulib/include/oulib.h **** #define TIMER4_PRE_8 2 622:../../oulib/include/oulib.h **** #define TIMER4_PRE_64 3 623:../../oulib/include/oulib.h **** #define TIMER4_PRE_256 4 624:../../oulib/include/oulib.h **** #define TIMER4_PRE_1024 5 625:../../oulib/include/oulib.h **** #define TIMER4_EXT_FALLING 6 626:../../oulib/include/oulib.h **** #define TIMER4_EXT_RISING 7 627:../../oulib/include/oulib.h **** 628:../../oulib/include/oulib.h **** extern uint16_t timer4_read(void); 629:../../oulib/include/oulib.h **** extern void timer4_set(uint16_t); 630:../../oulib/include/oulib.h **** 631:../../oulib/include/oulib.h **** extern void timer4_output_compare_config(uint8_t config); 632:../../oulib/include/oulib.h **** 633:../../oulib/include/oulib.h **** #define TIMER4_OUTPUT_COMPARE_CONFIG_NORMAL 0x0 634:../../oulib/include/oulib.h **** #define TIMER4_OUTPUT_COMPARE_CONFIG_PWM_PC_08 0x1 635:../../oulib/include/oulib.h **** #define TIMER4_OUTPUT_COMPARE_CONFIG_PWM_PC_09 0x2 636:../../oulib/include/oulib.h **** #define TIMER4_OUTPUT_COMPARE_CONFIG_PWM_PC_10 0x3 637:../../oulib/include/oulib.h **** #define TIMER4_OUTPUT_COMPARE_CONFIG_CTC_OCR1A 0x4 638:../../oulib/include/oulib.h **** #define TIMER4_OUTPUT_COMPARE_CONFIG_PWM_F_08 0x5 639:../../oulib/include/oulib.h **** #define TIMER4_OUTPUT_COMPARE_CONFIG_PWM_F_09 0x6 640:../../oulib/include/oulib.h **** #define TIMER4_OUTPUT_COMPARE_CONFIG_PWM_F_10 0x7 641:../../oulib/include/oulib.h **** #define TIMER4_OUTPUT_COMPARE_CONFIG_PWM_PFC_ICR1 0x8 642:../../oulib/include/oulib.h **** #define TIMER4_OUTPUT_COMPARE_CONFIG_PWM_PFC_OCR1A 0x9 643:../../oulib/include/oulib.h **** #define TIMER4_OUTPUT_COMPARE_CONFIG_PWM_PC_ICR1 0xa 644:../../oulib/include/oulib.h **** #define TIMER4_OUTPUT_COMPARE_CONFIG_PWM_PC_OCR1A 0xb 645:../../oulib/include/oulib.h **** #define TIMER4_OUTPUT_COMPARE_CONFIG_CTC_ICR1 0xc 646:../../oulib/include/oulib.h **** #define TIMER4_OUTPUT_COMPARE_CONFIG_PWM_F_ICR1 0xe 647:../../oulib/include/oulib.h **** #define TIMER4_OUTPUT_COMPARE_CONFIG_PWM_F_OCR1A 0xf 648:../../oulib/include/oulib.h **** 649:../../oulib/include/oulib.h **** 650:../../oulib/include/oulib.h **** extern void timer4_output_compare_A_set(uint16_t val); 651:../../oulib/include/oulib.h **** extern uint16_t timer4_output_compare_A_read(void); 652:../../oulib/include/oulib.h **** extern void timer4_compare_output_A_mode_set(uint8_t mode); 653:../../oulib/include/oulib.h **** 654:../../oulib/include/oulib.h **** extern void timer4_output_compare_B_set(uint16_t val); 655:../../oulib/include/oulib.h **** extern uint16_t timer4_output_compare_B_read(void); 656:../../oulib/include/oulib.h **** extern void timer4_compare_output_B_mode_set(uint8_t mode); 657:../../oulib/include/oulib.h **** 658:../../oulib/include/oulib.h **** extern void timer4_output_compare_C_set(uint16_t val); 659:../../oulib/include/oulib.h **** extern uint16_t timer4_output_compare_C_read(void); 660:../../oulib/include/oulib.h **** extern void timer4_compare_output_C_mode_set(uint8_t mode); 661:../../oulib/include/oulib.h **** 662:../../oulib/include/oulib.h **** /** 663:../../oulib/include/oulib.h **** Enable the timer 4 overflow interrupt. 664:../../oulib/include/oulib.h **** 665:../../oulib/include/oulib.h **** @author Andrew H. Fagg 666:../../oulib/include/oulib.h **** 667:../../oulib/include/oulib.h **** \ingroup timer4 668:../../oulib/include/oulib.h **** */ 669:../../oulib/include/oulib.h **** inline void timer4_enable(void) { 670:../../oulib/include/oulib.h **** TIMSK4 |= _BV(TOIE4); 671:../../oulib/include/oulib.h **** }; 672:../../oulib/include/oulib.h **** 673:../../oulib/include/oulib.h **** /** 674:../../oulib/include/oulib.h **** Disable the timer 4 overflow interrupt. 675:../../oulib/include/oulib.h **** 676:../../oulib/include/oulib.h **** @author Andrew H. Fagg 677:../../oulib/include/oulib.h **** 678:../../oulib/include/oulib.h **** \ingroup timer4 679:../../oulib/include/oulib.h **** */ 680:../../oulib/include/oulib.h **** inline void timer4_disable(void) { 681:../../oulib/include/oulib.h **** 682:../../oulib/include/oulib.h **** TIMSK4 &= ~_BV(TOIE4); 683:../../oulib/include/oulib.h **** }; 684:../../oulib/include/oulib.h **** 685:../../oulib/include/oulib.h **** 686:../../oulib/include/oulib.h **** #endif 687:../../oulib/include/oulib.h **** 688:../../oulib/include/oulib.h **** 689:../../oulib/include/oulib.h **** ///////////////////////////////////////////////////////////////////// 690:../../oulib/include/oulib.h **** // Timer 5 691:../../oulib/include/oulib.h **** #ifdef TIMER5 692:../../oulib/include/oulib.h **** extern void timer5_config(uint8_t config); 693:../../oulib/include/oulib.h **** 694:../../oulib/include/oulib.h **** #define TIMER5_NOCLK 0 695:../../oulib/include/oulib.h **** #define TIMER5_NOPRE 1 696:../../oulib/include/oulib.h **** #define TIMER5_PRE_8 2 697:../../oulib/include/oulib.h **** #define TIMER5_PRE_64 3 698:../../oulib/include/oulib.h **** #define TIMER5_PRE_256 4 699:../../oulib/include/oulib.h **** #define TIMER5_PRE_1024 5 700:../../oulib/include/oulib.h **** #define TIMER5_EXT_FALLING 6 701:../../oulib/include/oulib.h **** #define TIMER5_EXT_RISING 7 702:../../oulib/include/oulib.h **** 703:../../oulib/include/oulib.h **** extern uint16_t timer5_read(void); 704:../../oulib/include/oulib.h **** extern void timer5_set(uint16_t); 705:../../oulib/include/oulib.h **** 706:../../oulib/include/oulib.h **** extern void timer5_output_compare_config(uint8_t config); 707:../../oulib/include/oulib.h **** 708:../../oulib/include/oulib.h **** #define TIMER5_OUTPUT_COMPARE_CONFIG_NORMAL 0x0 709:../../oulib/include/oulib.h **** #define TIMER5_OUTPUT_COMPARE_CONFIG_PWM_PC_08 0x1 710:../../oulib/include/oulib.h **** #define TIMER5_OUTPUT_COMPARE_CONFIG_PWM_PC_09 0x2 711:../../oulib/include/oulib.h **** #define TIMER5_OUTPUT_COMPARE_CONFIG_PWM_PC_10 0x3 712:../../oulib/include/oulib.h **** #define TIMER5_OUTPUT_COMPARE_CONFIG_CTC_OCR1A 0x4 713:../../oulib/include/oulib.h **** #define TIMER5_OUTPUT_COMPARE_CONFIG_PWM_F_08 0x5 714:../../oulib/include/oulib.h **** #define TIMER5_OUTPUT_COMPARE_CONFIG_PWM_F_09 0x6 715:../../oulib/include/oulib.h **** #define TIMER5_OUTPUT_COMPARE_CONFIG_PWM_F_10 0x7 716:../../oulib/include/oulib.h **** #define TIMER5_OUTPUT_COMPARE_CONFIG_PWM_PFC_ICR1 0x8 717:../../oulib/include/oulib.h **** #define TIMER5_OUTPUT_COMPARE_CONFIG_PWM_PFC_OCR1A 0x9 718:../../oulib/include/oulib.h **** #define TIMER5_OUTPUT_COMPARE_CONFIG_PWM_PC_ICR1 0xa 719:../../oulib/include/oulib.h **** #define TIMER5_OUTPUT_COMPARE_CONFIG_PWM_PC_OCR1A 0xb 720:../../oulib/include/oulib.h **** #define TIMER5_OUTPUT_COMPARE_CONFIG_CTC_ICR1 0xc 721:../../oulib/include/oulib.h **** #define TIMER5_OUTPUT_COMPARE_CONFIG_PWM_F_ICR1 0xe 722:../../oulib/include/oulib.h **** #define TIMER5_OUTPUT_COMPARE_CONFIG_PWM_F_OCR1A 0xf 723:../../oulib/include/oulib.h **** 724:../../oulib/include/oulib.h **** 725:../../oulib/include/oulib.h **** extern void timer5_output_compare_A_set(uint16_t val); 726:../../oulib/include/oulib.h **** extern uint16_t timer5_output_compare_A_read(void); 727:../../oulib/include/oulib.h **** extern void timer5_compare_output_A_mode_set(uint8_t mode); 728:../../oulib/include/oulib.h **** 729:../../oulib/include/oulib.h **** extern void timer5_output_compare_B_set(uint16_t val); 730:../../oulib/include/oulib.h **** extern uint16_t timer5_output_compare_B_read(void); 731:../../oulib/include/oulib.h **** extern void timer5_compare_output_B_mode_set(uint8_t mode); 732:../../oulib/include/oulib.h **** 733:../../oulib/include/oulib.h **** extern void timer5_output_compare_C_set(uint16_t val); 734:../../oulib/include/oulib.h **** extern uint16_t timer5_output_compare_C_read(void); 735:../../oulib/include/oulib.h **** extern void timer5_compare_output_C_mode_set(uint8_t mode); 736:../../oulib/include/oulib.h **** 737:../../oulib/include/oulib.h **** /** 738:../../oulib/include/oulib.h **** Enable the timer 5 overflow interrupt. 739:../../oulib/include/oulib.h **** 740:../../oulib/include/oulib.h **** @author Andrew H. Fagg 741:../../oulib/include/oulib.h **** 742:../../oulib/include/oulib.h **** \ingroup timer5 743:../../oulib/include/oulib.h **** */ 744:../../oulib/include/oulib.h **** inline void timer5_enable(void) { 745:../../oulib/include/oulib.h **** TIMSK5 |= _BV(TOIE5); 746:../../oulib/include/oulib.h **** }; 747:../../oulib/include/oulib.h **** 748:../../oulib/include/oulib.h **** /** 749:../../oulib/include/oulib.h **** Disable the timer 5 overflow interrupt. 750:../../oulib/include/oulib.h **** 751:../../oulib/include/oulib.h **** @author Andrew H. Fagg 752:../../oulib/include/oulib.h **** 753:../../oulib/include/oulib.h **** \ingroup timer5 754:../../oulib/include/oulib.h **** */ 755:../../oulib/include/oulib.h **** inline void timer5_disable(void) { 756:../../oulib/include/oulib.h **** 757:../../oulib/include/oulib.h **** TIMSK5 &= ~_BV(TOIE5); 758:../../oulib/include/oulib.h **** }; 759:../../oulib/include/oulib.h **** 760:../../oulib/include/oulib.h **** 761:../../oulib/include/oulib.h **** #endif 762:../../oulib/include/oulib.h **** 763:../../oulib/include/oulib.h **** 764:../../oulib/include/oulib.h **** 765:../../oulib/include/oulib.h **** /////////////////////////////////////////////////// 766:../../oulib/include/oulib.h **** // Serial I/O 767:../../oulib/include/oulib.h **** 768:../../oulib/include/oulib.h **** //extern char kbhit(void); 769:../../oulib/include/oulib.h **** //extern void serial0_init(unsigned long); 770:../../oulib/include/oulib.h **** //extern FILE* serial_init(uint8_t port, unsigned long baud_rate); 771:../../oulib/include/oulib.h **** extern FILE* serial_init_buffered(uint8_t port, unsigned long baud_rate, 772:../../oulib/include/oulib.h **** uint8_t buf_size_in, uint8_t buf_size_out); 773:../../oulib/include/oulib.h **** //extern int8_t serial_input_waiting(FILE *fp); 774:../../oulib/include/oulib.h **** extern int8_t serial_buffered_input_waiting(FILE *fp); 775:../../oulib/include/oulib.h **** extern void serial_receive_isr(struct OU_FILE_BUF *fp); 776:../../oulib/include/oulib.h **** extern void serial_transmit_isr(struct OU_FILE_BUF *fp); 777:../../oulib/include/oulib.h **** 778:../../oulib/include/oulib.h **** /////////////////////////////////////////////////// 779:../../oulib/include/oulib.h **** // ADC 780:../../oulib/include/oulib.h **** 781:../../oulib/include/oulib.h **** extern void adc_set_reference(uint8_t ref); 782:../../oulib/include/oulib.h **** 783:../../oulib/include/oulib.h **** #define ADC_REF_AREF 0x0 784:../../oulib/include/oulib.h **** #define ADC_REF_AREF_CAP 0x1 785:../../oulib/include/oulib.h **** #define ADC_REF_2p56V 0x3 786:../../oulib/include/oulib.h **** 787:../../oulib/include/oulib.h **** extern void adc_set_adlar(uint8_t adlar); 788:../../oulib/include/oulib.h **** 789:../../oulib/include/oulib.h **** #define ADC_ADLAR_RIGHT 0 790:../../oulib/include/oulib.h **** #define ADC_ADLAR_LEFT 1 791:../../oulib/include/oulib.h **** 792:../../oulib/include/oulib.h **** 793:../../oulib/include/oulib.h **** extern void adc_set_channel(uint8_t chan); 794:../../oulib/include/oulib.h **** 795:../../oulib/include/oulib.h **** // Not clear that we need this ifdef 796:../../oulib/include/oulib.h **** #ifdef atmega8 797:../../oulib/include/oulib.h **** #define ADC_CHANNEL_0 0x0 798:../../oulib/include/oulib.h **** #define ADC_CHANNEL_1 0x1 799:../../oulib/include/oulib.h **** #define ADC_CHANNEL_2 0x2 800:../../oulib/include/oulib.h **** #define ADC_CHANNEL_3 0x3 801:../../oulib/include/oulib.h **** #define ADC_CHANNEL_4 0x4 802:../../oulib/include/oulib.h **** #define ADC_CHANNEL_5 0x5 803:../../oulib/include/oulib.h **** #define ADC_CHANNEL_6 0x6 804:../../oulib/include/oulib.h **** #define ADC_CHANNEL_7 0x7 805:../../oulib/include/oulib.h **** #define ADC_CHANNEL_1p23V 0xE 806:../../oulib/include/oulib.h **** #define ADC_CHANNEL_0V 0xF 807:../../oulib/include/oulib.h **** #else 808:../../oulib/include/oulib.h **** #define ADC_CHANNEL_0 0x0 809:../../oulib/include/oulib.h **** #define ADC_CHANNEL_1 0x1 810:../../oulib/include/oulib.h **** #define ADC_CHANNEL_2 0x2 811:../../oulib/include/oulib.h **** #define ADC_CHANNEL_3 0x3 812:../../oulib/include/oulib.h **** #define ADC_CHANNEL_4 0x4 813:../../oulib/include/oulib.h **** #define ADC_CHANNEL_5 0x5 814:../../oulib/include/oulib.h **** #define ADC_CHANNEL_6 0x6 815:../../oulib/include/oulib.h **** #define ADC_CHANNEL_7 0x7 816:../../oulib/include/oulib.h **** #define ADC_CHANNEL_1p1V 0xE 817:../../oulib/include/oulib.h **** #define ADC_CHANNEL_0V 0xF 818:../../oulib/include/oulib.h **** #endif 819:../../oulib/include/oulib.h **** 820:../../oulib/include/oulib.h **** #ifdef ADC_CHANS_16 821:../../oulib/include/oulib.h **** #define ADC_CHANNEL_8 0x20 822:../../oulib/include/oulib.h **** #define ADC_CHANNEL_9 0x21 823:../../oulib/include/oulib.h **** #define ADC_CHANNEL_10 0x22 824:../../oulib/include/oulib.h **** #define ADC_CHANNEL_11 0x23 825:../../oulib/include/oulib.h **** #define ADC_CHANNEL_12 0x24 826:../../oulib/include/oulib.h **** #define ADC_CHANNEL_13 0x25 827:../../oulib/include/oulib.h **** #define ADC_CHANNEL_14 0x26 828:../../oulib/include/oulib.h **** #define ADC_CHANNEL_15 0x27 829:../../oulib/include/oulib.h **** #endif 830:../../oulib/include/oulib.h **** 831:../../oulib/include/oulib.h **** extern void adc_set_enable(uint8_t cmd); 832:../../oulib/include/oulib.h **** #define ADC_ENABLE 1 833:../../oulib/include/oulib.h **** #define ADC_DISABLE 0 834:../../oulib/include/oulib.h **** 835:../../oulib/include/oulib.h **** /** 836:../../oulib/include/oulib.h **** Initiate an analog-to-digital conversion. 837:../../oulib/include/oulib.h ****

838:../../oulib/include/oulib.h **** Assumptions: the ADC has been configured. 839:../../oulib/include/oulib.h **** 840:../../oulib/include/oulib.h **** @author Andrew H. Fagg 841:../../oulib/include/oulib.h **** 842:../../oulib/include/oulib.h **** \ingroup adc 843:../../oulib/include/oulib.h **** 844:../../oulib/include/oulib.h **** 845:../../oulib/include/oulib.h **** */ 846:../../oulib/include/oulib.h **** inline void adc_start_conversion(void) 847:../../oulib/include/oulib.h **** { 848:../../oulib/include/oulib.h **** ADCSRA = ADCSRA | 0x40; 155 .LM10: 156 004e 8091 7A00 lds r24,122 157 0052 8064 ori r24,lo8(64) 158 0054 8093 7A00 sts 122,r24 159 .LBE5: 160 .LBE4: 162 .Ltext2: 36:adc_test.c **** val = adc_read(); 164 .LM11: 165 0058 0E94 0000 call adc_read 167 .LM12: 168 005c 00D0 rcall . 169 005e 00D0 rcall . 170 0060 EDB7 in r30,__SP_L__ 171 0062 FEB7 in r31,__SP_H__ 172 0064 3196 adiw r30,1 173 0066 2091 0000 lds r18,fp0 174 006a 3091 0000 lds r19,(fp0)+1 175 006e ADB7 in r26,__SP_L__ 176 0070 BEB7 in r27,__SP_H__ 177 0072 1296 adiw r26,1+1 178 0074 3C93 st X,r19 179 0076 2E93 st -X,r18 180 0078 1197 sbiw r26,1 181 007a D383 std Z+3,r29 182 007c C283 std Z+2,r28 183 007e 9583 std Z+5,r25 184 0080 8483 std Z+4,r24 185 0082 0E94 0000 call fprintf 37:adc_test.c **** delay_ms(100); 187 .LM13: 188 0086 8DB7 in r24,__SP_L__ 189 0088 9EB7 in r25,__SP_H__ 190 008a 0696 adiw r24,6 191 008c 0FB6 in __tmp_reg__,__SREG__ 192 008e F894 cli 193 0090 9EBF out __SP_H__,r25 194 0092 0FBE out __SREG__,__tmp_reg__ 195 0094 8DBF out __SP_L__,r24 196 0096 84E6 ldi r24,lo8(100) 197 0098 90E0 ldi r25,hi8(100) 198 009a 0E94 0000 call delay_ms 199 009e 00C0 rjmp .L2 201 .Lscope1: 203 .global __vector_55 205 __vector_55: 207 .Ltext3: 0:../../oulib/include/oulib_serial_buffered.h **** #include "oulib.h" 1:../../oulib/include/oulib_serial_buffered.h **** 2:../../oulib/include/oulib_serial_buffered.h **** #ifdef SERIAL_NPORTS_2 3:../../oulib/include/oulib_serial_buffered.h **** // Two serial ports 4:../../oulib/include/oulib_serial_buffered.h **** struct OU_FILE_BUF *ou_file_buf[2] = {NULL, NULL}; 5:../../oulib/include/oulib_serial_buffered.h **** 6:../../oulib/include/oulib_serial_buffered.h **** ISR(USART0_RX_vect) { 7:../../oulib/include/oulib_serial_buffered.h **** serial_receive_isr(ou_file_buf[0]); 8:../../oulib/include/oulib_serial_buffered.h **** } 9:../../oulib/include/oulib_serial_buffered.h **** ISR(USART1_RX_vect) { 10:../../oulib/include/oulib_serial_buffered.h **** serial_receive_isr(ou_file_buf[1]); 11:../../oulib/include/oulib_serial_buffered.h **** } 12:../../oulib/include/oulib_serial_buffered.h **** ISR(USART0_UDRE_vect) { 13:../../oulib/include/oulib_serial_buffered.h **** serial_transmit_isr(ou_file_buf[0]); 14:../../oulib/include/oulib_serial_buffered.h **** } 15:../../oulib/include/oulib_serial_buffered.h **** ISR(USART1_UDRE_vect) { 16:../../oulib/include/oulib_serial_buffered.h **** serial_transmit_isr(ou_file_buf[1]); 17:../../oulib/include/oulib_serial_buffered.h **** } 18:../../oulib/include/oulib_serial_buffered.h **** #else 19:../../oulib/include/oulib_serial_buffered.h **** #ifdef SERIAL_NPORTS_4 20:../../oulib/include/oulib_serial_buffered.h **** // Four serial ports 21:../../oulib/include/oulib_serial_buffered.h **** struct OU_FILE_BUF *ou_file_buf[4] = {NULL, NULL, NULL, NULL}; 22:../../oulib/include/oulib_serial_buffered.h **** 23:../../oulib/include/oulib_serial_buffered.h **** ISR(USART0_RX_vect) { 24:../../oulib/include/oulib_serial_buffered.h **** serial_receive_isr(ou_file_buf[0]); 25:../../oulib/include/oulib_serial_buffered.h **** } 26:../../oulib/include/oulib_serial_buffered.h **** ISR(USART1_RX_vect) { 27:../../oulib/include/oulib_serial_buffered.h **** serial_receive_isr(ou_file_buf[1]); 28:../../oulib/include/oulib_serial_buffered.h **** } 29:../../oulib/include/oulib_serial_buffered.h **** 30:../../oulib/include/oulib_serial_buffered.h **** ISR(USART2_RX_vect) { 31:../../oulib/include/oulib_serial_buffered.h **** serial_receive_isr(ou_file_buf[2]); 32:../../oulib/include/oulib_serial_buffered.h **** } 33:../../oulib/include/oulib_serial_buffered.h **** 34:../../oulib/include/oulib_serial_buffered.h **** ISR(USART3_RX_vect) { 35:../../oulib/include/oulib_serial_buffered.h **** serial_receive_isr(ou_file_buf[3]); 36:../../oulib/include/oulib_serial_buffered.h **** } 37:../../oulib/include/oulib_serial_buffered.h **** ISR(USART0_UDRE_vect) { 38:../../oulib/include/oulib_serial_buffered.h **** serial_transmit_isr(ou_file_buf[0]); 39:../../oulib/include/oulib_serial_buffered.h **** } 40:../../oulib/include/oulib_serial_buffered.h **** ISR(USART1_UDRE_vect) { 41:../../oulib/include/oulib_serial_buffered.h **** serial_transmit_isr(ou_file_buf[1]); 42:../../oulib/include/oulib_serial_buffered.h **** } 43:../../oulib/include/oulib_serial_buffered.h **** ISR(USART2_UDRE_vect) { 44:../../oulib/include/oulib_serial_buffered.h **** serial_transmit_isr(ou_file_buf[2]); 45:../../oulib/include/oulib_serial_buffered.h **** } 46:../../oulib/include/oulib_serial_buffered.h **** ISR(USART3_UDRE_vect) { 209 .LM14: 210 .LFBB2: 211 00a0 1F92 push __zero_reg__ 212 00a2 0F92 push r0 213 00a4 0FB6 in r0,__SREG__ 214 00a6 0F92 push r0 215 00a8 0BB6 in r0,91-32 216 00aa 0F92 push r0 217 00ac 1124 clr __zero_reg__ 218 00ae 2F93 push r18 219 00b0 3F93 push r19 220 00b2 4F93 push r20 221 00b4 5F93 push r21 222 00b6 6F93 push r22 223 00b8 7F93 push r23 224 00ba 8F93 push r24 225 00bc 9F93 push r25 226 00be AF93 push r26 227 00c0 BF93 push r27 228 00c2 EF93 push r30 229 00c4 FF93 push r31 230 /* prologue: Signal */ 231 /* frame size = 0 */ 47:../../oulib/include/oulib_serial_buffered.h **** serial_transmit_isr(ou_file_buf[3]); 233 .LM15: 234 00c6 8091 0000 lds r24,ou_file_buf+6 235 00ca 9091 0000 lds r25,(ou_file_buf+6)+1 236 00ce 0E94 0000 call serial_transmit_isr 237 /* epilogue start */ 48:../../oulib/include/oulib_serial_buffered.h **** } 239 .LM16: 240 00d2 FF91 pop r31 241 00d4 EF91 pop r30 242 00d6 BF91 pop r27 243 00d8 AF91 pop r26 244 00da 9F91 pop r25 245 00dc 8F91 pop r24 246 00de 7F91 pop r23 247 00e0 6F91 pop r22 248 00e2 5F91 pop r21 249 00e4 4F91 pop r20 250 00e6 3F91 pop r19 251 00e8 2F91 pop r18 252 00ea 0F90 pop r0 253 00ec 0BBE out 91-32,r0 254 00ee 0F90 pop r0 255 00f0 0FBE out __SREG__,r0 256 00f2 0F90 pop r0 257 00f4 1F90 pop __zero_reg__ 258 00f6 1895 reti 260 .Lscope2: 262 .global __vector_52 264 __vector_52: 44:../../oulib/include/oulib_serial_buffered.h **** ISR(USART2_UDRE_vect) { 266 .LM17: 267 .LFBB3: 268 00f8 1F92 push __zero_reg__ 269 00fa 0F92 push r0 270 00fc 0FB6 in r0,__SREG__ 271 00fe 0F92 push r0 272 0100 0BB6 in r0,91-32 273 0102 0F92 push r0 274 0104 1124 clr __zero_reg__ 275 0106 2F93 push r18 276 0108 3F93 push r19 277 010a 4F93 push r20 278 010c 5F93 push r21 279 010e 6F93 push r22 280 0110 7F93 push r23 281 0112 8F93 push r24 282 0114 9F93 push r25 283 0116 AF93 push r26 284 0118 BF93 push r27 285 011a EF93 push r30 286 011c FF93 push r31 287 /* prologue: Signal */ 288 /* frame size = 0 */ 45:../../oulib/include/oulib_serial_buffered.h **** serial_transmit_isr(ou_file_buf[2]); 290 .LM18: 291 011e 8091 0000 lds r24,ou_file_buf+4 292 0122 9091 0000 lds r25,(ou_file_buf+4)+1 293 0126 0E94 0000 call serial_transmit_isr 294 /* epilogue start */ 46:../../oulib/include/oulib_serial_buffered.h **** } 296 .LM19: 297 012a FF91 pop r31 298 012c EF91 pop r30 299 012e BF91 pop r27 300 0130 AF91 pop r26 301 0132 9F91 pop r25 302 0134 8F91 pop r24 303 0136 7F91 pop r23 304 0138 6F91 pop r22 305 013a 5F91 pop r21 306 013c 4F91 pop r20 307 013e 3F91 pop r19 308 0140 2F91 pop r18 309 0142 0F90 pop r0 310 0144 0BBE out 91-32,r0 311 0146 0F90 pop r0 312 0148 0FBE out __SREG__,r0 313 014a 0F90 pop r0 314 014c 1F90 pop __zero_reg__ 315 014e 1895 reti 317 .Lscope3: 319 .global __vector_37 321 __vector_37: 41:../../oulib/include/oulib_serial_buffered.h **** ISR(USART1_UDRE_vect) { 323 .LM20: 324 .LFBB4: 325 0150 1F92 push __zero_reg__ 326 0152 0F92 push r0 327 0154 0FB6 in r0,__SREG__ 328 0156 0F92 push r0 329 0158 0BB6 in r0,91-32 330 015a 0F92 push r0 331 015c 1124 clr __zero_reg__ 332 015e 2F93 push r18 333 0160 3F93 push r19 334 0162 4F93 push r20 335 0164 5F93 push r21 336 0166 6F93 push r22 337 0168 7F93 push r23 338 016a 8F93 push r24 339 016c 9F93 push r25 340 016e AF93 push r26 341 0170 BF93 push r27 342 0172 EF93 push r30 343 0174 FF93 push r31 344 /* prologue: Signal */ 345 /* frame size = 0 */ 42:../../oulib/include/oulib_serial_buffered.h **** serial_transmit_isr(ou_file_buf[1]); 347 .LM21: 348 0176 8091 0000 lds r24,ou_file_buf+2 349 017a 9091 0000 lds r25,(ou_file_buf+2)+1 350 017e 0E94 0000 call serial_transmit_isr 351 /* epilogue start */ 43:../../oulib/include/oulib_serial_buffered.h **** } 353 .LM22: 354 0182 FF91 pop r31 355 0184 EF91 pop r30 356 0186 BF91 pop r27 357 0188 AF91 pop r26 358 018a 9F91 pop r25 359 018c 8F91 pop r24 360 018e 7F91 pop r23 361 0190 6F91 pop r22 362 0192 5F91 pop r21 363 0194 4F91 pop r20 364 0196 3F91 pop r19 365 0198 2F91 pop r18 366 019a 0F90 pop r0 367 019c 0BBE out 91-32,r0 368 019e 0F90 pop r0 369 01a0 0FBE out __SREG__,r0 370 01a2 0F90 pop r0 371 01a4 1F90 pop __zero_reg__ 372 01a6 1895 reti 374 .Lscope4: 376 .global __vector_26 378 __vector_26: 38:../../oulib/include/oulib_serial_buffered.h **** ISR(USART0_UDRE_vect) { 380 .LM23: 381 .LFBB5: 382 01a8 1F92 push __zero_reg__ 383 01aa 0F92 push r0 384 01ac 0FB6 in r0,__SREG__ 385 01ae 0F92 push r0 386 01b0 0BB6 in r0,91-32 387 01b2 0F92 push r0 388 01b4 1124 clr __zero_reg__ 389 01b6 2F93 push r18 390 01b8 3F93 push r19 391 01ba 4F93 push r20 392 01bc 5F93 push r21 393 01be 6F93 push r22 394 01c0 7F93 push r23 395 01c2 8F93 push r24 396 01c4 9F93 push r25 397 01c6 AF93 push r26 398 01c8 BF93 push r27 399 01ca EF93 push r30 400 01cc FF93 push r31 401 /* prologue: Signal */ 402 /* frame size = 0 */ 39:../../oulib/include/oulib_serial_buffered.h **** serial_transmit_isr(ou_file_buf[0]); 404 .LM24: 405 01ce 8091 0000 lds r24,ou_file_buf 406 01d2 9091 0000 lds r25,(ou_file_buf)+1 407 01d6 0E94 0000 call serial_transmit_isr 408 /* epilogue start */ 40:../../oulib/include/oulib_serial_buffered.h **** } 410 .LM25: 411 01da FF91 pop r31 412 01dc EF91 pop r30 413 01de BF91 pop r27 414 01e0 AF91 pop r26 415 01e2 9F91 pop r25 416 01e4 8F91 pop r24 417 01e6 7F91 pop r23 418 01e8 6F91 pop r22 419 01ea 5F91 pop r21 420 01ec 4F91 pop r20 421 01ee 3F91 pop r19 422 01f0 2F91 pop r18 423 01f2 0F90 pop r0 424 01f4 0BBE out 91-32,r0 425 01f6 0F90 pop r0 426 01f8 0FBE out __SREG__,r0 427 01fa 0F90 pop r0 428 01fc 1F90 pop __zero_reg__ 429 01fe 1895 reti 431 .Lscope5: 433 .global __vector_54 435 __vector_54: 35:../../oulib/include/oulib_serial_buffered.h **** ISR(USART3_RX_vect) { 437 .LM26: 438 .LFBB6: 439 0200 1F92 push __zero_reg__ 440 0202 0F92 push r0 441 0204 0FB6 in r0,__SREG__ 442 0206 0F92 push r0 443 0208 0BB6 in r0,91-32 444 020a 0F92 push r0 445 020c 1124 clr __zero_reg__ 446 020e 2F93 push r18 447 0210 3F93 push r19 448 0212 4F93 push r20 449 0214 5F93 push r21 450 0216 6F93 push r22 451 0218 7F93 push r23 452 021a 8F93 push r24 453 021c 9F93 push r25 454 021e AF93 push r26 455 0220 BF93 push r27 456 0222 EF93 push r30 457 0224 FF93 push r31 458 /* prologue: Signal */ 459 /* frame size = 0 */ 36:../../oulib/include/oulib_serial_buffered.h **** serial_receive_isr(ou_file_buf[3]); 461 .LM27: 462 0226 8091 0000 lds r24,ou_file_buf+6 463 022a 9091 0000 lds r25,(ou_file_buf+6)+1 464 022e 0E94 0000 call serial_receive_isr 465 /* epilogue start */ 37:../../oulib/include/oulib_serial_buffered.h **** } 467 .LM28: 468 0232 FF91 pop r31 469 0234 EF91 pop r30 470 0236 BF91 pop r27 471 0238 AF91 pop r26 472 023a 9F91 pop r25 473 023c 8F91 pop r24 474 023e 7F91 pop r23 475 0240 6F91 pop r22 476 0242 5F91 pop r21 477 0244 4F91 pop r20 478 0246 3F91 pop r19 479 0248 2F91 pop r18 480 024a 0F90 pop r0 481 024c 0BBE out 91-32,r0 482 024e 0F90 pop r0 483 0250 0FBE out __SREG__,r0 484 0252 0F90 pop r0 485 0254 1F90 pop __zero_reg__ 486 0256 1895 reti 488 .Lscope6: 490 .global __vector_51 492 __vector_51: 31:../../oulib/include/oulib_serial_buffered.h **** ISR(USART2_RX_vect) { 494 .LM29: 495 .LFBB7: 496 0258 1F92 push __zero_reg__ 497 025a 0F92 push r0 498 025c 0FB6 in r0,__SREG__ 499 025e 0F92 push r0 500 0260 0BB6 in r0,91-32 501 0262 0F92 push r0 502 0264 1124 clr __zero_reg__ 503 0266 2F93 push r18 504 0268 3F93 push r19 505 026a 4F93 push r20 506 026c 5F93 push r21 507 026e 6F93 push r22 508 0270 7F93 push r23 509 0272 8F93 push r24 510 0274 9F93 push r25 511 0276 AF93 push r26 512 0278 BF93 push r27 513 027a EF93 push r30 514 027c FF93 push r31 515 /* prologue: Signal */ 516 /* frame size = 0 */ 32:../../oulib/include/oulib_serial_buffered.h **** serial_receive_isr(ou_file_buf[2]); 518 .LM30: 519 027e 8091 0000 lds r24,ou_file_buf+4 520 0282 9091 0000 lds r25,(ou_file_buf+4)+1 521 0286 0E94 0000 call serial_receive_isr 522 /* epilogue start */ 33:../../oulib/include/oulib_serial_buffered.h **** } 524 .LM31: 525 028a FF91 pop r31 526 028c EF91 pop r30 527 028e BF91 pop r27 528 0290 AF91 pop r26 529 0292 9F91 pop r25 530 0294 8F91 pop r24 531 0296 7F91 pop r23 532 0298 6F91 pop r22 533 029a 5F91 pop r21 534 029c 4F91 pop r20 535 029e 3F91 pop r19 536 02a0 2F91 pop r18 537 02a2 0F90 pop r0 538 02a4 0BBE out 91-32,r0 539 02a6 0F90 pop r0 540 02a8 0FBE out __SREG__,r0 541 02aa 0F90 pop r0 542 02ac 1F90 pop __zero_reg__ 543 02ae 1895 reti 545 .Lscope7: 547 .global __vector_36 549 __vector_36: 27:../../oulib/include/oulib_serial_buffered.h **** ISR(USART1_RX_vect) { 551 .LM32: 552 .LFBB8: 553 02b0 1F92 push __zero_reg__ 554 02b2 0F92 push r0 555 02b4 0FB6 in r0,__SREG__ 556 02b6 0F92 push r0 557 02b8 0BB6 in r0,91-32 558 02ba 0F92 push r0 559 02bc 1124 clr __zero_reg__ 560 02be 2F93 push r18 561 02c0 3F93 push r19 562 02c2 4F93 push r20 563 02c4 5F93 push r21 564 02c6 6F93 push r22 565 02c8 7F93 push r23 566 02ca 8F93 push r24 567 02cc 9F93 push r25 568 02ce AF93 push r26 569 02d0 BF93 push r27 570 02d2 EF93 push r30 571 02d4 FF93 push r31 572 /* prologue: Signal */ 573 /* frame size = 0 */ 28:../../oulib/include/oulib_serial_buffered.h **** serial_receive_isr(ou_file_buf[1]); 575 .LM33: 576 02d6 8091 0000 lds r24,ou_file_buf+2 577 02da 9091 0000 lds r25,(ou_file_buf+2)+1 578 02de 0E94 0000 call serial_receive_isr 579 /* epilogue start */ 29:../../oulib/include/oulib_serial_buffered.h **** } 581 .LM34: 582 02e2 FF91 pop r31 583 02e4 EF91 pop r30 584 02e6 BF91 pop r27 585 02e8 AF91 pop r26 586 02ea 9F91 pop r25 587 02ec 8F91 pop r24 588 02ee 7F91 pop r23 589 02f0 6F91 pop r22 590 02f2 5F91 pop r21 591 02f4 4F91 pop r20 592 02f6 3F91 pop r19 593 02f8 2F91 pop r18 594 02fa 0F90 pop r0 595 02fc 0BBE out 91-32,r0 596 02fe 0F90 pop r0 597 0300 0FBE out __SREG__,r0 598 0302 0F90 pop r0 599 0304 1F90 pop __zero_reg__ 600 0306 1895 reti 602 .Lscope8: 604 .global __vector_25 606 __vector_25: 24:../../oulib/include/oulib_serial_buffered.h **** ISR(USART0_RX_vect) { 608 .LM35: 609 .LFBB9: 610 0308 1F92 push __zero_reg__ 611 030a 0F92 push r0 612 030c 0FB6 in r0,__SREG__ 613 030e 0F92 push r0 614 0310 0BB6 in r0,91-32 615 0312 0F92 push r0 616 0314 1124 clr __zero_reg__ 617 0316 2F93 push r18 618 0318 3F93 push r19 619 031a 4F93 push r20 620 031c 5F93 push r21 621 031e 6F93 push r22 622 0320 7F93 push r23 623 0322 8F93 push r24 624 0324 9F93 push r25 625 0326 AF93 push r26 626 0328 BF93 push r27 627 032a EF93 push r30 628 032c FF93 push r31 629 /* prologue: Signal */ 630 /* frame size = 0 */ 25:../../oulib/include/oulib_serial_buffered.h **** serial_receive_isr(ou_file_buf[0]); 632 .LM36: 633 032e 8091 0000 lds r24,ou_file_buf 634 0332 9091 0000 lds r25,(ou_file_buf)+1 635 0336 0E94 0000 call serial_receive_isr 636 /* epilogue start */ 26:../../oulib/include/oulib_serial_buffered.h **** } 638 .LM37: 639 033a FF91 pop r31 640 033c EF91 pop r30 641 033e BF91 pop r27 642 0340 AF91 pop r26 643 0342 9F91 pop r25 644 0344 8F91 pop r24 645 0346 7F91 pop r23 646 0348 6F91 pop r22 647 034a 5F91 pop r21 648 034c 4F91 pop r20 649 034e 3F91 pop r19 650 0350 2F91 pop r18 651 0352 0F90 pop r0 652 0354 0BBE out 91-32,r0 653 0356 0F90 pop r0 654 0358 0FBE out __SREG__,r0 655 035a 0F90 pop r0 656 035c 1F90 pop __zero_reg__ 657 035e 1895 reti 659 .Lscope9: 660 .global ou_file_buf 661 .global ou_file_buf 662 .section .bss 665 ou_file_buf: 666 0000 0000 0000 .skip 8,0 666 0000 0000 667 .comm fp0,2,1 670 .text 672 .Letext0: DEFINED SYMBOLS *ABS*:0000000000000000 adc_test.c /tmp/cctDMUsY.s:2 *ABS*:000000000000003f __SREG__ /tmp/cctDMUsY.s:3 *ABS*:000000000000003e __SP_H__ /tmp/cctDMUsY.s:4 *ABS*:000000000000003d __SP_L__ /tmp/cctDMUsY.s:5 *ABS*:0000000000000034 __CCP__ /tmp/cctDMUsY.s:6 *ABS*:0000000000000000 __tmp_reg__ /tmp/cctDMUsY.s:7 *ABS*:0000000000000001 __zero_reg__ /tmp/cctDMUsY.s:91 .text:0000000000000000 main *COM*:0000000000000002 fp0 /tmp/cctDMUsY.s:205 .text:00000000000000a0 __vector_55 /tmp/cctDMUsY.s:665 .bss:0000000000000000 ou_file_buf /tmp/cctDMUsY.s:264 .text:00000000000000f8 __vector_52 /tmp/cctDMUsY.s:321 .text:0000000000000150 __vector_37 /tmp/cctDMUsY.s:378 .text:00000000000001a8 __vector_26 /tmp/cctDMUsY.s:435 .text:0000000000000200 __vector_54 /tmp/cctDMUsY.s:492 .text:0000000000000258 __vector_51 /tmp/cctDMUsY.s:549 .text:00000000000002b0 __vector_36 /tmp/cctDMUsY.s:606 .text:0000000000000308 __vector_25 UNDEFINED SYMBOLS __do_copy_data __do_clear_bss serial_init_buffered fputs adc_set_reference adc_set_adlar adc_set_prescalar adc_set_enable adc_set_channel adc_read fprintf delay_ms serial_transmit_isr serial_receive_isr