kernel: sys: added sysctl to kernel/sys.c

sysctl can be used to change settings of the system during runtime.

Signed-off-by: Michel Megens <dev@michelmegens.net>
dev: core: added API calls to lock a device.

dev_lock:
Lock the device mutex of a given device.

dev_unlock:
Unlock the device mutex of a given device.

Signed-off-by: Michel Megens <dev@michelmegens.net>
kern: sem: added semaphore interface.

Added an interface for semaphore locks:

	* sem_init
	* sem_wait
	* sem_signal
	* sem_try_wait

Signed-off-by: Michel Megens <dev@michelmegens.net>
Merge branch 'master' into sched

Signed-off-by: Michel Megens <dev@michelmegens.net>

Conflicts:
	kernel/Makefile
kern: sem: fixed some build warnings in semaphores

Added semaphore API functions to the semaphore header.

Signed-off-by: Michel Megens <dev@michelmegens.net>
ETA/OS 0.2.0-rc1

Signed-off-by: Michel Megens <dev@michelmegens.net>
kern: sem: added documentation to semaphores.

 * Added a module to doxygen for semaphores.
 * Added doxygen comments to all sem functions and data structures

Signed-off-by: Michel Megens <dev@michelmegens.net>
gpio: core: setup of an initial GPIO core.

Setup of an initial core GPIO driver. Added these two data structures:

	* gpio_pin
	* gpio_chip

A gpio_chip is a chip containing atleast 1 gpio_pin, and has the ability
to control its I/O pins.

Implemented these API functions:

extern struct gpio_pin *gpio_chip_to_pin(struct gpio_chip *chip, uint16_t nr);
extern int gpio_pin_request(struct gpio_pin *pin);
extern int gpio_pin_write(struct gpio_pin *pin, int val);
extern int gpio_pin_read(struct gpio_pin *pin);
extern int gpio_direction_input(struct gpio_pin *pin);
extern int gpio_direction_output(struct gpio_pin *pin, int value);
extern int raw_gpio_direction_ouput(struct gpio_pin *pin, int value);
extern int raw_gpio_pin_write(struct gpio_pin *pin, int val);
extern int raw_gpio_read_pin(struct gpio_pin *pin);

Signed-off-by: Michel Megens <dev@michelmegens.net>
Merge branch 'sched'
kbuild: fixed a kbuild error in kernel/kconfig.

There was a dependency error in the Kconfig file of the kernel/
subsystem. Fixed by added a depends on.

Signed-off-by: Michel Megens <dev@michelmegens.net>
ETA/OS 0.2.0-rc2

Signed-off-by: Michel Megens <dev@michelmegens.net>
gpio: added open source/drain enables.

gpio_set_open_drain:
	Configure a pin as open drain.

gpio_set_open_source:
	Configure a pin as open source.

Signed-off-by: Michel Megens <dev@michelmegens.net>
sched: core: ipm: added Inter-Process Messages.

IPM's are a means to communicate between threads, which might or might
not run on different CPU's. IPM's are there to ensure that chunk of data
safely makes it to the other thread or task.

Implemented:

	* ipm_queue_init : initialise a new IPM queue
	* ipm_post_msg : write a new message to an IPM queue

Signed-off-by: Michel Megens <dev@michelmegens.net>
gpio: added gpio_get_direction

Added an API function to get the direction of a GPIO pin. The pin's
configuration is also updated based on the return value of
gpio_chip::get_direction.

Signed-off-by: Michel Megens <dev@michelmegens.net>
sched: core: ipm: added ipm_get_msg

ipm_get_msg:
	This function can be used by a thread to receive one or more
	IPM's from another thread. Please note that this function blocks
	untill the it receives a message.

Signed-off-by: Michel Megens <dev@michelmegens.net>
sched: core: ipm: added ipm_reset_queue

ipm_reset_queue:
	The function resets the write/read indexes of the queue. This
	function will only work succesfully if there are no threads waiting
	for a message on the IPM queue head.

schedtest:
	Added a test for IPM messages.

ipm message:
	Changed the type of the data pointer to `const void *'.

Signed-off-by: Michel Megens <dev@michelmegens.net>
sched: core: ipm: added queue length check

ipm_queue_is_full:
	This function is used before posting a new message. If the queue
	turns out to be full, the message will not be posted. A queue
	can be emptied by using ipm_reset_queue.

docs:
	Added doxygen documentation to IPM subsystem.

Signed-off-by: Michel Megens <dev@michelmegens.net>
gpio: atmega: added the ATmega GPIO source file.

* The ATmega GPIO driver will be implemented in atmega-gpio.c.
* Moved the GPIO core library from gpio.c to gpiolib.c

Signed-off-by: Michel Megens <dev@michelmegens.net>
Merge branch 'gpio'

* GPIO driver
* Core library
ETA/OS 0.2.0-rc3

Signed-off-by: Michel Megens <dev@michelmegens.net>