2 Copyright (C) 2012 jaseg <s@jaseg.de>
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 version 3 as published by the Free Software Foundation.
11 void ${init_function()} (void){
14 //${modulevar("state", None, "B")}
15 void callback_set_${modulevar("state")} (uint16_t payload_offset, uint16_t argsize, uint8_t* args){
16 P${member["port"]}OUT &= ~(1<<${member["pin"]});
18 P${member["port"]}OUT |= (1<<${member["pin"]});
25 void callback_get_${modulevar("state")} (uint16_t payload_offset, uint16_t argsize, uint8_t* args){
28 uart_putc(!!(P${member["port"]}IN & (1<<${member["pin"]})));
33 //${modulevar("direction", None, "B")}
34 void callback_set_${modulevar("direction")} (uint16_t payload_offset, uint16_t argsize, uint8_t* args){
35 P${member["port"]}DIR &= ~(1<<${member["pin"]});
37 P${member["port"]}DIR |= (1<<${member["pin"]});
44 void callback_get_${modulevar("direction")} (uint16_t payload_offset, uint16_t argsize, uint8_t* args){
47 uart_putc(!!(P${member["port"]}DIR & (1<<${member["pin"]})));