Home Engineering Publications
DACS: ACIA Serial Driver Header File, ACIAserial.h
  next up previous contents
Next: ACIA Serial Driver Code, Up: Firmware Library, dacslib Previous: SCI Serial Driver Code,   Contents

ACIA Serial Driver Header File, ACIAserial.h

The following header file is very similar to SCIserial.c, except it provides declarations for R65C51 ACIA (Asynchronous Communications Interface Adapter) communications. This ACIA is present on the CMD-11A8 single-board computer used in the mixer unit.
 * DACS : Distributed Audio Control System
 *         File: ACIAserial.h
 *       Author: Stephen S. Richardson
 * Date Created: 07.14.97
 *  Environment: ICC11 v4.0, 68HC11 target
 *        Build: library
 * The code, executables, documentation, firmware images, and all related
 * material of DACS are  
 * Copyright (C) 1997 Stephen S. Richardson - ALL RIGHTS RESERVED
 * Source code control:
 * $Id: ACIAserial.h,v 1.1 1997/07/23 22:12:31 prefect Exp prefect $

#ifndef _ACIAserial
#define _ACIAserial

/* ACIA port definitions (CMD11A8) */

#define ACIACTRL *(unsigned char *)(0xB5FB)
#define ACIACMD  *(unsigned char *)(0xB5FA)
#define ACIASTAT *(unsigned char *)(0xB5F9)
#define ACIADATA *(unsigned char *)(0xB5F8)

/* frame markers */
#define DLE 0x10     /* data link escape */
#define STX 0x02     /* start transmit */
#define ETX 0x03     /* end transmit */

/* buffers and lengths */

#define MAXPAYLOAD 128                     /* maximum length of the payload */
#define MAXFRLEN MAXPAYLOAD+MAXPAYLOAD+4   /* max frame length */
#define INBUFLEN MAXFRLEN+1                /* size of input buffer */
#define OUTBUFLEN MAXFRLEN+1               /* size of output buffer */

/* errors */

#define ERRTOOBIG  10         /* frame done; was too big! */

/* structures */

struct cooked_frame {          /* character stuffed frame */
  unsigned int len;
  unsigned int cur;
  unsigned char done;
  unsigned char data[MAXFRLEN];

struct raw_frame {             /* unstuffed frame */
  unsigned int len;
  unsigned int cur;
  unsigned char done;
  unsigned char dleflag;
  unsigned char stflag;
  unsigned char data[MAXPAYLOAD];

int ACIA_poll_in (unsigned char *c);
char ACIA_block_in (void);
void ACIA_chout (unsigned char ch);
void ACIA_out (char *s);
void ACIA_init (void);
void ACIA_prep_raw (struct raw_frame *raw);
void ACIA_prep_cooked (struct cooked_frame *cooked);
void ACIA_data_to_cooked (char *data, int len, struct cooked_frame *cooked);
int ACIA_service (struct raw_frame *inraw, struct cooked_frame *outfr);


Steve Richardson 2000-07-06
Table of Contents

[PDF] [Whole document in PDF 1.9MB]

[more photos and information]

Page last modified:
Copyright © 1993-2000 prefect - All Rights Reserved.