42#include "lib/sensors.h"
45#define RELAY_PORT_BASE GPIO_PORT_TO_BASE(RELAY_PORT)
46#define RELAY_PIN_MASK GPIO_PIN_MASK(RELAY_PIN)
48static uint8_t enabled;
91 if(status(SENSORS_ACTIVE)) {
102configure(
int type,
int value)
104 if(type != SENSORS_ACTIVE) {
114 return RELAY_SUCCESS;
119 return RELAY_SUCCESS;
122SENSORS_SENSOR(relay, RELAY_ACTUATOR, value, configure, status);
Header file with register and macro declarations for the cc2538 GPIO module.
#define GPIO_SOFTWARE_CONTROL(PORT_BASE, PIN_MASK)
Configure the pin to be software controlled with PIN_MASK of port with PORT_BASE.
#define GPIO_SET_INPUT(PORT_BASE, PIN_MASK)
Set pins with PIN_MASK of port with PORT_BASE to input.
#define GPIO_SET_PIN(PORT_BASE, PIN_MASK)
Set pins with PIN_MASK of port with PORT_BASE high.
#define GPIO_CLR_PIN(PORT_BASE, PIN_MASK)
Set pins with PIN_MASK of port with PORT_BASE low.
#define GPIO_SET_OUTPUT(PORT_BASE, PIN_MASK)
Set pins with PIN_MASK of port with PORT_BASE to output.
#define GPIO_READ_PIN(PORT_BASE, PIN_MASK)
Read pins with PIN_MASK of port with PORT_BASE.
#define IOC_OVERRIDE_OE
Output Enable.
void ioc_set_over(uint8_t port, uint8_t pin, uint8_t over)
Set Port:Pin override function.
Header file with declarations for the I/O Control module.
Header file for the generic relay driver.