Help setting up serial UART interrupt

Hi. I’m having a little trouble trying to figure out how to set up serial interrupts. I’m working with an ME9210 and NET+OS. First off, I’m not sure if I’m installing the interrupt correctly:

retval = naIsrInstall(UARTA_INTERRUPT, (MC_ISR_HANDLER)TESTisr, NULL);

When I use UARTA_INTERRUPT it’s failing to install (I get return code -3). Using UARTB_INTERRUPT returns successfully however. Could this be because RealPort is installed on UARTA? Under naIsrInstall in the DigiESP Help only two error return values are listed, NA_INTERRUPT_IN_USE and NA_INVALID_LEVEL so I have no idea what a return code of ‘-3’ means. Or could this error be occurring because I haven’t set up the associated registers?

(btw, naIsrInstall really should return an enumerated type, such as NaStatus, not ‘int’, as the documentation states. Returning -3 means absolutely nothing if you don’t know what set of enumerated types it’s referring to. Anyway…) Also, why does the Programmer_Guide.pdf discuss NAInstallIsr, and Digi ESP Help discusses naIsrInstall and has no results for NAInstallIsr? Is one part of the ThreadX API and the other NET+OS only?

How are registers written, and where are those register names documented?

The hardware reference lists the various serial events you can use to generate an interrupt (under the UART Interrupt Enable Register section), but I’m unclear what function(s) is/are used to set those registers. Is this done using narm_write_reg()? Where is narm_write_reg() documented? Its usage is not documented in the Digi ESP help.

Similarly, say I want to write the serial UART Interrupt Enable Register, or the Receive Character Match Control how do I know what these registers are actually called in code? Where is this documented?

Hello jdosher,

What is it you are trying to do? The UART isrs are in use by the serial driver, so that it why you are getting an error. Only one callback can be assigned to an ISR at a time.

Most of the options you want to set can be done through the serial driver API, see tcgetattr() and txsetattr() for example.