Addressing MC board LED's/GPIO Pins
Posted: Fri Jan 12, 2018 5:15 pm
Hi,
trying to address the LED's on my XK-AUDIO-216-MC.
#####################
Found this in gpio_access.h in the sw_usb_audio project, but no clue as how to use it.
Bitwise operations?
/*LED array defines*/
#define LED_ALL_ON 0xf00f
#define LED_SQUARE_BIG 0x9009
#define LED_SQUARE_SML 0x6006
#define LED_ROW_1 0xf001 // ignores that there are 4 rows!
#define LED_ROW_2 0xf003
#define LED_ROW_3 0xf007
#define ALL_OFF 0x0000
// LED array masks
#define LED_MASK_COL_OFF 0x7fff
#define LED_MASK_DISABLE 0xffff
Could someone provide an example of usage?
###################
Also in the hardware manual, a different approach:
UI signal: LED_ROW_0
xCORE GPIO: X1D14
Port: P4C0
Description: Row 0 LED driver control (active low), and so on....
This info is similar to code in the flashing_leds project written for the Start board:
port p = XS1_PORT_4A; // p is acessing 4-bit port A on Start board.
There does not seem to be a XS1_PORT_XX define scheme for MC builds. What's the format?
All WAG's result in "error: initializer element is not constant port q = X1D15_P4C1" yada yada
p <: 0; // on?
p <: 1 // off?
Could someone provide an example of usage?
####################
Thanks!
trying to address the LED's on my XK-AUDIO-216-MC.
#####################
Found this in gpio_access.h in the sw_usb_audio project, but no clue as how to use it.
Bitwise operations?
/*LED array defines*/
#define LED_ALL_ON 0xf00f
#define LED_SQUARE_BIG 0x9009
#define LED_SQUARE_SML 0x6006
#define LED_ROW_1 0xf001 // ignores that there are 4 rows!
#define LED_ROW_2 0xf003
#define LED_ROW_3 0xf007
#define ALL_OFF 0x0000
// LED array masks
#define LED_MASK_COL_OFF 0x7fff
#define LED_MASK_DISABLE 0xffff
Could someone provide an example of usage?
###################
Also in the hardware manual, a different approach:
UI signal: LED_ROW_0
xCORE GPIO: X1D14
Port: P4C0
Description: Row 0 LED driver control (active low), and so on....
This info is similar to code in the flashing_leds project written for the Start board:
port p = XS1_PORT_4A; // p is acessing 4-bit port A on Start board.
There does not seem to be a XS1_PORT_XX define scheme for MC builds. What's the format?
All WAG's result in "error: initializer element is not constant port q = X1D15_P4C1" yada yada
p <: 0; // on?
p <: 1 // off?
Could someone provide an example of usage?
####################
Thanks!