* loop and chould be overidden by user defined handlers.
*/
+#include "lib/stdint.h"
#include "core/lpc_regs_12xx.h"
void fault_info(const char* name, uint32_t len) __attribute__ ((weak, alias ("Dummy_Fault_Handler")));
*/
-#include <stdint.h>
#include "core/lpc_regs_12xx.h"
#include "core/lpc_core_cm0.h"
#include "core/system.h"
* Refer to LPC1224 documentation (UM10441.pdf) for more information.
*/
-#include <stdint.h>
#include "core/system.h"
#include "core/lpc_core_cm0.h"
* related functions.
*/
-#include <stdint.h>
-
#include "core/lpc_regs_12xx.h"
#include "core/lpc_core_cm0.h"
#include "core/system.h"
-#include "core/pio.h"
/* Private defines */
* Refer to the LPC1224 documentation (UM10441.pdf) for more information
*/
-#include <stdint.h>
#include "core/lpc_regs_12xx.h"
#include "core/lpc_core_cm0.h"
#include "core/system.h"
#include "core/systick.h"
+#include "lib/errno.h"
/* Static variables */
* the liker script (lpc_link_lpc1224.ld).
*/
-#include <stdint.h>
+#include "lib/stdint.h"
extern unsigned int _start_info;
* This file implements support of the Windowed Watchdog (WWDT)
*/
-#include <stdint.h>
-
#include "core/lpc_regs_12xx.h"
#include "core/lpc_core_cm0.h"
#include "core/system.h"
* Refer to LPC1224 documentation (UM10441.pdf) for more information.
*/
-#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/errno.h"
#include "drivers/adc.h"
/* Should be as near to 9MHz as possible */
*/
-#include <stdint.h>
#include "core/lpc_regs_12xx.h"
#include "core/lpc_core_cm0.h"
#include "core/system.h"
+#include "lib/errno.h"
#include "core/pio.h"
#include "drivers/gpio.h"
* Refer to LPC1224 documentation (UM10441.pdf) for more information.
*/
-#include <stdint.h>
-
#include "core/lpc_regs_12xx.h"
#include "core/lpc_core_cm0.h"
#include "core/system.h"
#include "lib/string.h"
+#include "lib/errno.h"
#include "drivers/i2c.h"
* Refer to LPC12xx documentation (UM10441.pdf) for more information
*/
-#include <stdint.h>
#include "core/lpc_regs_12xx.h"
#include "core/lpc_core_cm0.h"
#include "core/system.h"
/* Both UARTs are available, UART numbers are in the range 0 - 1 */
-#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 "lib/utils.h"
+#include "lib/errno.h"
#include "drivers/serial.h"
struct uart_device
* Refer to LPC1224 documentation (UM10441.pdf) for more information.
*/
-#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/errno.h"
#include "lib/string.h"
#include "drivers/ssp.h"
* Refer to LPC1224 documentation (UM10441.pdf) for more information.
*/
-#include <stdint.h>
+
+#include "lib/stdint.h"
+#include "lib/errno.h"
#include "core/lpc_regs_12xx.h"
#include "core/lpc_core_cm0.h"
#include "core/system.h"
*
*************************************************************************** */
-#include <stdint.h>
+#include "lib/errno.h"
#include "core/lpc_regs_12xx.h"
#include "core/lpc_core_cm0.h"
#include "core/system.h"
*
*/
-#include <stdint.h>
#include "core/lpc_regs_12xx.h"
#include "core/system.h"
#include "core/pio.h"
*
*************************************************************************** */
-#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/errno.h"
#include "lib/string.h"
#include "drivers/gpio.h"
#include "drivers/i2c.h"
* artists on the GPIO Demo module.
*/
-#include <stdint.h>
#include "core/lpc_regs_12xx.h"
#include "core/lpc_core_cm0.h"
#include "core/system.h"
* Refer to HD44780U documentation from Hitachi for more information.
*/
-#include <stdint.h>
#include "core/lpc_regs_12xx.h"
#include "core/lpc_core_cm0.h"
#include "core/system.h"
*
*************************************************************************** */
-#include <stdint.h>
-
#include "core/lpc_regs_12xx.h"
#include "core/system.h"
#include "core/pio.h"
+#include "lib/errno.h"
#include "drivers/gpio.h"
#include "drivers/ssp.h"
#include "extdrv/max31855_thermocouple.h"
*
*************************************************************************** */
-#include <stdint.h>
#include "core/lpc_regs_12xx.h"
#include "core/lpc_core_cm0.h"
#include "core/system.h"
/***************************************************************************** */
-#include <stdint.h>
#include "core/lpc_regs_12xx.h"
#include "core/system.h"
#include "core/pio.h"
*
*************************************************************************** */
-#include <stdint.h>
#include "core/lpc_regs_12xx.h"
#include "core/lpc_core_cm0.h"
#include "core/system.h"
+#include "lib/errno.h"
#include "drivers/i2c.h"
#include "extdrv/tmp101_temp_sensor.h"
*
*/
-#include <stdint.h>
#include "core/lpc_regs_12xx.h"
#include "core/lpc_core_cm0.h"
#include "core/system.h"
#ifndef CORE_IAP_H
#define CORE_IAP_H
-#include <stdint.h>
+#include "lib/stdint.h"
/*******************************************************************************/
* It has nothing related to GPIO function of the pins.
*/
-#include <stdint.h>
+#include "lib/stdint.h"
struct pio {
uint8_t port; /* 0xFF indicates the end of a pin array */
#ifndef CORE_SYSTEM_H
#define CORE_SYSTEM_H
-#include <stdint.h>
+#include "lib/stdint.h"
#include "core/lpc_regs_12xx.h"
#include "core/lpc_core_cm0.h"
#include "core/watchdog.h"
-/* Error Values, from glibc errno.h and errno-base.h */
-#define EIO 5 /* Bad one: Input or Output error. */
-#define E2BIG 7 /* Argument list too long or Data size beyond buffer size */
-#define EAGAIN 11 /* Device already in use */
-#define EFAULT 14 /* Address error */
-#define EBUSY 16 /* Device or ressource Busy */
-#define ENODEV 19 /* No such device */
-#define EINVAL 22 /* Invalid argument */
-#define EBADFD 77 /* Device not initialized */
-#define EREMOTEIO 121 /* Device did not acknowledge */
-
-/* Note on error values for I2C :
- * EIO : Bad one: Illegal start or stop, or illegal state in i2c state machine
- * EFAULT : address above eeprom size
- * EBUSY : Device or ressource Busy or Arbitration lost
- * EREMOTEIO : Device did not acknowledge
- */
-
/***************************************************************************** */
/* Power up defaults */
/***************************************************************************** */
#ifndef CORE_SYSTICK_H
#define CORE_SYSTICK_H
-#include <stdint.h>
+#include "lib/stdint.h"
/***************************************************************************** */
/* System Tick Timer */
#ifndef USER_INFORMATION_BLOCK_H
#define USER_INFORMATION_BLOCK_H
-#include <stdint.h>
+#include "lib/stdint.h"
struct user_info {
char name[48];
#ifndef CORE_WATCHDOG_H
#define CORE_WATCHDOG_H
-#include <stdint.h>
+#include "lib/stdint.h"
#define WDT_CLK_POWER_LOCK (0x01 << 0)
#define WDT_CLK_SRC_LOCK (0x01 << 1)
#define DRIVERS_ADC_H
-#include <stdint.h>
+#include "lib/stdint.h"
/***************************************************************************** */
/* Analog to Digital Converter (ADC) */
#define DRIVERS_GPIO_H
-#include <stdint.h>
+#include "lib/stdint.h"
#include "core/pio.h"
#ifndef DRIVERS_I2C_H
#define DRIVERS_I2C_H
-#include <stdint.h>
+#include "lib/stdint.h"
#define I2C_CLK_100KHz (100*1000)
* Refer to LPC12xx documentation (UM10441.pdf) for more information
*/
-#include <stdint.h>
+#include "lib/stdint.h"
/* Return the number of RTC ticks from system power on.
#define DRIVERS_SERIAL_H
-#include <stdint.h>
+#include "lib/stdint.h"
#define UART0 0
* Refer to LPC1224 documentation (UM10441.pdf) for more information.
*/
-#include <stdint.h>
+#include "lib/stdint.h"
/* Set this to 1 for use of this driver in a multitasking OS, it will activate the SPI Mutex */
#ifndef DRIVERS_TIMERS_H
#define DRIVERS_TIMERS_H
-#include <stdint.h>
-
/***************************************************************************** */
/* Timers */
/***************************************************************************** */
* All timers have 4 channels though 32 bits timers have all 4 channels available
* on capture /match pins while 16bits ones have only two (channels 0 and 1).
* Refer to LPC1224 documentation (UM10441.pdf) for more information.
+
+#include "lib/stdint.h"
*/
#define NUM_TIMERS 4
#define NUM_CHANS 4
#ifndef EXTDRV_CC1101_H
#define EXTDRV_CC1101_H
+#include "lib/stdint.h"
#include "lib/stddef.h"
/******************************************************************************/
*
*/
-#include <stdint.h>
+#include "lib/stdint.h"
/***************************************************************************** */
/* DHT11 Humidity and temp sensor configuration : Set up the GPIO used for
#ifndef EXTDRV_EEPROM_H
#define EXTDRV_EEPROM_H
-#include <stdint.h>
+#include "lib/stdint.h"
/***************************************************************************** */
#ifndef EXTDRV_EPAPER_H
#define EXTDRV_EPAPER_H
-#include <stdint.h>
+#include "lib/stdint.h"
#include "core/pio.h"
#include "drivers/timers.h"
#ifndef EXTDRV_LCD_CHAR_H
#define EXTDRV_LCD_CHAR_H
-#include <stdint.h>
+#include "lib/stdint.h"
#include "core/pio.h"
/* IMPORTANT NOTE :
#ifndef EXTDRV_MAX31855_H
#define EXTDRV_MAX31855_H
-#include <stdint.h>
+#include "lib/stdint.h"
#include "core/pio.h"
/* Support for thermocouple temperature sensors using Maxim's MAX31855 themocouple
#ifndef EXTDRV_NCN5120_H
#define EXTDRV_NCN5120_H
-#include <stdint.h>
+#include "lib/stdint.h"
struct ncn5120_status {
uint8_t operation_mode;
#define EXTDRV_STATUS_LED_H
-#include <stdint.h>
+#include "lib/stdint.h"
#include "core/pio.h"
#ifndef EXTDRV_TEMP_H
#define EXTDRV_TEMP_H
-#include <stdint.h>
+#include "lib/stdint.h"
/***************************************************************************** */
*
*/
-#include <stdint.h>
+#include "lib/stdint.h"
#include "core/pio.h"
--- /dev/null
+/****************************************************************************
+ * lib/errno.h
+ *
+ * Copyright 2016 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/>.
+ *
+ *************************************************************************** */
+
+#ifndef LIB_ERRNO_H
+#define LIB_ERRNO_H
+
+/* Error Values, from glibc errno.h and errno-base.h */
+#define EIO 5 /* Bad one: Input or Output error. */
+#define E2BIG 7 /* Argument list too long or Data size beyond buffer size */
+#define EAGAIN 11 /* Device already in use */
+#define EFAULT 14 /* Address error */
+#define EBUSY 16 /* Device or ressource Busy */
+#define ENODEV 19 /* No such device */
+#define EINVAL 22 /* Invalid argument */
+#define EBADFD 77 /* Device not initialized */
+#define EREMOTEIO 121 /* Device did not acknowledge */
+
+/* Note on error values for I2C :
+ * EIO : Bad one: Illegal start or stop, or illegal state in i2c state machine
+ * EFAULT : address above eeprom size
+ * EBUSY : Device or ressource Busy or Arbitration lost
+ * EREMOTEIO : Device did not acknowledge
+ */
+
+
+#endif /* LIB_ERRNO_H */
#define LIB_PROTOCOLS_DTPLUG_DEFS_H
-#include <stdint.h>
+#include "lib/stdint.h"
/******************************************************************************/
/* These structures define the packets used to transfer data over the serial link
#define LIB_PROTOCOLS_DTPLUG_SLAVE_H
-#include <stdint.h>
+#include "lib/stdint.h"
#include "lib/protocols/dtplug/defs.h"
#ifndef LIB_STDDEF_H
#define LIB_STDDEF_H
+
+#undef __SIZE_TYPE__
+#define __SIZE_TYPE__ long unsigned int
+typedef __SIZE_TYPE__ size_t;
+
+#define NULL ((void *)0)
+
+
/**
* offsetof - return the offset of a member in the containing structure.
*/
--- /dev/null
+/****************************************************************************
+ * lib/stdint.h
+ *
+ * Copyright 2016 Nathael Pajani <nathael.pajani@ed3l.fr>
+ *
+ r
+ * 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/>.
+ *
+ *************************************************************************** */
+
+#ifndef LIB_STDINT_H
+#define LIB_STDINT_H
+
+/* Signed */
+typedef signed char int8_t;
+typedef short int int16_t;
+typedef int int32_t;
+__extension__
+typedef long long int int64_t;
+/* Small types - Signed */
+typedef signed char int_least8_t;
+typedef short int int_least16_t;
+typedef int int_least32_t;
+__extension__
+typedef long long int int_least64_t;
+/* Fast types - Signed */
+typedef signed char int_fast8_t;
+typedef int int_fast16_t;
+typedef int int_fast32_t;
+__extension__
+typedef long long int int_fast64_t;
+
+
+/* Unsigned */
+typedef unsigned char uint8_t;
+typedef unsigned short int uint16_t;
+typedef unsigned int uint32_t;
+__extension__
+typedef unsigned long long int uint64_t;
+/* Small types - Unsigned */
+typedef unsigned char uint_least8_t;
+typedef unsigned short int uint_least16_t;
+typedef unsigned int uint_least32_t;
+__extension__
+typedef unsigned long long int uint_least64_t;
+/* Fast types - Unsigned */
+typedef unsigned char uint_fast8_t;
+typedef unsigned int uint_fast16_t;
+typedef unsigned int uint_fast32_t;
+__extension__
+typedef unsigned long long int uint_fast64_t;
+
+typedef long unsigned int size_t;
+
+
+/* Types for `void *' pointers. */
+typedef int intptr_t;
+typedef unsigned int uintptr_t;
+
+
+/* Largest integral types. */
+__extension__
+typedef long long int intmax_t;
+__extension__
+typedef unsigned long long int uintmax_t;
+
+# define __INT64_C(c) c ## LL
+# define __UINT64_C(c) c ## ULL
+
+
+/* Limits of integral types. */
+
+/* Minimum of signed integral types. */
+#define INT8_MIN (-128)
+#define INT16_MIN (-32767-1)
+#define INT32_MIN (-2147483647-1)
+#define INT64_MIN (-__INT64_C(9223372036854775807)-1)
+/* Maximum of signed integral types. */
+#define INT8_MAX (127)
+#define INT16_MAX (32767)
+#define INT32_MAX (2147483647)
+#define INT64_MAX (__INT64_C(9223372036854775807))
+
+/* Maximum of unsigned integral types. */
+#define UINT8_MAX (255)
+#define UINT16_MAX (65535)
+#define UINT32_MAX (4294967295U)
+#define UINT64_MAX (__UINT64_C(18446744073709551615))
+
+
+#define SIZE_MAX (4294967295UL)
+
+#define __WORDSIZE 32
+
+
+#endif /* LIB_STDINT_H */
#define LIB_STDIO_H
#include <stdarg.h>
-#include <stdint.h>
+#include "lib/stdint.h"
#include "lib/string.h"
#ifndef LIB_STDLIB_H
#define LIB_STDLIB_H
-#include <stdint.h>
+#include "lib/stdint.h"
-/* Simple atoi implementation.
- * Returns the value convertes from the given string.
+/* Simple strtoul implementation.
+ * Returns the value converted from the given string.
* Does not check that the base is respected aside for the use of letters in
* number representation.
*/
#ifndef LIB_STRING_H
#define LIB_STRING_H
-/* Get size_t, and NULL from <stddef.h>. */
-#undef __need_malloc_and_calloc
-#define __need_size_t
-#define __need_NULL
-#include <stddef.h>
-#include <stdint.h>
+#include "lib/stddef.h"
+#include "lib/stdint.h"
/**
* memcpy - Copy one area of memory to another
#define LIB_TIME_H
-#include <stdint.h>
+#include "lib/stdint.h"
/******************************************************************************/
/* Library routines */
/***************************************************************************** */
-#include <stdint.h>
+#include "lib/stdint.h"
/***************************************************************************** */
* http://opengameart.org/content/8x8-ascii-bitmap-font-with-c-source
*/
-#include <stdint.h>
+#include "lib/stdint.h"
#include "lib/font.h"
/*
*
****************************************************************************/
-#include <stdint.h>
#include "core/system.h"
#include "core/iap.h"
#include "core/user_information_block.h"
*
*************************************************************************** */
-#include <stdint.h>
+#include "lib/stdint.h"
+#include "lib/stddef.h"
-/* Simple atoi implementation.
+/* Simple strtoul implementation.
* Returns the value convertes from the given string.
* Does not check that the base is respected aside for the use of letters in
* number representation.
* reentrant and should be faster). Use only strsep() in new code, please.
*/
-/* Get size_t, and NULL from <stddef.h>. */
-#undef __need_malloc_and_calloc
-#define __need_size_t
-#define __need_NULL
-#include <stddef.h>
-
-#include <stdint.h>
+#include "lib/stddef.h"
+#include "lib/stdint.h"
/**
* memcpy - Copy one area of memory to another
*
****************************************************************************/
-#include <stdint.h>
#include "core/lpc_core_cm0.h"
#include "core/system.h"
#include "core/systick.h"
*************************************************************************** */
#include <stdarg.h>
-#include <stdint.h>
+#include "lib/stdint.h"
#include "drivers/serial.h"
#include "lib/string.h"
#include "lib/stdio.h"
*
*************************************************************************** */
-#include <stdint.h>
+#include "lib/stdint.h"
/***************************************************************************** */
*************************************************************************** */
#include <stdarg.h>
-#include <stdint.h>
+#include "lib/stdint.h"
#include "lib/string.h"
#define ZEROPAD (1 << 0) /* pad with zero */