Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

Streamlining code for Digital I/O in LPC2000

Status
Not open for further replies.

kender

Advanced Member level 4
Joined
Jun 19, 2005
Messages
1,422
Helped
138
Reputation
276
Reaction score
38
Trophy points
1,328
Location
Stanford, SF Bay Peninsula, California, Earth, Sol
Activity points
9,966
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.

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
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
 

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top