}
+/***************************************************************************** */
+/* GPIO Filtering CLK dividers */
+/***************************************************************************** */
+/* Configure a GPIO filtering clock divider
+ * There are 7 clock dividers which can be used by any GPIO to filter input glitches
+ * Filter clock selection is made per GPIO among one of the seven available filter clocks
+ * wich are derived from the main clock and divided by a value configured in the
+ * IO_config_clk_div[] registers.
+ * clk_div is a value between 0 and 255, with 0 disabling the divider.
+ */
+
+void config_gpio_filtering_clk_divider(uint8_t clk_num, uint8_t clk_div)
+{
+ struct lpc_sys_config* sys_config = LPC_SYS_CONFIG;
+
+ if (clk_num > 6) {
+ return;
+ }
+ sys_config->IO_config_clk_div[6 - clk_num] = clk_div;
+}
+uint8_t get_gpio_filtering_clk_divider(uint8_t clk_num)
+{
+ struct lpc_sys_config* sys_config = LPC_SYS_CONFIG;
+ if (clk_num > 6) {
+ return 0;
+ }
+ return sys_config->IO_config_clk_div[clk_num];
+}
+
/***************************************************************************** */
/* CLK Out */
/***************************************************************************** */
uint32_t get_main_clock(void);
+/***************************************************************************** */
+/* GPIO Filtering CLK dividers */
+/***************************************************************************** */
+/* Configure a GPIO filtering clock divider
+ * There are 7 clock dividers which can be used by any GPIO to filter input glitches
+ * Filter clock selection is made per GPIO among one of the seven available filter clocks
+ * wich are derived from the main clock and divided by a value configured in the
+ * IO_config_clk_div[] registers.
+ * clk_div is a value between 0 and 255, with 0 disabling the divider.
+ */
+
+void config_gpio_filtering_clk_divider(uint8_t clk_num, uint8_t clk_div);
+uint8_t get_gpio_filtering_clk_divider(uint8_t clk_num);
+
+
+/***************************************************************************** */
+/* CLK Out */
+/***************************************************************************** */
+
/* This is mainly a debug feature, but can be used to provide a clock to an
* external peripheral */
void clkout_on(uint32_t src, uint32_t div);