Commit 4c04cd0c authored by raphael.deimel's avatar raphael.deimel
Browse files

add support for setting compressor pin

parent 9f2c35ca
......@@ -169,6 +169,8 @@ const uint32_t PNEUMATICBOX_API_VERSION=6;
const AirServerSignal SIGNAL_VALVE_14 = (BLOCK_SIGNALS_VALVE+14);
const AirServerSignal SIGNAL_VALVE_15 = (BLOCK_SIGNALS_VALVE+15);
const AirServerSignal SIGNAL_COMPRESSOR = (BLOCK_SIGNALS_VALVE+0x81); //extra compressor switch, digital output.
//some special signals:
const AirServerSignal SIGNAL_ZERO = (BLOCK_SIGNALS_SPECIAL+0); //always supplies 0.0
const AirServerSignal SIGNAL_ONE = (BLOCK_SIGNALS_SPECIAL+1); //always supplies 1.0
......
......@@ -225,6 +225,15 @@ namespace AirserverIO{
low |= GPIO_PINMASK[i];
}
}
//set the extra compressor output:
if (GetData(SIGNAL_COMPRESSOR)>= 0.5) {
high |= GPIO_PINMASK[16];
} else {
low |= GPIO_PINMASK[16];
}
BBBIO_GPIO_low( BBBIO_GPIO0, (low >> GPIO_PINMASK_BANK0_OFFSET) & 0xFFFFFFFF );
BBBIO_GPIO_high( BBBIO_GPIO0, (high >> GPIO_PINMASK_BANK0_OFFSET) & 0xFFFFFFFF );
BBBIO_GPIO_low( BBBIO_GPIO2, (low >> GPIO_PINMASK_BANK2_OFFSET) & 0xFFFFFFFF );
......
......@@ -80,7 +80,8 @@ const uint64_t GPIO_PINMASK[] = {
(uint64_t)BBBIO_GPIO_PIN_9 << GPIO_PINMASK_BANK2_OFFSET, /*P8.44*/
(uint64_t)BBBIO_GPIO_PIN_8 << GPIO_PINMASK_BANK2_OFFSET, /*P8.43*/
(uint64_t)BBBIO_GPIO_PIN_7 << GPIO_PINMASK_BANK2_OFFSET, /*P8.46*/
(uint64_t)BBBIO_GPIO_PIN_6 << GPIO_PINMASK_BANK2_OFFSET /*P8.45*/
(uint64_t)BBBIO_GPIO_PIN_6 << GPIO_PINMASK_BANK2_OFFSET, /*P8.45*/
(uint64_t)BBBIO_GPIO_PIN_1 << GPIO_PINMASK_BANK2_OFFSET /*P8.18, compressor pin*/
};
/*
......@@ -102,7 +103,8 @@ const uint64_t GPIO_PINMASK_ALL =
GPIO_PINMASK[12] |
GPIO_PINMASK[13] |
GPIO_PINMASK[14] |
GPIO_PINMASK[15]
GPIO_PINMASK[15] |
GPIO_PINMASK[16]
;
......@@ -118,22 +120,22 @@ const uint32_t __attribute__((__unused__)) GPIO_PINMASK_ALL_BANK2 = (GPIO_PINMA
*/
Gpio(){
/*table for pneumaticbox cape version 2 (march 2015)*/
gpio_table[0] = 11; /* P8.32*/
gpio_table[1] = 10; /* P8.31*/
gpio_table[2] = 81; /* P8.34*/
gpio_table[3] = 9; /* P8.33*/
gpio_table[4] = 80; /* P8.36*/
gpio_table[5] = 8; /* P8.35*/
gpio_table[6] = 79; /* P8.38*/
gpio_table[7] = 78; /* P8.37*/
gpio_table[8] = 77; /* P8.40*/
gpio_table[9] = 76; /* P8.39*/
gpio_table[10] = 75; /* P8.42*/
gpio_table[11] = 74; /* P8.41*/
gpio_table[12] = 73; /* P8.44*/
gpio_table[13] = 72; /* P8.43*/
gpio_table[14] = 71; /* P8.46*/
gpio_table[15] = 70; /* P8.45*/
// gpio_table[0] = 11; /* P8.32*/
// gpio_table[1] = 10; /* P8.31*/
// gpio_table[2] = 81; /* P8.34*/
// gpio_table[3] = 9; /* P8.33*/
// gpio_table[4] = 80; /* P8.36*/
// gpio_table[5] = 8; /* P8.35*/
// gpio_table[6] = 79; /* P8.38*/
// gpio_table[7] = 78; /* P8.37*/
// gpio_table[8] = 77; /* P8.40*/
// gpio_table[9] = 76; /* P8.39*/
// gpio_table[10] = 75; /* P8.42*/
// gpio_table[11] = 74; /* P8.41*/
// gpio_table[12] = 73; /* P8.44*/
// gpio_table[13] = 72; /* P8.43*/
// gpio_table[14] = 71; /* P8.46*/
// gpio_table[15] = 70; /* P8.45*/
};
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment