From 7b46e4e6521cf0f6a8e508190f410bfe66681ef8 Mon Sep 17 00:00:00 2001 From: Nathael Pajani Date: Tue, 27 Sep 2016 23:03:58 +0200 Subject: [PATCH] Move PIO config related code to pio.c and pio.h --- core/pio.c | 11 +++++++++++ core/system.c | 10 ---------- include/core/pio.h | 6 ++++++ include/core/system.h | 4 ---- 4 files changed, 17 insertions(+), 14 deletions(-) diff --git a/core/pio.c b/core/pio.c index 8381e8d..70732be 100644 --- a/core/pio.c +++ b/core/pio.c @@ -151,3 +151,14 @@ void set_pins(const struct pio_config* pins) } } +/* IO config clock */ +/* To change GPIO config the io config block must be powered on */ +void io_config_clk_on(void) +{ + subsystem_power(LPC_SYS_ABH_CLK_CTRL_IO_CONFIG, 1); +} +void io_config_clk_off(void) +{ + subsystem_power(LPC_SYS_ABH_CLK_CTRL_IO_CONFIG, 0); +} + diff --git a/core/system.c b/core/system.c index 9e970f6..5939c49 100644 --- a/core/system.c +++ b/core/system.c @@ -247,16 +247,6 @@ static void propagate_main_clock(void) adc_clk_update(); } -/* IO config clock */ -/* To change GPIO config the io config block must be powered on */ -void io_config_clk_on(void) -{ - subsystem_power(LPC_SYS_ABH_CLK_CTRL_IO_CONFIG, 1); -} -void io_config_clk_off(void) -{ - subsystem_power(LPC_SYS_ABH_CLK_CTRL_IO_CONFIG, 0); -} /***************************************************************************** */ /* CLK Out */ diff --git a/include/core/pio.h b/include/core/pio.h index f987faa..74cfafc 100644 --- a/include/core/pio.h +++ b/include/core/pio.h @@ -58,6 +58,12 @@ void config_pio(const struct pio* pp, uint32_t mode); /* Configure a set (array) of pins in a single loop */ void set_pins(const struct pio_config* pins); +/* IO config clock */ +/* To change GPIO config the io config block must be powered on */ +void io_config_clk_on(void); +void io_config_clk_off(void); + + /****************************************************************************/ /* GPIO Pins */ #define LPC_GPIO_0_0 {0, 0, 0} diff --git a/include/core/system.h b/include/core/system.h index 88a9897..dc3dfb1 100644 --- a/include/core/system.h +++ b/include/core/system.h @@ -78,10 +78,6 @@ void clock_config(uint32_t freq_sel); /* return current main clock in HZ */ uint32_t get_main_clock(void); -/* IO config clock */ -/* To change GPIO config the io config block must be powered on */ -void io_config_clk_on(void); -void io_config_clk_off(void); /* This is mainly a debug feature, but can be used to provide a clock to an * external peripheral */ -- 2.43.0