Source code file for General Output module.
More...
Go to the source code of this file.
Source code file for General Output module.
Definition in file general_output.c.
◆ generalOutputPin_setPinHigh()
Set output pin high.
- Parameters
-
- Returns
- Result of operations as int16
--> 0 = operation successful
--> -1 = invalid value of GPIO pin
Definition at line 63 of file general_output.c.
66 case 0 ... 31: TMC_BASE_PIO->DATA[0].SET |= ((
Uint32)0x1 << pin);
68 case 32 ... 63: pin -= 32;
69 TMC_BASE_PIO->DATA[1].SET |= ((
Uint32)0x1 << pin);
71 case 64 ... 87: pin -= 64;
72 TMC_BASE_PIO->DATA[2].SET |= ((
Uint32)0x1 << pin);
◆ generalOutputPin_setPinLow()
Set output pin low.
- Parameters
-
- Returns
- Result of operations as int16
--> 0 = operation successful
--> -1 = invalid value of GPIO pin
Definition at line 88 of file general_output.c.
91 case 0 ... 31: TMC_BASE_PIO->DATA[0].CLEAR |= ((
Uint32)0x1 << pin);
93 case 32 ... 63: pin -= 32;
94 TMC_BASE_PIO->DATA[1].CLEAR |= ((
Uint32)0x1 << pin);
96 case 64 ... 87: pin -= 64;
97 TMC_BASE_PIO->DATA[2].CLEAR |= ((
Uint32)0x1 << pin);
◆ init_generalOutputPin()
Configuration of GPIO as general output pin.
- Parameters
-
- Returns
- Result of operations as int16
--> 0 = operation successful
--> -1 = invalid value of GPIO pin
Definition at line 15 of file general_output.c.
18 case 0 ... 31: TMC_BASE_PIO->CTL[0].PUD |= ((
Uint32)0x1 << pin);
20 TMC_BASE_PIO->CTL[0].MUX1 &= ~((
Uint32)0x3 << (pin*2));
23 TMC_BASE_PIO->CTL[0].MUX2 &= ~((
Uint32)0x3 << ((pin-16)*2));
25 TMC_BASE_PIO->CTL[0].DIR |= ((
Uint32)0x1 << pin);
27 case 32 ... 63: pin -= 32;
28 TMC_BASE_PIO->CTL[1].PUD |= ((
Uint32)0x1 << pin);
30 TMC_BASE_PIO->CTL[1].MUX1 &= ~((
Uint32)0x3 << (pin*2));
33 TMC_BASE_PIO->CTL[1].MUX2 &= ~((
Uint32)0x3 << ((pin-16)*2));
35 TMC_BASE_PIO->CTL[1].DIR |= ((
Uint32)0x1 << pin);
37 case 64 ... 87: pin -= 64;
38 TMC_BASE_PIO->CTL[2].PUD |= ((
Uint32)0x1 << pin);
40 TMC_BASE_PIO->CTL[2].MUX1 &= ~((
Uint32)0x3 << (pin*2));
43 TMC_BASE_PIO->CTL[2].MUX2 &= ~((
Uint32)0x3 << ((pin-16)*2));
45 TMC_BASE_PIO->CTL[2].DIR |= ((
Uint32)0x1 << pin);