<commit_before>/********************************************************************
* Description:  hal_stg.c
*               This is the driver for Servo-To-Go Model I & II board.
*
* Author: <NAME>
* License: GPL Version 2
*    
* Copyright (c) 2004 All rights reserved.
*
* Last change: 
* $Revision$
* $Author$
* $Date$
********************************************************************/

/** This is the driver for Servo-To-Go Model I & II board.
    The board includes 8 channels of quadrature encoder input,
    8 channels of analog input and output, 32 bits digital I/O,
    and an interval timer with interrupt.
        
    Installation of the driver only realtime:
    
	insmod hal_stg num_chan=8 dio="IIOO"
	    - autodetects the address
	or
    
	insmod hal_stg base=0x200 num_chan=8 dio="IIOO"
    
    Check your Hardware manual for your base address.

    The digital inputs/outputs configuration is determined by a 
    config string passed to insmod when loading the module.  
    The format consists by a four character string that sets the
    direction of each group of pins. Each character of the direction
    string is either "I" or "O".  The first character sets the
    direction of port A (Port A - DIO.0-7), the next sets 
    port B (Port B - DIO.8-15), the next sets port C (Port C - DIO.16-23), 
    and the fourth sets port D (Port D - DIO.24-31).
    
    The following items are exported to the HAL.
   
    Encoders:
      Parameters:
	float	stg.<channel>.enc-scale
   
      Pins:
	s32	stg.<channel>.enc-counts
	float	stg.<channel>.enc-position

/todo   bit	stg.<channel>.enc-index
/todo  	bit	stg.<channel>.enc-idx-latch
/todo  	bit	stg.<channel>.enc-latch-index
/todo  	bit	stg.<channel>.enc-reset-count
   
      Functions:
        void    stg.<channel>.capture_position
   
   
    DACs:
      Parameters:
	float	stg.<channel>.dac-offset
	float	stg.<channel>.dac-gain
   
      Pins:
	float	stg.<channel>.dac-value
   
      Functions:
	void    stg.<channel>.dac-write
   
   
    ADC:
      Parameters:
/totest	float	stg.<channel>.adc-offset
/totest	float	stg.<channel>.adc-gain
   
      Pins:
/totest	float	stg.<channel>.adc-value
   
      Functions:
/totest	void    stg.<channel>.adc-read
   
   
    Digital In:
      Pins:
	bit	stg.in-<pinnum>
	bit	stg.in-<pinnum>-not
   
      Functions:
	void    stg.digital-in-read
   
   
    Digital Out:
      Parameters:
	bit	stg.out-<pinnum>-invert
   
      Pins:
	bit	stg.out-<pinnum>
   
      Functions:
	void    stg.digital-out-write

*/

/** Copyright (C) 2004 <NAME>
                       <alex DOT joni AT robcon DOT ro>
*/

/** Copyright (C) 2003 <NAME>
                       <jmkasunich AT users DOT sourceforge DOT net>
*/

/* Based on STGMEMBS.CPP from the Servo To Go Windows drivers 
    - Copyright (c) 1996 Servo To Go Inc and released under GPL Version 2 */

/** This program is free software; you can redistribute it and/or
    modify it under the terms of version 2.1 of the GNU General
    Public License as published by the Free Software Foundation.
    This library is distributed in the hope that it will be useful,<commit_msg>updated info regarding credit for emc1<commit_after>/********************************************************************
* Description:  hal_stg.c
*               This is the driver for Servo-To-Go Model I & II board.
*
* Author: <NAME>
* License: GPL Version 2
*    
* Copyright (c) 2004 All rights reserved.
* see below for aditional notes
*
* Last change: 
* $Revision$
* $Author$
* $Date$
********************************************************************/

/** This is the driver for Servo-To-Go Model I & II board.
    The board includes 8 channels of quadrature encoder input,
    8 channels of analog input and output, 32 bits digital I/O,
    and an interval timer with interrupt.
        
    Installation of the driver only realtime:
    
	insmod hal_stg num_chan=8 dio="IIOO"
	    - autodetects the address
	or
    
	insmod hal_stg base=0x200 num_chan=8 dio="IIOO"
    
    Check your Hardware manual for your base address.

    The digital inputs/outputs configuration is determined by a 
    config string passed to insmod when loading the module.  
    The format consists by a four character string that sets the
    direction of each group of pins. Each character of the direction
    string is either "I" or "O".  The first character sets the
    direction of port A (Port A - DIO.0-7), the next sets 
    port B (Port B - DIO.8-15), the next sets port C (Port C - DIO.16-23), 
    and the fourth sets port D (Port D - DIO.24-31).
    
    The following items are exported to the HAL.
   
    Encoders:
      Parameters:
	float	stg.<channel>.enc-scale
   
      Pins:
	s32	stg.<channel>.enc-counts
	float	stg.<channel>.enc-position

/todo   bit	stg.<channel>.enc-index
/todo  	bit	stg.<channel>.enc-idx-latch
/todo  	bit	stg.<channel>.enc-latch-index
/todo  	bit	stg.<channel>.enc-reset-count
   
      Functions:
        void    stg.<channel>.capture_position
   
   
    DACs:
      Parameters:
	float	stg.<channel>.dac-offset
	float	stg.<channel>.dac-gain
   
      Pins:
	float	stg.<channel>.dac-value
   
      Functions:
	void    stg.<channel>.dac-write
   
   
    ADC:
      Parameters:
/totest	float	stg.<channel>.adc-offset
/totest	float	stg.<channel>.adc-gain
   
      Pins:
/totest	float	stg.<channel>.adc-value
   
      Functions:
/totest	void    stg.<channel>.adc-read
   
   
    Digital In:
      Pins:
	bit	stg.in-<pinnum>
	bit	stg.in-<pinnum>-not
   
      Functions:
	void    stg.digital-in-read
   
   
    Digital Out:
      Parameters:
	bit	stg.out-<pinnum>-invert
   
      Pins:
	bit	stg.out-<pinnum>
   
      Functions:
	void    stg.digital-out-write

*/

/** Copyright (C) 2004 <NAME>
                       <alex DOT joni AT robcon DOT ro>
*/

/** Copyright (C) 2003 <NAME>
                       <jmkasunich AT users DOT sourceforge DOT net>
*/

/* Based on STGMEMBS.CPP from the Servo To Go Windows drivers 
    - Copyright (c) 1996 Servo To Go Inc and released under GPL Version 2 */
/* Also relates to the EMC1 code (very similar to STGMEMBS.CPP)
    work done by <NAME>, <NAME> */

/** This program is free software; you can redistribute it and/or
    modify it under the terms of version 2.1 of the GNU General
    Public License as published by the Free Software Foundation.
    This library is distributed in the hope that it will be useful,
{'fraction_non_alphanumeric': 0.1270949720670391, 'fraction_numerical': 0.014276846679081317, 'mean_word_length': 2.498914223669924, 'pattern_counts': {'":': 0, '<': 55, '<?xml version=': 0, '>': 55, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2728541', 'n_tokens_mistral': 2169, 'n_tokens_neox': 2042, 'n_words': 712}