kender
Advanced Member level 4
Colleagues,
I’m new to ARMs (the usual disclaimer). Could anyone recommend a convenient library or methodology for streamlining the simple digital I/O. I’m concerned more about code maintainability than the speed of execution. Here’s how it’s done in the IAR examples. I think it’s a lot of code for just being able to toggle a pin high or low.
Of course, it’s not hard to write such library, or make an automatic code generator. But I’d like not to reinvent this wheel if possible. 
- Nick
I’m new to ARMs (the usual disclaimer). Could anyone recommend a convenient library or methodology for streamlining the simple digital I/O. I’m concerned more about code maintainability than the speed of execution. Here’s how it’s done in the IAR examples. I think it’s a lot of code for just being able to toggle a pin high or low.
Code:
// file: board.h
// USB link LED
#define USB_LINK_LED_MASK (1UL<<18)
#define USB_LINK_LED_DIR IO1DIR
#define USB_LINK_LED_FDIR FIO1DIR
#define USB_LINK_LED_SET IO1SET
#define USB_LINK_LED_FSET FIO1SET
#define USB_LINK_LED_CLR IO1CLR
#define USB_LINK_LED_FCLR FIO1CLR
#define USB_LINK_LED_IO IO1PIN
#define USB_LINK_LED_FIO FIO1PIN
- Nick