soft/lpc122x/core
2 years agoUse const structs for the pio definitions Move the weak definitions outside of the...
Nathael Pajani [Sun, 7 Dec 2014 22:00:07 +0000 (23:00 +0100)]
Use const structs for the pio definitions Move the weak definitions outside of the driver file, so that the compiler cannot optimise and use the empty "weak" definitions. Next step is to merge all definitions in a single table, and call a single pio config function.

2 years agoallow use of different cross-compiler on the command line
Nathael Pajani [Sun, 7 Dec 2014 21:05:01 +0000 (22:05 +0100)]
allow use of different cross-compiler on the command line

2 years agouse const for functions which do not modify the pio structures.
Nathael Pajani [Sun, 7 Dec 2014 21:04:33 +0000 (22:04 +0100)]
use const for functions which do not modify the pio structures.

2 years agostatus-led: put led status in an array
Cyprien Laplace [Sun, 7 Dec 2014 04:18:52 +0000 (23:18 -0500)]
status-led: put led status in an array

2 years agoSeparate internal LPC drivers and external ones Place the external ones in extdrv...
Nathael Pajani [Sat, 6 Dec 2014 01:51:20 +0000 (02:51 +0100)]
Separate internal LPC drivers and external ones Place the external ones in extdrv Split i2c and eeprom in two different headers

2 years agoFix the term colors so that we get back to default and not white (thanks cyprien)
Nathael Pajani [Thu, 4 Dec 2014 02:36:42 +0000 (03:36 +0100)]
Fix the term colors so that we get back to default and not white (thanks cyprien)

2 years ago-ffreestanding Assert that compilation targets a freestanding environment (one with...
Nathael Pajani [Thu, 4 Dec 2014 02:23:18 +0000 (03:23 +0100)]
-ffreestanding Assert that compilation targets a freestanding environment (one with no OS and none of the related stuff) -nostdlib prevents inclusion of standard libraries, which or not present in our system. Requiered parts have been re-implemented (mostly a copy from the Linux kernel code)

2 years agoThis comment comes from the original makefile ... change to the right name :)
Nathael Pajani [Thu, 4 Dec 2014 02:16:24 +0000 (03:16 +0100)]
This comment comes from the original makefile ... change to the right name :)

2 years agoRemove warning on some gcc versions (thanks Alexandre) Add typedef for one of the...
Nathael Pajani [Thu, 4 Dec 2014 02:15:33 +0000 (03:15 +0100)]
Remove warning on some gcc versions (thanks Alexandre) Add typedef for one of the very rare cases in which a typedef makes things somehow more readable, and this still can be discussed ...

2 years agoAllow use of a null status argument.
Nathael Pajani [Wed, 22 Oct 2014 00:29:09 +0000 (02:29 +0200)]
Allow use of a null status argument.

2 years agoAdd comments to signal yet unsupported feature
Nathael Pajani [Tue, 21 Oct 2014 22:21:54 +0000 (00:21 +0200)]
Add comments to signal yet unsupported feature

2 years agoFix problem with ADC at conversion rates above a few hertz (3 or 4Hz) as updated...
Nathael Pajani [Tue, 21 Oct 2014 22:21:08 +0000 (00:21 +0200)]
Fix problem with ADC at conversion rates above a few hertz (3 or 4Hz) as updated in user manual rev2.1 See Section 19.2 of UM10441 revision 2.1 or newer for more information.

2 years agoBetter comments for systick callback information.
Nathael Pajani [Tue, 21 Oct 2014 09:47:04 +0000 (11:47 +0200)]
Better comments for systick callback information.

2 years agoUse second value in config field to select the timer control channel.
Nathael Pajani [Thu, 9 Oct 2014 10:46:13 +0000 (12:46 +0200)]
Use second value in config field to select the timer control channel.

2 years agoAdd partial support for event driven conversions Only two events supported yet. Suppo...
Nathael Pajani [Fri, 26 Sep 2014 10:09:51 +0000 (12:09 +0200)]
Add partial support for event driven conversions Only two events supported yet. Support for new ones will be easy but requires some code refactoring.

2 years agoAdding support for address change Adding support for config register change Set defau...
Nathael Pajani [Fri, 26 Sep 2014 08:54:59 +0000 (10:54 +0200)]
Adding support for address change Adding support for config register change Set default GDO_0 behavior for interrupt on RX packet CRC OK.

2 years agoThe previous test may never come true if we do not set the flag
Nathael Pajani [Thu, 18 Sep 2014 19:53:11 +0000 (21:53 +0200)]
The previous test may never come true if we do not set the flag

2 years agoThere is no "single burst" mode on the LPC1224, remove corresponding code.
Nathael Pajani [Thu, 18 Sep 2014 19:50:12 +0000 (21:50 +0200)]
There is no "single burst" mode on the LPC1224, remove corresponding code.

2 years agoThe ADC resolution cannot be selected on the LPC1224, do not confuse the user.
Nathael Pajani [Thu, 18 Sep 2014 19:42:54 +0000 (21:42 +0200)]
The ADC resolution cannot be selected on the LPC1224, do not confuse the user.

2 years agoSometimes GCC needs Low registers instead of general ones, but we need to tell him...
Nathael Pajani [Thu, 28 Aug 2014 17:34:47 +0000 (19:34 +0200)]
Sometimes GCC needs Low registers instead of general ones, but we need to tell him he can use them. Maybe necessary in other places, but at least fixes the problem i have on my test system. Special thanks to cyprien, once again !

2 years agoAdd support for user information block reading. (Use IAP for writting)
Nathael Pajani [Thu, 28 Aug 2014 11:45:07 +0000 (13:45 +0200)]
Add support for user information block reading. (Use IAP for writting)

2 years agoPartial IAP ROM helpers support
Nathael Pajani [Thu, 28 Aug 2014 11:43:59 +0000 (13:43 +0200)]
Partial IAP ROM helpers support

2 years agoImplement timer interrupt callbacks
Nathael Pajani [Mon, 25 Aug 2014 23:24:21 +0000 (01:24 +0200)]
Implement timer interrupt callbacks

2 years agoRemove comments comming from the linux kernel but irrelevant for us.
Nathael Pajani [Wed, 6 Aug 2014 00:58:51 +0000 (02:58 +0200)]
Remove comments comming from the linux kernel but irrelevant for us.

2 years agoDeclare a weak "empty" pio struct for each driver inside the driver so that there...
Nathael Pajani [Thu, 31 Jul 2014 19:54:22 +0000 (21:54 +0200)]
Declare a weak "empty" pio struct for each driver inside the driver so that there's no need to do it in the "main.c" file when the function is not used.

2 years agoSome more precision in the comments.
Nathael Pajani [Mon, 28 Jul 2014 08:57:11 +0000 (10:57 +0200)]
Some more precision in the comments.

2 years agoSplit build rule in two parts : linking and binary image creation.
Nathael Pajani [Mon, 28 Jul 2014 08:56:15 +0000 (10:56 +0200)]
Split build rule in two parts : linking and binary image creation.

2 years agoArgh ! hidden, silent bug, as I always used port 0 for the pins. (Thank you cyprien...
Nathael Pajani [Mon, 28 Jul 2014 08:51:23 +0000 (10:51 +0200)]
Argh ! hidden, silent bug, as I always used port 0 for the pins. (Thank you cyprien for seeing this one :) Use the port number from the provided pio struct, not from our onw un-initialized one. And make sure both pio struct pointers are not NULL before using them ....

2 years agoHey, this one is for LPC1224 ...
Nathael Pajani [Sun, 27 Jul 2014 23:24:34 +0000 (01:24 +0200)]
Hey, this one is for LPC1224 ...

2 years agoMake sure we receive valid (at least not NULL) pointers Add a few comments
Nathael Pajani [Sun, 27 Jul 2014 23:24:07 +0000 (01:24 +0200)]
Make sure we receive valid (at least not NULL) pointers Add a few comments

2 years agoRemove unusefull flags and move static directive to link options, where it belongs.
Nathael Pajani [Wed, 16 Jul 2014 01:29:16 +0000 (03:29 +0200)]
Remove unusefull flags and move static directive to link options, where it belongs.

2 years agoFunction not used in current main(), so name mismatch not detected.
Nathael Pajani [Thu, 19 Jun 2014 16:02:31 +0000 (18:02 +0200)]
Function not used in current main(), so name mismatch not detected.

2 years agoThis driver is specific to TMP101 sensor, reflect this in files and functions names
Nathael Pajani [Thu, 19 Jun 2014 14:46:38 +0000 (16:46 +0200)]
This driver is specific to TMP101 sensor, reflect this in files and functions names

2 years agoAdding tags and binary to ignore list.
Nathael Pajani [Thu, 19 Jun 2014 13:07:43 +0000 (15:07 +0200)]
Adding tags and binary to ignore list.

2 years agoAdding some comments about the "status" led used on the demo module.
Nathael Pajani [Sun, 8 Jun 2014 22:00:47 +0000 (00:00 +0200)]
Adding some comments about the "status" led used on the demo module.

2 years agoAdding gpio config function, which in turn calls config_pio() and set pin direction...
Nathael Pajani [Sun, 8 Jun 2014 21:59:34 +0000 (23:59 +0200)]
Adding gpio config function, which in turn calls config_pio() and set pin direction and initial state.

2 years agoImproved ADC support (untested)
Nathael Pajani [Sun, 27 Apr 2014 16:52:14 +0000 (18:52 +0200)]
Improved ADC support (untested)

2 years agoThis function is now internal to driver.
Nathael Pajani [Thu, 24 Apr 2014 22:15:37 +0000 (00:15 +0200)]
This function is now internal to driver.

2 years agoOne more part of multiple SPI busses support (not for LPC1224)
Nathael Pajani [Thu, 24 Apr 2014 16:32:33 +0000 (18:32 +0200)]
One more part of multiple SPI busses support (not for LPC1224)

2 years agoCall gpio pins configuration Make the configuration function static.
Nathael Pajani [Thu, 24 Apr 2014 16:31:44 +0000 (18:31 +0200)]
Call gpio pins configuration Make the configuration function static.

2 years agoComments improved or corrected.
Nathael Pajani [Thu, 24 Apr 2014 16:30:54 +0000 (18:30 +0200)]
Comments improved or corrected.

2 years agoRemoving unrequiered include
Nathael Pajani [Thu, 24 Apr 2014 13:04:56 +0000 (15:04 +0200)]
Removing unrequiered include

2 years agoAdd support for the CC1101 chip from TI Receiving is done by pooling Sending is done...
Nathael Pajani [Thu, 24 Apr 2014 02:37:00 +0000 (04:37 +0200)]
Add support for the CC1101 chip from TI Receiving is done by pooling Sending is done when a line has been received on UART1 and the "send" flag set. Need to implement the "packet sent/received" interrupt.

2 years agoNo functional change. Only use the same coding rules as the other files.
Nathael Pajani [Thu, 24 Apr 2014 02:29:40 +0000 (04:29 +0200)]
No functional change. Only use the same coding rules as the other files.

2 years agoImproved name and comment. Made the function specific to eeprom code.
Nathael Pajani [Tue, 22 Apr 2014 21:41:22 +0000 (23:41 +0200)]
Improved name and comment. Made the function specific to eeprom code.

2 years agoImproved and easier GPIO ports access, based on the port defined in the pio struct...
Nathael Pajani [Tue, 22 Apr 2014 21:38:27 +0000 (23:38 +0200)]
Improved and easier GPIO ports access, based on the port defined in the pio struct used for gpio definition.

2 years agoImproved implementation of the SSP (SPI) Bus handling.
Nathael Pajani [Tue, 22 Apr 2014 21:34:56 +0000 (23:34 +0200)]
Improved implementation of the SSP (SPI) Bus handling.

2 years agoUpdated readme
Nathael Pajani [Tue, 22 Apr 2014 17:44:08 +0000 (19:44 +0200)]
Updated readme

2 years agoAllow configuration of UART as RS485 or IrDA (IrDA not tested) Include simple test...
Nathael Pajani [Tue, 22 Apr 2014 17:42:38 +0000 (19:42 +0200)]
Allow configuration of UART as RS485 or IrDA (IrDA not tested) Include simple test to forward characters received on RS485 to the other UART.

2 years agoFix pio definitions (restore green status led !) and status led numbering (not much...
Nathael Pajani [Mon, 21 Apr 2014 21:33:41 +0000 (23:33 +0200)]
Fix pio definitions (restore green status led !) and status led numbering (not much importance, but do it anyway)

2 years agoCLKOUT support and test
Nathael Pajani [Mon, 21 Apr 2014 21:20:51 +0000 (23:20 +0200)]
CLKOUT support and test

2 years agoSome cleanup
Nathael Pajani [Mon, 21 Apr 2014 19:33:27 +0000 (21:33 +0200)]
Some cleanup

2 years agoUtility functions.
Nathael Pajani [Mon, 21 Apr 2014 19:30:06 +0000 (21:30 +0200)]
Utility functions.

2 years agoFix : call the ADC pin configuration ! Comments added, unused headers removed.
Nathael Pajani [Mon, 21 Apr 2014 11:32:53 +0000 (13:32 +0200)]
Fix : call the ADC pin configuration ! Comments added, unused headers removed.

2 years agoComments and typo
Nathael Pajani [Thu, 17 Apr 2014 21:57:12 +0000 (23:57 +0200)]
Comments and typo

2 years agoVery big commit for a big rewrite of the pins configuration process, making it easier...
Nathael Pajani [Thu, 17 Apr 2014 21:56:33 +0000 (23:56 +0200)]
Very big commit for a big rewrite of the pins configuration process, making it easier to select pins functions and configure the code according to the hardware. Some parts still have to be improved (dependent on pins being on port 0). At least the code compiles and runs on the target, and the parts I tested run fine.

2 years agoUse a dummy fault handler in core and move the "user defined" one to main.c
Nathael Pajani [Thu, 17 Apr 2014 09:19:26 +0000 (11:19 +0200)]
Use a dummy fault handler in core and move the "user defined" one to main.c

2 years agoThere are more than the division routines in ROM. Prepare for inclusion of the other...
Nathael Pajani [Thu, 17 Apr 2014 09:13:07 +0000 (11:13 +0200)]
There are more than the division routines in ROM. Prepare for inclusion of the other ones.

2 years agoSystick code review and fix of systick timer frequency.
Nathael Pajani [Thu, 17 Apr 2014 08:59:27 +0000 (10:59 +0200)]
Systick code review and fix of systick timer frequency.

2 years agoBit 14 is used in LPC12xx.
Nathael Pajani [Fri, 14 Mar 2014 09:20:20 +0000 (10:20 +0100)]
Bit 14 is used in LPC12xx.

2 years agoUsing concatenation in macro is confusing as it does not work with variables. Use...
Nathael Pajani [Mon, 3 Mar 2014 21:58:31 +0000 (22:58 +0100)]
Using concatenation in macro is confusing as it does not work with variables. Use a function instead. Adds some code, but not much. LPC_IO_FUNC_ALT() macro is still here for those who need small code.

2 years agoAdd RX callback for UARTs. (To be tested)
Nathael Pajani [Mon, 3 Mar 2014 21:06:45 +0000 (22:06 +0100)]
Add RX callback for UARTs. (To be tested)

2 years agoAdd an easy way to select the GPIO Function on a pin.
Nathael Pajani [Mon, 3 Mar 2014 21:01:32 +0000 (22:01 +0100)]
Add an easy way to select the GPIO Function on a pin.

2 years agoSPI and eeprom chip select fixes.
Nathael Pajani [Thu, 23 Jan 2014 10:22:27 +0000 (11:22 +0100)]
SPI and eeprom chip select fixes.

2 years agoSystem tick callback : the basics of OS implementation :)
Nathael Pajani [Sat, 4 Jan 2014 12:52:13 +0000 (13:52 +0100)]
System tick callback : the basics of OS implementation :)

2 years agoAdd comments
Nathael Pajani [Sat, 4 Jan 2014 12:50:42 +0000 (13:50 +0100)]
Add comments

2 years agoMake timer a parameter of the RGB led test function Remove RGB Led related code from...
Nathael Pajani [Sat, 4 Jan 2014 12:28:41 +0000 (13:28 +0100)]
Make timer a parameter of the RGB led test function Remove RGB Led related code from serial interrupt handler code, to be replaced by some callback mechanism.

2 years agoChange and use defines for ADC channels selection
Nathael Pajani [Sat, 4 Jan 2014 11:05:17 +0000 (12:05 +0100)]
Change and use defines for ADC channels selection

2 years agoUpdated readme
Nathael Pajani [Sun, 29 Dec 2013 21:21:59 +0000 (22:21 +0100)]
Updated readme

2 years agoGPIO interrupts configuration and handling.
Nathael Pajani [Sun, 29 Dec 2013 21:15:33 +0000 (22:15 +0100)]
GPIO interrupts configuration and handling.

2 years agoDo not change data dir for other pins !
Nathael Pajani [Sun, 29 Dec 2013 21:14:18 +0000 (22:14 +0100)]
Do not change data dir for other pins !

2 years agoComment and code for those with a LQFP64 or LQFP100 package.
Nathael Pajani [Sun, 29 Dec 2013 21:13:44 +0000 (22:13 +0100)]
Comment and code for those with a LQFP64 or LQFP100 package.

2 years agoMake use of config_gpio() function in all drivers. Remove unuseful calls to io_config...
Nathael Pajani [Sun, 29 Dec 2013 01:50:45 +0000 (02:50 +0100)]
Make use of config_gpio() function in all drivers. Remove unuseful calls to io_config_clk_*() functions.

2 years agoSPI code rewrite due to difficulties in handling slave select with previous code...
Nathael Pajani [Sun, 29 Dec 2013 01:15:36 +0000 (02:15 +0100)]
SPI code rewrite due to difficulties in handling slave select with previous code when acting as SPI  Partially tested only.

2 years agoImproved comments on error codes.
Nathael Pajani [Sun, 29 Dec 2013 00:35:03 +0000 (01:35 +0100)]
Improved comments on error codes.

2 years agoForgotten include gards
Nathael Pajani [Sun, 29 Dec 2013 00:34:14 +0000 (01:34 +0100)]
Forgotten include gards

2 years agoExport spi_transfer_single_frame() to "user" (code) space
Nathael Pajani [Fri, 13 Dec 2013 10:18:58 +0000 (11:18 +0100)]
Export spi_transfer_single_frame() to "user" (code) space

2 years agoAdding timer mode to timer support Some modification of the timer functions.
Nathael Pajani [Fri, 13 Dec 2013 10:18:06 +0000 (11:18 +0100)]
Adding timer mode to timer support Some modification of the timer functions.

2 years agoSystem tick support Used to implement precise sleeping functions. Adds msleep and...
Nathael Pajani [Fri, 13 Dec 2013 10:16:15 +0000 (11:16 +0100)]
System tick support Used to implement precise sleeping functions. Adds msleep and usleep functions

2 years agoFix some define names
Nathael Pajani [Fri, 13 Dec 2013 10:12:37 +0000 (11:12 +0100)]
Fix some define names

2 years agoFix : it's the port numbers, not the pin numbers.
Nathael Pajani [Tue, 19 Nov 2013 13:25:21 +0000 (14:25 +0100)]
Fix : it's the port numbers, not the pin numbers.

2 years agoMoved the eeprom select used when SPI driver is not present to the eeprom code.
Nathael Pajani [Wed, 13 Nov 2013 15:17:57 +0000 (16:17 +0100)]
Moved the eeprom select used when SPI driver is not present to the eeprom code.

2 years agoAdd SPI support
Nathael Pajani [Wed, 13 Nov 2013 15:17:07 +0000 (16:17 +0100)]
Add SPI support

2 years agoSimple PWM test : RGB Led The color changes according to the data received on serial...
Nathael Pajani [Thu, 7 Nov 2013 02:06:06 +0000 (03:06 +0100)]
Simple PWM test : RGB Led The color changes according to the data received on serial line Note that 0.0.0 is white while black is at 200.200.200

2 years agoAdd support for timers / PWM /Counter Most has not been tested yet.
Nathael Pajani [Thu, 7 Nov 2013 02:02:09 +0000 (03:02 +0100)]
Add support for timers / PWM /Counter Most has not been tested yet.

2 years agoUse config_gpio() to configure GPIO pins.
Nathael Pajani [Thu, 7 Nov 2013 01:03:34 +0000 (02:03 +0100)]
Use config_gpio() to configure GPIO pins.

2 years agoReplace EEPROM_WRITE switch by compile-time define from Makefile.
Nathael Pajani [Thu, 7 Nov 2013 00:47:35 +0000 (01:47 +0100)]
Replace EEPROM_WRITE switch by compile-time define from Makefile.

2 years agoChange to config_gpio function Use port number and pin number as args and get the...
Nathael Pajani [Thu, 7 Nov 2013 00:30:55 +0000 (01:30 +0100)]
Change to config_gpio function Use port number and pin number as args and get the right pointer from corresponding table.

2 years agoPerform config of all pins as GPIO first, then call config functions for pins used...
Nathael Pajani [Wed, 6 Nov 2013 17:41:38 +0000 (18:41 +0100)]
Perform config of all pins as GPIO first, then call config functions for pins used for special functions.

2 years agoAdd ADC support
Nathael Pajani [Wed, 6 Nov 2013 01:05:55 +0000 (02:05 +0100)]
Add ADC support

2 years agoAdd and use io_config_clk_on/off functions.
Nathael Pajani [Wed, 6 Nov 2013 01:03:10 +0000 (02:03 +0100)]
Add and use io_config_clk_on/off functions.

2 years ago"FIXME" is in capital letters.
Nathael Pajani [Wed, 6 Nov 2013 00:54:28 +0000 (01:54 +0100)]
"FIXME" is in capital letters.

2 years agoFix : GPIO is alternate function 6 for those pins (function 0 is debug)
Nathael Pajani [Wed, 6 Nov 2013 00:50:42 +0000 (01:50 +0100)]
Fix : GPIO is alternate function 6 for those pins (function 0 is debug)

2 years agoAdded PIO0_15 as GPIO for easy I2C access. Must be fixed when SPI support is added.
Nathael Pajani [Wed, 6 Nov 2013 00:49:53 +0000 (01:49 +0100)]
Added PIO0_15 as GPIO for easy I2C access. Must be fixed when SPI support is added.

2 years agoImproved README Updated with current lpcprog command line Added supported features
Nathael Pajani [Wed, 6 Nov 2013 00:36:51 +0000 (01:36 +0100)]
Improved README Updated with current lpcprog command line Added supported features

2 years agoChange the name, as the struct is not global, it holds our private information instead !
Nathael Pajani [Wed, 6 Nov 2013 00:34:47 +0000 (01:34 +0100)]
Change the name, as the struct is not global, it holds our private information instead !

2 years agoOups ...
Nathael Pajani [Wed, 6 Nov 2013 00:32:49 +0000 (01:32 +0100)]
Oups ...

2 years agoremove space at end of line
Nathael Pajani [Wed, 6 Nov 2013 00:32:24 +0000 (01:32 +0100)]
remove space at end of line

2 years agoTemp conversion was simpler, but not right for negativ values ... fixed
Nathael Pajani [Mon, 12 Aug 2013 19:49:10 +0000 (21:49 +0200)]
Temp conversion was simpler, but not right for negativ values ... fixed

2 years agoimplement subsystem_power() instead of a specific function in each subsystem
Nathael Pajani [Mon, 22 Jul 2013 23:29:36 +0000 (01:29 +0200)]
implement subsystem_power() instead of a specific function in each subsystem