Relocate SGPIO pin configuration -- it only needs to be done once.

This commit is contained in:
Jared Boone
2013-11-20 13:22:19 -08:00
parent 39276f162c
commit e3f9e204c1
2 changed files with 3 additions and 4 deletions

View File

@ -25,6 +25,7 @@
#include "si5351c.h"
#include "max2837.h"
#include "rffc5071.h"
#include "sgpio.h"
#include <libopencm3/lpc43xx/i2c.h>
#include <libopencm3/lpc43xx/cgu.h>
#include <libopencm3/lpc43xx/gpio.h>
@ -588,6 +589,8 @@ void pin_setup(void) {
/* Configure external clock in */
//scu_pinmux(P4_7, SCU_CLK_IN | SCU_CONF_FUNCTION1);
sgpio_configure_pin_functions();
}
void enable_1v8_power(void) {

View File

@ -63,8 +63,6 @@ void sgpio_test_interface() {
// Disable all counters during configuration
SGPIO_CTRL_ENABLE = 0;
sgpio_configure_pin_functions();
// Make all SGPIO controlled by SGPIO's "GPIO" registers
for (uint_fast8_t i = 0; i < 16; i++) {
SGPIO_OUT_MUX_CFG(i) =
@ -117,8 +115,6 @@ void sgpio_configure(
// Disable all counters during configuration
SGPIO_CTRL_ENABLE = 0;
sgpio_configure_pin_functions();
// Set SGPIO output values.
const uint_fast8_t cpld_direction =
(direction == SGPIO_DIRECTION_TX) ? 1 : 0;