Laxmi 0 Posted July 11, 2017 Share Posted July 11, 2017 Hi, How can I use UART interrupt in Energia? I tried but could not find any example or sample work. Quote Link to post Share on other sites
energia 485 Posted July 11, 2017 Share Posted July 11, 2017 Energia does not implement an API for UART TX/RX interrupt callback. You could however easily modify HardwareSerial.cpp/.h and insert an optional hardware callback. I would add a function e.g. HardwareSerial::attachTxInterrupt(void (*userFunc)(void)) / HardwareSerial::attachRxInterrupt(void (*userFunc)(void)). Use attachInterrupt(void (*userFunc)(void)) in WInterrupts.c as an example. Add the TX and RX userFunc as a private member in HardwareSerial.h. Then in the tx/rx ISR check if the a function has been registered, if so call it. Fmilburn 1 Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.