new os version - 0.0.2
This commit is contained in:
parent
59bd203274
commit
c73073971a
@ -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 */
|
||||
|
@ -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_ */
|
||||
|
24
source/os/debug/include/list.h
Normal file
24
source/os/debug/include/list.h
Normal 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_ */
|
22
source/os/debug/include/shell.h
Normal file
22
source/os/debug/include/shell.h
Normal 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_ */
|
Binary file not shown.
@ -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 */
|
||||
|
@ -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_ */
|
||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user