Documentation for Lib_MCU?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Documentation for Lib_MCU?

456 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Thilo on Tue Jun 14 14:11:06 MST 2011
Hi,

is there some documentation for lib_mcu available?



Thanks!
0 Kudos
5 Replies

396 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Rob65 on Wed Jun 15 02:28:24 MST 2011

Quote: Thilo
I was under the impression that these files were not written by some Embedded Artists developers but some NXP developers



Yes they are written by NXP, you wrote also:


Quote:
they say that it's a modified version of the sources from NXP

Therefor I just referred to the original NXP code - I can't say anything about modifications that Embedded Artists made.

It seems that is is becoming a standard to place documentation inside the code - and nowhere else. Some programmers use something like autodoc which can extract the documentation from the source code.
I prefer to create separate documentation, having the freedom to include different fonts, diagrams or even flow charts make my documentation so much more understandable. It makes sense to incorporate a message flow diagram in a protocol driver and ascii art is so 1980's :rolleyes:

Sometimes I even use hand written diagrams that I digitize into PDF format. I still find that drawing tools limit my thinking process :D

Most of the NXP application notes contain code next to a PDF  file. The PDF file contains the story they want to tell (what the application note is about, what it does and how it works).

Each programmer/organization has its own standards for device drivers and a device driver for FreeRTOS will have a different structure than one for another RTOS or a non-RTOS situation. I once fixed up the I2C driver but already changed it for FreeRTOS - it now even contains a complete task to handle multiple transactions from multiple tasks. so it is hard to define a standard device driver to suit all users.

Regards,

Rob
0 Kudos

396 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Thilo on Wed Jun 15 01:48:09 MST 2011

Quote: Rob65
So ...

you are referring to the quick start board provided by Embedded Artists and the samples that you can download through the support pages of the Embedded Artists website ?

Most of us have only access to the original code that is to be found in the examples delivered with the LPCXpresso environment that can also be downloaded from the LPCXpresso support site.


I was under the impression that these files were not written by some Embedded Artists developers but some NXP developers, hence, I was asking here for some documentation.

And thanks for the heads up, I would have used them without checking them thoroughly. But they do tend to look clean, only the documentation is a bit scarce.
0 Kudos

396 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Rob65 on Tue Jun 14 23:38:12 MST 2011
So ...

you are referring to the quick start board provided by Embedded Artists and the samples that you can download through the support pages of the Embedded Artists website ?

Most of us have only access to the original code that is to be found in the examples delivered with the LPCXpresso environment that can also be downloaded from the LPCXpresso support site.

In the Timer16.c file from the NXP site I see stuff like:
/*****************************************************************************
** Function name:        delayMs
**
** Descriptions:        Start the timer delay in milo seconds
**                        until elapsed
**
** parameters:            timer number, Delay value in milo second             
**                         
** Returned value:        None
** 
*****************************************************************************/
void delayMs(uint8_t timer_num, uint32_t delayInMs)
This certainly looks like [I]some documentation[/I] to me.
But do remember that it is no where stated that this code is bug-free, tested or fit for (production) use.
So if you make use of any code from Lib_MCU, make sure that you test it yourself and be sure that the code does what you want it to do - and nothing else.
This is just a collection of routines that is used in the examples. Most of the functions have no error checking of any kind.
I've been looking at the I2C file and that one contains bugs (the term elephants would fit even better :eek:), there is also no parameter checking, no error handling on the I2C interface and no result returned to the calling program to let us know if a transaction failed or passed.

So be very sure what you are doing when using these files.

They do serve a very good purpose as to show us how one could use a certain peripheral. I have used a number of these files as a starting point for my own device driver library just to make sure that I do not forget to do some stuff like enable clocking or reset an interrupt bit after handling an interrupt.
They are also very nice to create a very quick demo to test a design idea - but once you created your own library you will of course always use that one.

Make sure that if you use or create your own library modules that you test those thoroughly otherwise you will spent time looking for bugs in your application that are actually originating from the library created ...
I'm not only an expert by profession but also an expert by experience ... I spent too much time hunting bugs in drivers that I, or my colleagues, had written.

Regards,

Rob
0 Kudos

396 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Thilo on Tue Jun 14 16:29:31 MST 2011

Quote: atomicdog
What's Lib_MCU?



It's included in the examples shipped with the LPC1343 Quick Start Board and they say that it's a modified version of the sources from NXP, thus I assumed that LPCXpresso ships a lib_mcu or NXP offers such a library.

The library consists of:

Lib_MCU/
|-- inc
|   |-- adc.h
|   |-- clkconfig.h
|   |-- gpio.h
|   |-- i2c.h
|   |-- mcu_regs.h
|   |-- ssp.h
|   |-- timer16.h
|   |-- timer32.h
|   |-- type.h
|   `-- uart.h
|-- readme.txt
`-- src
    |-- adc.c
    |-- clkconfig.c
    |-- gpio.c
    |-- i2c.c
    |-- ssp.c
    |-- timer16.c
    |-- timer32.c
    `-- uart.c
0 Kudos

396 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by atomicdog on Tue Jun 14 15:28:50 MST 2011
What's Lib_MCU?
0 Kudos