# hal_gruner_707L_latching_relay.h File Reference

`#include "../HAL/hal.h"`

#define | RELAY_0_0FF_PORT P5OUT
#define | RELAY_0_0FF_PIN BIT4
#define | RELAY_0_ON_PORT P5OUT
#define | RELAY_0_ON_PIN BIT5
#define | RELAY_1_0FF_PORT P5OUT
#define | RELAY_1_0FF_PIN BIT6
#define | RELAY_1_ON_PORT P5OUT
#define | RELAY_1_ON_PIN BIT7
#define | ERROR_INVALID_RELAY -1
#define | ERROR_INVALID_ACTION -2
#define | RELAY_ON 1
#define | RELAY_OFF 0
#define | RELAY_CHANNEL_1 1
#define | RELAY_CHANNEL_0 0
#define | RELAY_COIL_ACTIVATION_TIME_MS 20
signed char | setRelay (char channel, char action)

## Detailed Description

Rev
  656

Author
  dsmith

Date
  2010-07-12 17:56:08 -0700 (Mon, 12 Jul 2010)

## Function Documentation

signed char setRelay | ( | char | channel,
|  | char | action |
| ) |  |  |

Set the specified relay on or off sends a 15mSec pulse to the appropriate relay coil disables interrupts during pulse Does NOT read relay status from EEPROM, does not store the new relay status in EEPROM Precondition: pins configured as digital outputs

Returns:
  -1 if invalid channel, -2 if invalid action, 0 if success

All Files Functions Variables