Relocate SGPIO pin configuration -- it only needs to be done once.
This commit is contained in:
@ -25,6 +25,7 @@
|
|||||||
#include "si5351c.h"
|
#include "si5351c.h"
|
||||||
#include "max2837.h"
|
#include "max2837.h"
|
||||||
#include "rffc5071.h"
|
#include "rffc5071.h"
|
||||||
|
#include "sgpio.h"
|
||||||
#include <libopencm3/lpc43xx/i2c.h>
|
#include <libopencm3/lpc43xx/i2c.h>
|
||||||
#include <libopencm3/lpc43xx/cgu.h>
|
#include <libopencm3/lpc43xx/cgu.h>
|
||||||
#include <libopencm3/lpc43xx/gpio.h>
|
#include <libopencm3/lpc43xx/gpio.h>
|
||||||
@ -588,6 +589,8 @@ void pin_setup(void) {
|
|||||||
|
|
||||||
/* Configure external clock in */
|
/* Configure external clock in */
|
||||||
//scu_pinmux(P4_7, SCU_CLK_IN | SCU_CONF_FUNCTION1);
|
//scu_pinmux(P4_7, SCU_CLK_IN | SCU_CONF_FUNCTION1);
|
||||||
|
|
||||||
|
sgpio_configure_pin_functions();
|
||||||
}
|
}
|
||||||
|
|
||||||
void enable_1v8_power(void) {
|
void enable_1v8_power(void) {
|
||||||
|
@ -63,8 +63,6 @@ void sgpio_test_interface() {
|
|||||||
// Disable all counters during configuration
|
// Disable all counters during configuration
|
||||||
SGPIO_CTRL_ENABLE = 0;
|
SGPIO_CTRL_ENABLE = 0;
|
||||||
|
|
||||||
sgpio_configure_pin_functions();
|
|
||||||
|
|
||||||
// Make all SGPIO controlled by SGPIO's "GPIO" registers
|
// Make all SGPIO controlled by SGPIO's "GPIO" registers
|
||||||
for (uint_fast8_t i = 0; i < 16; i++) {
|
for (uint_fast8_t i = 0; i < 16; i++) {
|
||||||
SGPIO_OUT_MUX_CFG(i) =
|
SGPIO_OUT_MUX_CFG(i) =
|
||||||
@ -117,8 +115,6 @@ void sgpio_configure(
|
|||||||
// Disable all counters during configuration
|
// Disable all counters during configuration
|
||||||
SGPIO_CTRL_ENABLE = 0;
|
SGPIO_CTRL_ENABLE = 0;
|
||||||
|
|
||||||
sgpio_configure_pin_functions();
|
|
||||||
|
|
||||||
// Set SGPIO output values.
|
// Set SGPIO output values.
|
||||||
const uint_fast8_t cpld_direction =
|
const uint_fast8_t cpld_direction =
|
||||||
(direction == SGPIO_DIRECTION_TX) ? 1 : 0;
|
(direction == SGPIO_DIRECTION_TX) ? 1 : 0;
|
||||||
|
Reference in New Issue
Block a user