Is there any information for setting up the pre compiler coding when creating a custom component?
I have written a few Custom code components, and I have a bit of trouble defining the pre compiler section. I have to refer to other components to work out what I need to write for the pre compiler.
If there was a list of instructions and requirements for the pre compiler, it would be so much easier to setup a new custom component.
For example I am trying to setup a SPI device, and the CS pin must be able to use a different port to the SDI,SDO and SCK. If I change the port it changes on all pins. So I need to make the ports and pins individually selectable.
Andrew
See example below.
Code: Select all
[Port]
DesiredPort=0
PortMandatory=0
SamePortAsID=0
[Pins]
Count=4
1=SDO 0
2=SDI 1
3=SCK 2
4=CS 3
[PinPort]
# PORTA = 0
# PORTB = 1
# PORTC = 2
# PORTD = 3
# PORTE = 4
1=0
2=0
3=0
4=0
5=0
6=0
7=0
8=0
[PinDesiredBit]
1=0
2=1
3=2
4=3
5=4
6=5
7=6
8=7
[PinDirection]
# DIR_INPUT = 2
# DIR_OUTPUT = 0
# DIR_BIDIRECTIONAL = 3
1=0
2=0
3=0
4=0
5=0
6=0
7=0
8=0
[PinMustUsePort]
// # boolean
# char
1=1
2=1
3=1
4=1
5=1
6=1
7=1
8=1
[SamePortAsPinX]
# -1 = any pin
# otherwise, the pin number
1=-1
2=-1
3=-1
4=-1
5=-1
6=-1
7=-1
8=-1
[PinMustUsePin]
//# boolean
# char
1=1
2=1
3=1
4=1
5=1
6=1
7=1
8=1
[PinValue]
# boolean (0 = off, 1 = on)