Part Number: SYSBIOS
Hello,
For two days I've been wandering lost through this documentation, trying to find out how one can connect a GPIO event (for example GPIO_INT_TYPE_FALL_EDGE) to the ISR that is declared in the CFG file, or created dynamically.
(Not that this should affect things, but I'm using CCS 7, am335x PDK 1.0.7, SYS/BIOS 6.46.5.55)
This page says (obviously) how to activate the GPIO pins. But doesn't say HOW the input change event it tied to the ISR.
https://processors.wiki.ti.com/index.php/StarterWare_GPIO_V2
I've searched dozens of posts, and found no information. This document, also, doesn't detail HOW they are connected.
http://www.ti.com/lit/ug/spruex3t/spruex3t.pdf
I can "register" HWIs all day long. And I can enable the GPIO lines.
But where is the code that actually says :"When the GPIO Input changes, here is the ISR function" ?
Can someone point me to the most basic, fundamental information? Because it's all a breeze in a TIVAC device without using SYSBIOS. But I'm trying to do this in a BBB. And I would like to avoid doing an end-run and going straight to the metal to register things (as I have done before). After all, SYSBIOS is supposed to support all this stuff.
Here is the basic code block I am using "Task_create()" and "BIOS_start()" left off, because they are not relevant to what I need to do.
Hwi_Handle myHwi;
Error_Block eb;
Void myHwiFxn(UArg arg);
void ConfigureHardwareInterrupt() {
Error_init(&eb);
GPIOModuleEnable(SOC_GPIO_1_REGS,1);
GPIOModuleReset(SOC_GPIO_1_REGS);
GPIOSetDirMode(SOC_GPIO_1_REGS,28,GPIO_DIRECTION_INPUT );
GPIOSetIntrType(SOC_GPIO_1_REGS,28,GPIO_INTR_MASK_FALL_EDGE );
GPIOIntrClear (SOC_GPIO_1_REGS,0,28);
GPIOIntrEnable (SOC_GPIO_1_REGS,0,28);
/* This is a SYSBIOS HWI... WHAT TRIGGERS IT?? */
myHwi = Hwi_create(5, myHwiFxn, NULL, &eb);
if (myHwi == NULL) {
System_abort("Hwi create failed");
}
}
Void myHwiFxn(UArg arg) {
/* This SHOULD clear the interrupt flag so it doesn't re-enter. */
GPIOIntrClear (SOC_GPIO_1_REGS,0,28);
/* Here we CLEAR the triggered SYSBIOS HWI, which we have no idea what trigger it yet */
Hwi_clearInterrupt(5);
}
Of course, app.cfg has "var Hwi = xdc.useModule('ti.sysbios.hal.Hwi');" in it, but nothing is using it.
Thanks for any assistance.