fixed inconsistent naming of mixer pins
This commit is contained in:
@ -94,8 +94,8 @@ extern "C"
|
||||
|
||||
/* RFFC5071 GPIO serial interface PinMux */
|
||||
#define SCU_MIXER_ENX (P7_0) /* GPIO3[8] on P7_0 */
|
||||
#define SCU_MIXER_CLK (P7_1) /* GPIO3[9] on P7_1 */
|
||||
#define SCU_MIXER_DATA (P7_2) /* GPIO3[10] on P7_2 */
|
||||
#define SCU_MIXER_SCLK (P7_1) /* GPIO3[9] on P7_1 */
|
||||
#define SCU_MIXER_SDATA (P7_2) /* GPIO3[10] on P7_2 */
|
||||
|
||||
/* TODO add other Pins */
|
||||
|
||||
@ -121,8 +121,8 @@ extern "C"
|
||||
#define PORT_CS_AD (GPIO2) /* PORT for CS_AD */
|
||||
|
||||
#define PIN_MIXER_ENX (BIT8) /* GPIO3[8] on P7_0 */
|
||||
#define PIN_MIXER_CLK (BIT9) /* GPIO3[9] on P7_1 */
|
||||
#define PIN_MIXER_DATA (BIT10) /* GPIO3[10] on P7_2 */
|
||||
#define PIN_MIXER_SCLK (BIT9) /* GPIO3[9] on P7_1 */
|
||||
#define PIN_MIXER_SDATA (BIT10) /* GPIO3[10] on P7_2 */
|
||||
#define PORT_MIXER (GPIO3) /* PORT for mixer serial interface */
|
||||
|
||||
/* GPIO Input */
|
||||
@ -146,7 +146,7 @@ extern "C"
|
||||
#define BOOT1_STATE ((GPIO0_PIN & PIN_BOOT1)==PIN_BOOT1)
|
||||
#define BOOT2_STATE ((GPIO5_PIN & PIN_BOOT2)==PIN_BOOT2)
|
||||
#define BOOT3_STATE ((GPIO1_PIN & PIN_BOOT3)==PIN_BOOT3)
|
||||
#define MIXER_DATA_STATE ((GPIO3_PIN & PIN_MIXER_DATA)==PIN_MIXER_DATA)
|
||||
#define MIXER_SDATA_STATE ((GPIO3_PIN & PIN_MIXER_SDATA)==PIN_MIXER_SDATA)
|
||||
|
||||
/* TODO add other Pins */
|
||||
#endif
|
||||
|
@ -31,15 +31,15 @@ void rffc5071_init(void)
|
||||
{
|
||||
/* Configure GPIO pins. */
|
||||
scu_pinmux(SCU_MIXER_ENX, SCU_GPIO_FAST);
|
||||
scu_pinmux(SCU_MIXER_CLK, SCU_GPIO_FAST);
|
||||
scu_pinmux(SCU_MIXER_DATA, SCU_GPIO_FAST);
|
||||
scu_pinmux(SCU_MIXER_SCLK, SCU_GPIO_FAST);
|
||||
scu_pinmux(SCU_MIXER_SDATA, SCU_GPIO_FAST);
|
||||
|
||||
/* Set GPIO pins as outputs. */
|
||||
GPIO3_DIR |= (PIN_MIXER_ENX | PIN_MIXER_CLK | PIN_MIXER_DATA);
|
||||
GPIO3_DIR |= (PIN_MIXER_ENX | PIN_MIXER_SCLK | PIN_MIXER_SDATA);
|
||||
|
||||
/* set to known state */
|
||||
gpio_set(PORT_MIXER, PIN_MIXER_ENX); /* active low */
|
||||
gpio_clear(PORT_MIXER, (PIN_MIXER_CLK | PIN_MIXER_DATA));
|
||||
gpio_clear(PORT_MIXER, (PIN_MIXER_SCLK | PIN_MIXER_SDATA));
|
||||
|
||||
//FIXME no writes until we get reads sorted:
|
||||
return;
|
||||
@ -103,7 +103,7 @@ void rffc5071_reg_write(uint8_t reg, uint16_t val)
|
||||
|
||||
/* make sure everything is starting in the correct state */
|
||||
gpio_set(PORT_MIXER, PIN_MIXER_ENX);
|
||||
gpio_clear(PORT_MIXER, (PIN_MIXER_CLK | PIN_MIXER_DATA));
|
||||
gpio_clear(PORT_MIXER, (PIN_MIXER_SCLK | PIN_MIXER_SDATA));
|
||||
serial_delay();
|
||||
|
||||
/* start transaction by bringing ENX low */
|
||||
@ -112,16 +112,16 @@ void rffc5071_reg_write(uint8_t reg, uint16_t val)
|
||||
|
||||
while (bits--) {
|
||||
if (data & msb)
|
||||
gpio_set(PORT_MIXER, PIN_MIXER_DATA);
|
||||
gpio_set(PORT_MIXER, PIN_MIXER_SDATA);
|
||||
else
|
||||
gpio_clear(PORT_MIXER, PIN_MIXER_DATA);
|
||||
gpio_clear(PORT_MIXER, PIN_MIXER_SDATA);
|
||||
data <<= 1;
|
||||
|
||||
serial_delay();
|
||||
gpio_set(PORT_MIXER, PIN_MIXER_CLK);
|
||||
gpio_set(PORT_MIXER, PIN_MIXER_SCLK);
|
||||
|
||||
serial_delay();
|
||||
gpio_clear(PORT_MIXER, PIN_MIXER_CLK);
|
||||
gpio_clear(PORT_MIXER, PIN_MIXER_SCLK);
|
||||
}
|
||||
|
||||
serial_delay();
|
||||
@ -143,7 +143,7 @@ uint16_t rffc5071_reg_read(uint8_t reg)
|
||||
|
||||
/* make sure everything is starting in the correct state */
|
||||
gpio_set(PORT_MIXER, PIN_MIXER_ENX);
|
||||
gpio_clear(PORT_MIXER, (PIN_MIXER_CLK | PIN_MIXER_DATA));
|
||||
gpio_clear(PORT_MIXER, (PIN_MIXER_SCLK | PIN_MIXER_SDATA));
|
||||
serial_delay();
|
||||
|
||||
/* start transaction by bringing ENX low */
|
||||
@ -152,42 +152,42 @@ uint16_t rffc5071_reg_read(uint8_t reg)
|
||||
|
||||
while (bits--) {
|
||||
if (data & msb)
|
||||
gpio_set(PORT_MIXER, PIN_MIXER_DATA);
|
||||
gpio_set(PORT_MIXER, PIN_MIXER_SDATA);
|
||||
else
|
||||
gpio_clear(PORT_MIXER, PIN_MIXER_DATA);
|
||||
gpio_clear(PORT_MIXER, PIN_MIXER_SDATA);
|
||||
data <<= 1;
|
||||
|
||||
serial_delay();
|
||||
gpio_set(PORT_MIXER, PIN_MIXER_CLK);
|
||||
gpio_set(PORT_MIXER, PIN_MIXER_SCLK);
|
||||
|
||||
serial_delay();
|
||||
gpio_clear(PORT_MIXER, PIN_MIXER_CLK);
|
||||
gpio_clear(PORT_MIXER, PIN_MIXER_SCLK);
|
||||
}
|
||||
|
||||
serial_delay();
|
||||
gpio_set(PORT_MIXER, PIN_MIXER_CLK);
|
||||
gpio_set(PORT_MIXER, PIN_MIXER_SCLK);
|
||||
|
||||
serial_delay();
|
||||
gpio_clear(PORT_MIXER, PIN_MIXER_CLK);
|
||||
gpio_clear(PORT_MIXER, PIN_MIXER_SCLK);
|
||||
|
||||
bits = 16;
|
||||
data = 0;
|
||||
/* set DATA line as input */
|
||||
GPIO3_DIR &= ~PIN_MIXER_DATA;
|
||||
/* set SDATA line as input */
|
||||
GPIO3_DIR &= ~PIN_MIXER_SDATA;
|
||||
|
||||
while (bits--) {
|
||||
data <<= 1;
|
||||
|
||||
serial_delay();
|
||||
gpio_set(PORT_MIXER, PIN_MIXER_CLK);
|
||||
gpio_set(PORT_MIXER, PIN_MIXER_SCLK);
|
||||
|
||||
serial_delay();
|
||||
gpio_clear(PORT_MIXER, PIN_MIXER_CLK);
|
||||
if (MIXER_DATA_STATE)
|
||||
gpio_clear(PORT_MIXER, PIN_MIXER_SCLK);
|
||||
if (MIXER_SDATA_STATE)
|
||||
data |= 1;
|
||||
}
|
||||
/* set DATA line as output */
|
||||
GPIO3_DIR |= PIN_MIXER_DATA;
|
||||
/* set SDATA line as output */
|
||||
GPIO3_DIR |= PIN_MIXER_SDATA;
|
||||
|
||||
serial_delay();
|
||||
gpio_set(PORT_MIXER, PIN_MIXER_ENX);
|
||||
|
@ -20,7 +20,7 @@ GND: Lollipop P8 pin 1, 3, or 5 -> Jellybean P17 pin 1, 3, or 5
|
||||
VCC: Lollipop P8 pin 2, 4, or 6 -> Jellybean P17 pin 2, 4, or 6
|
||||
ENX: Lollipop P4 pin 5 -> Jellybean P5 pin 1
|
||||
SCLK: Lollipop P4 pin 3 -> Jellybean P5 pin 3
|
||||
DATA: Lollipop P4 pin 1 -> Jellybean P5 pin 5
|
||||
SDATA: Lollipop P4 pin 1 -> Jellybean P5 pin 5
|
||||
|
||||
Also RF connectors, and you're on your own to get the RF switches configured
|
||||
properly.
|
||||
|
Reference in New Issue
Block a user