Dwengo board configuration. More...
Defines | |
| #define | TRUE 1 |
| #define | FALSE 0 |
| #define | HIGH 1 |
| #define | LOW 0 |
| #define | PRESSED 0 |
| #define | INPUT 1 |
| #define | OUTPUT 0 |
| #define | BYTE unsigned char |
| #define | LEDS PORTD |
| #define | LEDS_DIR TRISD |
| #define | LED0 PORTDbits.RD0 |
| #define | LED1 PORTDbits.RD1 |
| #define | LED2 PORTDbits.RD2 |
| #define | LED3 PORTDbits.RD3 |
| #define | LED4 PORTDbits.RD4 |
| #define | LED5 PORTDbits.RD5 |
| #define | LED6 PORTDbits.RD6 |
| #define | LED7 PORTDbits.RD7 |
| #define | SW_C PORTBbits.RB2 |
| #define | SW_C_DIR TRISBbits.TRISB2 |
| #define | SW_N PORTBbits.RB4 |
| #define | SW_N_DIR TRISBbits.TRISB4 |
| #define | SW_E PORTBbits.RB1 |
| #define | SW_E_DIR TRISBbits.TRISB1 |
| #define | SW_S PORTBbits.RB5 |
| #define | SW_S_DIR TRISBbits.TRISB5 |
| #define | SW_W PORTBbits.RB0 |
| #define | SW_W_DIR TRISBbits.TRISB0 |
| #define | isPressedSW_N() (SW_N==PRESSED) |
| #define | isPressedSW_E() (SW_E==PRESSED) |
| #define | isPressedSW_S() (SW_S==PRESSED) |
| #define | isPressedSW_W() (SW_W==PRESSED) |
| #define | isPressedSW_C() (SW_C==PRESSED) |
| #define | LCD_DATA PORTD |
| #define | LCD_DATA_DIR TRISD |
| #define | LCD_BACKLIGHT PORTCbits.RC0 |
| #define | LCD_BACKLIGHT_DIR TRISCbits.TRISC0 |
| #define | LCD_RW PORTEbits.RE1 |
| #define | LCD_RW_DIR TRISEbits.TRISE1 |
| #define | LCD_RS PORTEbits.RE0 |
| #define | LCD_RS_DIR TRISEbits.TRISE0 |
| #define | LCD_EN PORTEbits.RE2 |
| #define | LCD_EN_DIR TRISEbits.TRISE2 |
| #define | SERVO1 LATBbits.LATB5 |
| #define | SERVO1_DIR TRISBbits.TRISB5 |
| #define | SERVO2 LATBbits.LATB4 |
| #define | SERVO2_DIR TRISBbits.TRISB4 |
| #define | MOTOR1_0 PORTCbits.RC2 |
| #define | MOTOR1_0_DIR TRISCbits.TRISC2 |
| #define | MOTOR1_1 PORTAbits.RA4 |
| #define | MOTOR1_1_DIR TRISAbits.TRISA4 |
| #define | MOTOR2_0 PORTCbits.RC1 |
| #define | MOTOR2_0_DIR TRISCbits.TRISC1 |
| #define | MOTOR2_1 PORTBbits.RB3 |
| #define | MOTOR2_1_DIR TRISBbits.TRISB3 |
Functions | |
| void | initBoard (void) |
| Initialize Dwengo board. | |
| void | setLedRegister (BYTE led) |
| Set all LEDs at once. | |
| void | setLed (BYTE position) |
| Set specific LED. | |
| void | clearLed (BYTE position) |
| Clear specific LED. | |
| void | setLedPattern (BYTE ld7, BYTE ld6, BYTE ld5, BYTE ld4, BYTE ld3, BYTE ld2, BYTE ld1, BYTE ld0) |
| Set LED pattern. | |
Dwengo board configuration.
Dwengo board settings, also supports WELEK version
| void clearLed | ( | BYTE | position | ) |
Clear specific LED.
Clears a specific LED
| position | position of the LED to set |
| void initBoard | ( | void | ) |
Initialize Dwengo board.
Initialization routine for the Dwengo board. Enables pull-ups for PORT B, enables all switches and sets LED pins as outputs. Additionally the LCD is initialized by this function.
| void setLed | ( | BYTE | position | ) |
Set specific LED.
Set a specific LED
| position | position of the LED to set |
| void setLedPattern | ( | BYTE | ld7, |
| BYTE | ld6, | ||
| BYTE | ld5, | ||
| BYTE | ld4, | ||
| BYTE | ld3, | ||
| BYTE | ld2, | ||
| BYTE | ld1, | ||
| BYTE | ld0 | ||
| ) |
Set LED pattern.
Set a specific LED pattern
| ld7 | state of led 7 (0 is off, 1 is on) |
| ld6 | state of led 6 (0 is off, 1 is on) |
| ld5 | state of led 5 (0 is off, 1 is on) |
| ld4 | state of led 4 (0 is off, 1 is on) |
| ld3 | state of led 3 (0 is off, 1 is on) |
| ld2 | state of led 2 (0 is off, 1 is on) |
| ld1 | state of led 1 (0 is off, 1 is on) |
| ld0 | state of led 0 (0 is off, 1 is on) |
| void setLedRegister | ( | BYTE | led | ) |
Set all LEDs at once.
Set all LEDs at once
| led | value that you want to initialize PORTD (LEDS) with |
1.7.3