please dont rip this site

This is file HX711HAL.h

This file is part of HX711 routines

by Isaac Marino Bavaresco

/*======================================================================================*/
/*
 Copyright (c) 2016-2019, Isaac Marino Bavaresco
 All rights reserved.
 isaacbavaresco@yahoo.com.br

 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are met:
     * Redistributions of source code must retain the above copyright
       notice, this list of conditions and the following disclaimer.
     * Neither the name of the author nor the
       names of its contributors may be used to endorse or promote products
       derived from this software without specific prior written permission.

 THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY
 EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*============================================================================*/
/*############################################################################*/
/*############################################################################*/
/*
	This file is the "Hardware Abstraction Layer" for the HX711 routines.
	Here you must implement the routines specific for your particular
	hardware/microcontroller, used by the hardware-independent routines
	in HX711.c

	This example file is tailored for Microchip's PIC16Fxxx family using XC8,
	with pin PDSCK connected to RB4 and pin DOUT connected to RB2.
*/
/*############################################################################*/
/*############################################################################*/
/*============================================================================*/
#if         !defined __HX711HAL_H__
#define __HX711HAL_H__
/*============================================================================*/
#include "htc.h"
#include "Delay.h"
/*============================================================================*/
/*============================================================================*/
/*============================================================================*/
/*============================================================================*/
#define PDSCK_PORT  B
#define PDSCK_BIT   4

#define DOUT_PORT   B
#define DOUT_BIT    2
/*============================================================================*/
/*============================================================================*/
/*============================================================================*/
/*============================================================================*/
#define PASTE2B(a,b)            a##b
#define PASTE2(a,b)             PASTE2B(a,b)
#define PASTE3B(a,b,c)          a##b##c
#define PASTE3(a,b,c)           PASTE3B(a,b,c)
#define PASTE4B(a,b,c,d)        a##b##c##d
#define PASTE4(a,b,c,d)         PASTE4B(a,b,c,d)
#define PASTE5B(a,b,c,d,e)      a##b##c##d##e
#define PASTE5(a,b,c,d,e)       PASTE5B(a,b,c,d,e)
/*============================================================================*/
/* This macro creates the expression to access register "TRIS<x>bits.TRIS<x><y>" used below */
#define PDSCK_TRIS              PASTE5( TRIS,  PDSCK_PORT, bits.TRIS, PDSCK_PORT, PDSCK_BIT )
/* This macro creates the expression to access register "PORT<x>bits.R<x><y>" used below */
#define PDSCK_PIN               PASTE5( PORT,  PDSCK_PORT, bits.R, PDSCK_PORT, PDSCK_BIT )

#define DOUT_TRIS               PASTE5( TRIS,  DOUT_PORT, bits.TRIS, DOUT_PORT, DOUT_BIT )
#define DOUT_PIN                PASTE5( PORT,  DOUT_PORT, bits.R, DOUT_PORT, DOUT_BIT )
/*============================================================================*/
#define SystemYield()           (0)
#define SystemEnterCritical()   (0)
#define SystemExitCritical()    (0)

#define DelayAtLeast100ns()     asm( "nop" )
#define DelayAtLeast200ns()     asm( "nop" )
#define DelayAtLeast60us()      Delay_us( 60 )

#define PDSCKSetAsOutput()      (PDSCK_TRIS=0)
#define PDSCKSetPin()           (PDSCK_PIN=1)
#define PDSCKClearPin()         (PDSCK_PIN=0)
#define PDSCKQueryPin()         (PDSCK_PIN)

#define DOUTSetAsInput()        (DOUT_TRIS=1)
#define DOUTQueryPin()          (DOUT_PIN)
/*============================================================================*/
#endif  /*  !defined __HX711HAL_H__ */
/*============================================================================*/


file: /Techref/member/IMB-yahoo-J86/HX711HAL.h.htm, 5KB, , updated: 2019/8/19 05:24, local time: 2024/12/22 18:26, owner: IMB-yahoo-J86,
TOP NEW HELP FIND: 
3.129.253.21:LOG IN

 ©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it! / MAKE!

<A HREF="http://massmind.org/Techref/member/IMB-yahoo-J86/HX711HAL.h.htm"> <PRE></PRE></A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type a nice message (short messages are blocked as spam) in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.


Link? Put it here: 
if you want a response, please enter your email address: 
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
Did you find what you needed?