GPIB_AVR
|
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/pgmspace.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include "uart.h"
#include "gpib.h"
#include "timer16.h"
#include "debugshell.h"
Defines | |
#define | WRITE |
if WRITE is defined, the "real" controller code is used, if not defined, simple listener code is executed. | |
#define | ASCII_CODE_CR 0x0d |
#define | ASCII_CODE_LF 0x0a |
#define | ADDRESS_NOT_SET 0xff |
Functions | |
uchar | input_process (void) |
Processing user input. | |
void | printHelp () |
char * | getRevision () |
Extracts the revision number from a SVN revision string. | |
int | main (void) |
GPIB controller main function. | |
Variables | |
uchar | buf [64] |
buffers used for commands and output strings | |
uchar | cmd_buf [64] |
int | buf_ptr = 0 |
pointer in buffer | |
int | rs232_remote_echo = 1 |
set to 1 to do line echo of all chars received by controller |
#define ADDRESS_NOT_SET 0xff |
Referenced by main().
#define ASCII_CODE_CR 0x0d |
Referenced by input_process().
#define ASCII_CODE_LF 0x0a |
#define WRITE |
if WRITE is defined, the "real" controller code is used, if not defined, simple listener code is executed.
char * getRevision | ( | ) |
Extracts the revision number from a SVN revision string.
utility function to extracts the revision number from a SVN revision string. E.g for "$Revision: 689 $" is returned "688".
Referenced by printHelp().
uchar input_process | ( | void | ) |
Processing user input.
Read in user input via rs232 using peter fleurys UART library.
References ASCII_CODE_CR, buf, buf_ptr, rs232_remote_echo, UART_BUFFER_OVERFLOW, UART_FRAME_ERROR, uart_getc(), UART_NO_DATA, UART_OVERRUN_ERROR, uart_putc(), and uart_puts_P.
Referenced by main().
int main | ( | void | ) |
GPIB controller main function.
Implementation of GPIB controller. Reads a command from RS232, sends it via bus. If The command contains a '?', an answer from the device is expected and read in. The answer then is printed out. If an SRQ occured, a serial poll is initiated.
print some usage infos
References address2ListenerAddress, address2TalkerAddress, ADDRESS_NOT_SET, buf, buf_ptr, cmd_buf, debugshell(), DI, G_CMD_UNL, G_CMD_UNT, G_SRQ, gpib_cmd(), gpib_controller_assign(), gpib_get_address(), gpib_get_partner(), gpib_init(), gpib_receive(), gpib_serial_poll(), gpib_set_partner(), gpib_write(), input_process(), printHelp(), s, TalkerAddress2Address, timer16_init(), uart_putc(), and uart_puts().
void printHelp | ( | ) |
References buf, getRevision(), and uart_puts().
Referenced by main().
buffers used for commands and output strings
Referenced by debugshell(), gpib_info(), input_process(), main(), and printHelp().
int buf_ptr = 0 |
pointer in buffer
Referenced by debugshell(), input_process(), and main().
int rs232_remote_echo = 1 |
set to 1 to do line echo of all chars received by controller
Referenced by input_process().