Board bringup: talk to the chip and read IDs.
- atusd/ERRATA: mention that the reset circuit can go, as expected
- atusd/tools/Makefile: add include path to at86rf230.h
- atusd/tools/lib/atusd.c: include atusd.h, for consistency checking
- atusd/tools/lib/atusd.c (spi_begin, spi_end, spi_data_in, spi_data_out,
spi_send_partial, spi_recv, spi_finish, spi_send): low-level functions
to access our modified SPI
- atusd/tools/lib/atusd.h, atusd/tools/lib/atusd.c (atusd_reg_write,
atusd_reg_read): register read and write access
- atusd/tools/try.c: read and print chip IDs
2010-09-05 22:59:59 +03:00
|
|
|
#include <stdint.h>
|
2010-09-05 20:07:01 +03:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
|
Board bringup: talk to the chip and read IDs.
- atusd/ERRATA: mention that the reset circuit can go, as expected
- atusd/tools/Makefile: add include path to at86rf230.h
- atusd/tools/lib/atusd.c: include atusd.h, for consistency checking
- atusd/tools/lib/atusd.c (spi_begin, spi_end, spi_data_in, spi_data_out,
spi_send_partial, spi_recv, spi_finish, spi_send): low-level functions
to access our modified SPI
- atusd/tools/lib/atusd.h, atusd/tools/lib/atusd.c (atusd_reg_write,
atusd_reg_read): register read and write access
- atusd/tools/try.c: read and print chip IDs
2010-09-05 22:59:59 +03:00
|
|
|
#include "at86rf230.h"
|
2010-09-05 20:07:01 +03:00
|
|
|
#include "lib/atusd.h"
|
2010-09-05 05:14:57 +03:00
|
|
|
|
|
|
|
|
|
|
|
int main(void)
|
|
|
|
{
|
|
|
|
struct atusd_dsc *dsc;
|
Board bringup: talk to the chip and read IDs.
- atusd/ERRATA: mention that the reset circuit can go, as expected
- atusd/tools/Makefile: add include path to at86rf230.h
- atusd/tools/lib/atusd.c: include atusd.h, for consistency checking
- atusd/tools/lib/atusd.c (spi_begin, spi_end, spi_data_in, spi_data_out,
spi_send_partial, spi_recv, spi_finish, spi_send): low-level functions
to access our modified SPI
- atusd/tools/lib/atusd.h, atusd/tools/lib/atusd.c (atusd_reg_write,
atusd_reg_read): register read and write access
- atusd/tools/try.c: read and print chip IDs
2010-09-05 22:59:59 +03:00
|
|
|
uint8_t part, version, man_id_0, man_id_1;
|
2010-09-05 05:14:57 +03:00
|
|
|
|
|
|
|
dsc = atusd_open();
|
Board bringup: talk to the chip and read IDs.
- atusd/ERRATA: mention that the reset circuit can go, as expected
- atusd/tools/Makefile: add include path to at86rf230.h
- atusd/tools/lib/atusd.c: include atusd.h, for consistency checking
- atusd/tools/lib/atusd.c (spi_begin, spi_end, spi_data_in, spi_data_out,
spi_send_partial, spi_recv, spi_finish, spi_send): low-level functions
to access our modified SPI
- atusd/tools/lib/atusd.h, atusd/tools/lib/atusd.c (atusd_reg_write,
atusd_reg_read): register read and write access
- atusd/tools/try.c: read and print chip IDs
2010-09-05 22:59:59 +03:00
|
|
|
|
2010-09-05 20:07:01 +03:00
|
|
|
atusd_cycle(dsc);
|
Board bringup: talk to the chip and read IDs.
- atusd/ERRATA: mention that the reset circuit can go, as expected
- atusd/tools/Makefile: add include path to at86rf230.h
- atusd/tools/lib/atusd.c: include atusd.h, for consistency checking
- atusd/tools/lib/atusd.c (spi_begin, spi_end, spi_data_in, spi_data_out,
spi_send_partial, spi_recv, spi_finish, spi_send): low-level functions
to access our modified SPI
- atusd/tools/lib/atusd.h, atusd/tools/lib/atusd.c (atusd_reg_write,
atusd_reg_read): register read and write access
- atusd/tools/try.c: read and print chip IDs
2010-09-05 22:59:59 +03:00
|
|
|
// atusd_reset(dsc);
|
|
|
|
|
|
|
|
part = atusd_reg_read(dsc, REG_PART_NUM);
|
|
|
|
version = atusd_reg_read(dsc, REG_VERSION_NUM);
|
|
|
|
man_id_0 = atusd_reg_read(dsc, REG_MAN_ID_0);
|
|
|
|
man_id_1 = atusd_reg_read(dsc, REG_MAN_ID_1);
|
|
|
|
printf("part 0x%02x version %u manufacturer xxxx%02x%02x\n",
|
|
|
|
part, version, man_id_1, man_id_0);
|
|
|
|
|
2010-09-05 05:14:57 +03:00
|
|
|
atusd_close(dsc);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|