File: csinglepincomm.h

package info (click to toggle)
simulavr 1.0.0%2Bgit20160221.e53413b-1
  • links: PTS
  • area: main
  • in suites: buster
  • size: 5,748 kB
  • sloc: cpp: 35,491; python: 6,991; ansic: 3,567; makefile: 1,072; sh: 653; asm: 414; tcl: 320
file content (53 lines) | stat: -rw-r--r-- 2,147 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//-----------------------------------------------------------------------------
// Copyright (C) 2009 Onno Kortmann <onno@gmx.net>
//  
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//  
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//  
// You should have received a copy of the GNU General Public License along
// with this program; if not, write to the Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA..
//  
//-----------------------------------------------------------------------------
//
// IMPORTANT NOTE: This file is only to illustrate the simulavrxx<->verilog
// interface and is by no means any reference for anything whatsoever!  It
// probably contains lots of bugs! As already stated above, there is no
// warranty!
//
//-----------------------------------------------------------------------------
#ifndef __SINGLEPINCOMM_H
#define __SINGLEPINCOMM_H
//-----------------------------------------------------------------------------
//! Initialize SPC interface
/* The SPC interface uses the 16bit timer counter1 */
void spc_init();

//! TRX one byte
/* Does not block any interrupts and works through the timer/counter1
   interface and its interrupts.

   Returns the received byte in the low byte.
   If the high byte is non-zero, an error has occured.
   */
uint16_t spc_trx(uint8_t val);

//! Send/receive single bits
uint8_t spc_trx_bit(uint8_t bit);

//! Value for producing delays
extern uint16_t spc_delay;
//! Multiplier value
extern uint8_t spc_multiplier;
/*! Minimum distance (in smaller counts) to the larger plateau before
  signalling an error. */
extern uint8_t spc_mindistance;
//-----------------------------------------------------------------------------
#endif