/****************************************************************************
- * drivers/gpio.c
- *
- * Copyright 2012 Nathael Pajani <nathael.pajani@ed3l.fr>
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- *************************************************************************** */
+ * drivers/gpio.c
+ *
+ * Copyright 2012 Nathael Pajani <nathael.pajani@ed3l.fr>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ *************************************************************************** */
/***************************************************************************** */
-/* GPIOs */
+/* GPIOs and GPIO Interrupts */
/***************************************************************************** */
#include "core/lpc_regs_12xx.h"
#include "core/lpc_core_cm0.h"
#include "core/system.h"
+#include "core/pio.h"
#include "drivers/gpio.h"
*
*************************************************************************** */
+
+/**************************************************************************** */
+/* I2C */
+/**************************************************************************** */
+
#include <stdint.h>
#include "core/lpc_regs_12xx.h"
#include "core/lpc_core_cm0.h"
#include "core/system.h"
+#include "core/pio.h"
#include "lib/string.h"
-#include "drivers/gpio.h"
#include "drivers/i2c.h"
#include "core/lpc_regs_12xx.h"
#include "core/lpc_core_cm0.h"
#include "core/system.h"
+#include "core/pio.h"
#include "lib/string.h"
-#include "drivers/timers.h"
-#include "drivers/gpio.h"
#define SERIAL_OUT_BUFF_SIZE 64
struct uart_device
/***************************************************************************** */
/* Public access to UART setup */
-void set_uarts_pins(void)
-{
- int i = 0;
- for (i = 0; i < NUM_UARTS; i++) {
- uart_set_pin_func(i);
- }
-}
-
/* Allow any change to the main clock to be forwarded to us */
void uart_clk_update(void)
{
}
/* Do we need to allow setting of other parameters ? (Other than 8n1) */
-/* Do we need to allow specifying an interrupt handler ? */
int uart_on(uint32_t uart_num, uint32_t baudrate, void (*rx_callback)(char))
{
struct uart_def* uart = NULL;
#include "core/lpc_regs_12xx.h"
#include "core/lpc_core_cm0.h"
#include "core/system.h"
+#include "core/pio.h"
#include "lib/string.h"
#include "drivers/timers.h"
-#include "drivers/gpio.h"
/* These are local to our file */
+/* FIXME : Add callbacks and implement all handlers ! */
/* Handlers */
void TIMER_0_Handler(void)
{
/****************************************************************************
- * serial.h
+ * drivers/serial.h
*
* Copyright 2012 Nathael Pajani <nathael.pajani@ed3l.fr>
*
/***************************************************************************** */
/* Public access to UART setup */
-void set_uarts_pins(void);
/* Allow any change to the main clock to be forwarded to us */
void uart_clk_update(void);
/* Do we need to allow setting of other parameters ? (Other than 8n1) */
-void uart_on(uint32_t uart_num, uint32_t baudrate, void (*rx_callback)(char));
+int uart_on(uint32_t uart_num, uint32_t baudrate, void (*rx_callback)(char));
void uart_off(uint32_t uart_num);
#define DRIVERS_TIMERS_H
#include <stdint.h>
-#include "core/lpc_regs_12xx.h"
/***************************************************************************** */
/* Timers */