/* GPIOs */
/***************************************************************************** */
+/* Public access to Pins setup */
#include <stdint.h>
#include "core/pio.h"
+
/***************************************************************************** */
-/* Public access to GPIO setup */
static volatile uint32_t* pio_regs_handles_port0[PORT0_NB_PINS] = {
&(LPC_IO_CONTROL->pio0_0),
&(LPC_IO_CONTROL->pio0_1),
/***************************************************************************** */
/* ADC Setup : private part : Clocks, Pins, Power and Mode */
-extern struct pio adc_pins[];
+struct pio adc_pins[] __attribute__ ((weak)) = {
+ ARRAY_LAST_PIN,
+};
static void set_adc_pins(void)
{
/* GPIO setup */
/* Set all GPIO used in a default state */
-extern struct pio gpio_pins[];
+struct pio gpio_pins[] __attribute__ ((weak)) = {
+ ARRAY_LAST_PIN,
+};
static void set_gpio_pins(void)
{
}
/* I2C Pins configuration */
-extern struct pio i2c0_pins[];
+struct pio i2c0_pins[] __attribute__ ((weak)) = {
+ ARRAY_LAST_PIN,
+};
+
static void set_i2c_pins(void)
{
/* Note : We MUST set LPC_IO_DIGITAL for Rx even if the bit is marked as "Reserved" in
* the datasheet !
*/
-extern struct pio uart0_pins[];
-extern struct pio uart1_pins[];
+struct pio uart0_pins[] __attribute__ ((weak)) = {
+ ARRAY_LAST_PIN,
+};
+struct pio uart1_pins[] __attribute__ ((weak)) = {
+ ARRAY_LAST_PIN,
+};
static void uart_set_pin_func(uint32_t uart_num)
{
}
/* Configure all SPI pins. */
-extern struct pio ssp0_pins[];
+struct pio ssp0_pins[] __attribute__ ((weak)) = {
+ ARRAY_LAST_PIN,
+};
static void ssp_set_pin_func(uint32_t ssp_num)
{
int i = 0;
/* Setup timer pins to be used as match or capture pin */
-extern struct pio timer0_pins[];
-extern struct pio timer1_pins[];
-extern struct pio timer2_pins[];
-extern struct pio timer3_pins[];
+struct pio timer0_pins[] __attribute__ ((weak)) = {
+ ARRAY_LAST_PIN,
+};
+struct pio timer1_pins[] __attribute__ ((weak)) = {
+ ARRAY_LAST_PIN,
+};
+struct pio timer2_pins[] __attribute__ ((weak)) = {
+ ARRAY_LAST_PIN,
+};
+struct pio timer3_pins[] __attribute__ ((weak)) = {
+ ARRAY_LAST_PIN,
+};
#define LPC_TIMER_PIN_CONFIG (LPC_IO_MODE_PULL_UP | LPC_IO_DIGITAL | LPC_IO_DRIVE_HIGHCURENT)
static void timer_pins_setup(uint32_t timer_num)
#ifndef CORE_PIO_H
#define CORE_PIO_H
+/* The "PIO" module gives access to the configuration of all the pins of the
+ * micro-controller, whatever the function of the pin.
+ * It has nothing related to GPIO function of the pins.
+ */
+
#include <stdint.h>
struct pio {