mediacore-hid/cfg/piio.conf

148 lines
5.4 KiB
Plaintext
Raw Normal View History

2018-09-24 17:45:06 +02:00
# Example configuration file for PiIo
#
# Configuration is done in groups called I/O groups.
# Each IO group can only contain I/O's of one type, e.g. only Raspberry Pi GPIOs or only pins on one MCP23017 IO expander
# for each type there are parameters
# Each group has a unique name
# Note that in this example config file, all actual code is initially commented out to avoid problems directly after install
/*
# Io Group called GPIO
GPIO:
{
# it is of I/O type "GPIO", indicating it uses Raspberry Pi internal GPIOS
type = "GPIO";
# Settings for this groups PWM generatoer
pwm-tickdelay-us = 1600; # Number of microseconds between ticks
pwm-ticks = 16; # Number of ticks in a pwm cycle
# Settings for the individual I/O's
# Here too, each I/O has it's own type and it's own id.
io:
{
# Input called 'intest'
intest:
{
# It is of type "MULTIBITIN", which means that it takes values from multiple
# bits and combines it into a single number value.
# (To use a multibit output, you can use the type "MULTIBITOUT", which takes the same configuration, minus the additional settings)
type: "MULTIBITIN";
# The 'pins' options specified the pins that are used for the multibit input.
# For the GPIO, it takes the BCM identifiers. Both revision 1 and 2 are supported, and converted to the proper pin automatically
# Bit order is important, MSB first, LSB last.
pins: [17, 18];
# Additional config options are:
// pullup: True/False # Default: False - Enable/disable internal pullup (currently not functional on GPIO type)
// invert: True/False # Default: False - Invert the input pins before processing
// int-enabled: True/False # Default: True - Trigger an event on value change for this input
}
# Button called 'btn'
btn:
{
# Input of type "BUTTON", which means a single input pin, treated as a button.
# Buttons can trigger only 'Pressed' and 'Held' events, which trigger when the button is either pressed
# for a minimum of (default) 25 ms, or held for a minimum of (default) 6000 ms
# These values can be configured in the IO Group config
type: "BUTTON";
# Button is connected on pin 4.
pin: 4;
# Additional config options are:
// pullup: True/False # Default: True - Enable/disable internal pullup (currently not functional on GPIO type)
// invert: True/False # Default: True - Invert the input pins before processing
// int-enabled: True/False # Default: True - Trigger an event on value change for this input
# Note that defaults for buttons are different from defaults for other inputs (invert and pullup true by default for buttons)
}
# Output called 'led1'
led1:
{
# Output of type "OUTPUTPIN", which means a single output pin.
type: "OUTPUTPIN";
# Output on pin 23
pin: 23;
};
# Output called 'led1'
led2:
{
# Output of type "OUTPUTPIN", which means a single output pin.
type: "OUTPUTPIN";
# Output on pin 24
pin: 24;
};
# PWM Output called 'led3'
led3:
{
# Output of type "PWMPIN", which means pwm on a single output pin.
# Note that using PWM takes up processor time,
# currently around 5% for mcp23017 pins, and up to 30% for GPIO pins. (This last value is being worked on)
type: "PWMPIN";
# Output on pin 23
pin: 25;
};
};
}
*/
/*
# Io Group called GPIO
MCP1:
{
# it is of I/O type "MCP23017", indicating it uses an MCP23017 I2C I/O expander chip
type = "MCP23017";
# The MCP23017 needs an I2C address, and optionally a GPIO I/O pin to receive interrupts on
address = 0x20;
intpin = 22;
# Settings for the individual I/O's
# Here too, each I/O has it's own type and it's own id.
# Note that the pin id's for an MCP23017 are counted from the GPA0 as pin 0 up to GPB7 as pin 15
io:
{
# Input called 'sensor1'
sensor1:
{
# It is of type "INPUTPIN", which means that it takes the value from the single input pin
type: "INPUTPIN";
# Input on pin 7
pin: 7;
}
leda:
{
# Output of type "PWMPIN", which means pwm on a single output pin.
# Note that using PWM takes up processor time,
# currently around 5% for mcp23017 pins, and up to 30% for GPIO pins. (This last value is being worked on)
type: "PWMPIN";
# Output on pin 8
pin: 8;
}
ledb:
{
# Output of type "PWMPIN", which means pwm on a single output pin.
# Note that using PWM takes up processor time,
# currently around 5% for mcp23017 pins, and up to 30% for GPIO pins. (This last value is being worked on)
type: "PWMPIN";
# Output on pin 9
pin: 9;
}
}
}
*/