added two clocks while ENX high to get RFFC5071 serial reads to work (thanks, Jared!)
This commit is contained in:
@ -144,11 +144,21 @@ 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_SCLK | PIN_MIXER_SDATA));
|
||||
|
||||
serial_delay();
|
||||
gpio_set(PORT_MIXER, PIN_MIXER_SCLK);
|
||||
|
||||
serial_delay();
|
||||
gpio_clear(PORT_MIXER, PIN_MIXER_SCLK);
|
||||
|
||||
serial_delay();
|
||||
gpio_set(PORT_MIXER, PIN_MIXER_SCLK);
|
||||
|
||||
serial_delay();
|
||||
gpio_clear(PORT_MIXER, PIN_MIXER_SCLK);
|
||||
|
||||
/* start transaction by bringing ENX low */
|
||||
gpio_clear(PORT_MIXER, PIN_MIXER_ENX);
|
||||
serial_delay();
|
||||
|
||||
while (bits--) {
|
||||
if (data & msb)
|
||||
|
@ -72,7 +72,7 @@ int main(void)
|
||||
while (1) {
|
||||
//rffc5071_init();
|
||||
//rffc5071_reg_write(0x7a, 0xf0ca);
|
||||
if (rffc5071_reg_read(0x00) == 0xbefb)
|
||||
if (rffc5071_reg_read(0x00) == 0xbefa)
|
||||
gpio_set(PORT_LED1_3, (PIN_LED3)); /* LED3 on */
|
||||
else
|
||||
gpio_clear(PORT_LED1_3, (PIN_LED3)); /* LED3 off */
|
||||
|
Reference in New Issue
Block a user