new os version - 0.0.2

This commit is contained in:
tkl 2016-08-10 13:16:10 +02:00
parent 59bd203274
commit c73073971a
8 changed files with 70 additions and 8 deletions

View File

@ -3,10 +3,14 @@
#ifndef BOARD_DEVICES_H
#define BOARD_DEVICES_H
extern const struct driver pwm_4;
extern const struct driver pwm_3;
extern const struct driver pwm_2;
extern const struct driver pwm_1;
extern const struct driver uart_1;
extern const struct driver led_3;
extern const struct driver led_4;
extern const struct driver led_5;
extern const struct driver led_6;
extern const struct driver gpio_c0;
extern const struct driver gpio_c1;
extern const struct driver gpio_c2;
extern const struct driver gpio_c3;
#endif /* BOARD_DEVICES_H */

View File

@ -8,10 +8,13 @@
#ifndef SOURCE_FIRMWARE_KERNEL_DRIVER_INCLUDE_DRIVER_H_
#define SOURCE_FIRMWARE_KERNEL_DRIVER_INCLUDE_DRIVER_H_
#define IOCTL_PWM_SET_DUTY_CYCLE 0
enum driver_type {
DRIVER_TYPE_ADC,
DRIVER_TYPE_GPIO,
DRIVER_TYPE_I2C,
DRIVER_TYPE_PWM,
DRIVER_TYPE_RTC,
DRIVER_TYPE_SPI,
DRIVER_TYPE_UART
@ -26,5 +29,6 @@ int open(const struct driver *driver);
int close(const struct driver *driver);
int read(const struct driver *driver, char *buffer, int len);
int write(const struct driver *driver, const char *buffer, int len);
int ioctl(const struct driver *driver, unsigned int cmd, const void *data);
#endif /* SOURCE_FIRMWARE_KERNEL_DRIVER_INCLUDE_DRIVER_H_ */

View File

@ -0,0 +1,24 @@
/*
* list.h
*
* Created on: Jul 27, 2016
* Author: tkl
*/
#ifndef SOURCE_FIRMWARE_KERNEL_LIST_H_
#define SOURCE_FIRMWARE_KERNEL_LIST_H_
struct list_node {
struct list_node *next;
unsigned int data;
};
struct list {
struct list_node *front;
struct list_node *rear;
};
int list_init(struct list *head);
int list_add(struct list *head, struct list_node *node);
#endif /* SOURCE_FIRMWARE_KERNEL_LIST_H_ */

View File

@ -0,0 +1,22 @@
/*
* shell.h
*
* Created on: Aug 1, 2016
* Author: tkl
*/
#ifndef SOURCE_FIRMWARE_KERNEL_INTERFACE_SHELL_H_
#define SOURCE_FIRMWARE_KERNEL_INTERFACE_SHELL_H_
typedef void *(*command_callback)(const char*);
struct command {
const char *command;
const command_callback command_callback;
struct list_node item;
};
int shell_init(const struct driver *shell_device);
int shell_add_command(struct command *command);
#endif /* SOURCE_FIRMWARE_KERNEL_INTERFACE_SHELL_H_ */

View File

@ -3,10 +3,14 @@
#ifndef BOARD_DEVICES_H
#define BOARD_DEVICES_H
extern const struct driver pwm_4;
extern const struct driver pwm_3;
extern const struct driver pwm_2;
extern const struct driver pwm_1;
extern const struct driver uart_1;
extern const struct driver led_3;
extern const struct driver led_4;
extern const struct driver led_5;
extern const struct driver led_6;
extern const struct driver gpio_c0;
extern const struct driver gpio_c1;
extern const struct driver gpio_c2;
extern const struct driver gpio_c3;
#endif /* BOARD_DEVICES_H */

View File

@ -8,10 +8,13 @@
#ifndef SOURCE_FIRMWARE_KERNEL_DRIVER_INCLUDE_DRIVER_H_
#define SOURCE_FIRMWARE_KERNEL_DRIVER_INCLUDE_DRIVER_H_
#define IOCTL_PWM_SET_DUTY_CYCLE 0
enum driver_type {
DRIVER_TYPE_ADC,
DRIVER_TYPE_GPIO,
DRIVER_TYPE_I2C,
DRIVER_TYPE_PWM,
DRIVER_TYPE_RTC,
DRIVER_TYPE_SPI,
DRIVER_TYPE_UART
@ -26,5 +29,6 @@ int open(const struct driver *driver);
int close(const struct driver *driver);
int read(const struct driver *driver, char *buffer, int len);
int write(const struct driver *driver, const char *buffer, int len);
int ioctl(const struct driver *driver, unsigned int cmd, const void *data);
#endif /* SOURCE_FIRMWARE_KERNEL_DRIVER_INCLUDE_DRIVER_H_ */