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) 48 static uint8_t enabled;
91 if(status(SENSORS_ACTIVE)) {
102 configure(
int type,
int value)
104 if(type != SENSORS_ACTIVE) {
114 return RELAY_SUCCESS;
119 return RELAY_SUCCESS;
122 SENSORS_SENSOR(relay, RELAY_ACTUATOR, value, configure, status);
#define GPIO_SET_PIN(PORT_BASE, PIN_MASK)
Set pins with PIN_MASK of port with PORT_BASE high.
Header file with register and macro declarations for the cc2538 GPIO module.
#define GPIO_CLR_PIN(PORT_BASE, PIN_MASK)
Set pins with PIN_MASK of port with PORT_BASE low.
Header file with declarations for the I/O Control module.
#define GPIO_READ_PIN(PORT_BASE, PIN_MASK)
Read pins with PIN_MASK of port with PORT_BASE.
#define GPIO_SOFTWARE_CONTROL(PORT_BASE, PIN_MASK)
Configure the pin to be software controlled with PIN_MASK of port with PORT_BASE. ...
void ioc_set_over(uint8_t port, uint8_t pin, uint8_t over)
Set Port:Pin override function.
#define GPIO_SET_INPUT(PORT_BASE, PIN_MASK)
Set pins with PIN_MASK of port with PORT_BASE to input.
#define GPIO_SET_OUTPUT(PORT_BASE, PIN_MASK)
Set pins with PIN_MASK of port with PORT_BASE to output.
Header file for the generic relay driver.
#define IOC_OVERRIDE_OE
Output Enable.