summaryrefslogtreecommitdiff
path: root/digital/avr/modules/isp/test
diff options
context:
space:
mode:
authorNicolas Schodet2009-04-25 13:24:58 +0200
committerNicolas Schodet2009-04-25 13:24:58 +0200
commita21c122435b22457399624a60dbca442d0c3588e (patch)
treed57d331e1c96a7df1a7daff9895d91eabe383af7 /digital/avr/modules/isp/test
parentacf742ef36a87703365a4662e71a898873f69dac (diff)
* digital/avr/modules/isp:
- added user callbacks. - removed incomplete watchdog support.
Diffstat (limited to 'digital/avr/modules/isp/test')
-rw-r--r--digital/avr/modules/isp/test/avrconfig.h23
-rw-r--r--digital/avr/modules/isp/test/test_isp.c26
2 files changed, 48 insertions, 1 deletions
diff --git a/digital/avr/modules/isp/test/avrconfig.h b/digital/avr/modules/isp/test/avrconfig.h
index daabef56..3ddf50fa 100644
--- a/digital/avr/modules/isp/test/avrconfig.h
+++ b/digital/avr/modules/isp/test/avrconfig.h
@@ -25,6 +25,11 @@
*
* }}} */
+/* utils */
+/** AVR Frequency : 1000000, 1843200, 2000000, 3686400, 4000000, 7372800,
+ * 8000000, 11059200, 14745600, 16000000, 18432000, 20000000. */
+#define AC_FREQ 8000000
+
/* isp - ISP module. */
/** Size of isp_frame buffer. */
#define AC_ISP_FRAME_BUFFER_SIZE 275
@@ -32,7 +37,7 @@
#define AC_ISP_FRAME_SEND_CHAR uart0_putc
/** Should be implemented by the user (isp_proto) to accept a frame. */
#define AC_ISP_FRAME_ACCEPT_FRAME isp_proto_accept
-/** Should be implemeted by the user to send a frame. */
+/** Should be implemented by the user to send a frame. */
#define AC_ISP_PROTO_SEND isp_frame_send_frame
/** Programmer signature. */
#define AC_ISP_PROTO_SIGNATURE "APBisp_2"
@@ -42,5 +47,21 @@
#define AC_ISP_PROTO_HW_VERSION 0x02
/** Programmer software version. */
#define AC_ISP_PROTO_SW_VERSION 0x0204
+/** Should be implemented by the user to enable SPI programming:
+ * - set RESET and SCK to low,
+ * - power on, or if not possible, do a positive RESET pulse,
+ * - enable SPI. */
+#define AC_ISP_SPI_ENABLE isp_spi_enable
+/** Should be implemented by the user to disable SPI programming:
+ * - disable SPI,
+ * - release RESET,
+ * - power off if desired. */
+#define AC_ISP_SPI_DISABLE isp_spi_disable
+/** Should be implemented by the user to do a pulse on SCK. This is used to
+ * try to resynchronise. */
+#define AC_ISP_SPI_SCK_PULSE isp_spi_sck_pulse
+/** Should be implemented by the user to send and receive a byte using the SPI
+ * bus. */
+#define AC_ISP_SPI_TX isp_spi_tx
#endif /* avrconfig_h */
diff --git a/digital/avr/modules/isp/test/test_isp.c b/digital/avr/modules/isp/test/test_isp.c
index ca0fd355..339019e7 100644
--- a/digital/avr/modules/isp/test/test_isp.c
+++ b/digital/avr/modules/isp/test/test_isp.c
@@ -33,3 +33,29 @@ main (void)
return 0;
}
+void
+AC_ISP_SPI_ENABLE (void)
+{
+}
+
+void
+AC_ISP_SPI_DISABLE (void)
+{
+}
+
+void
+AC_ISP_SPI_SCK_PULSE (void)
+{
+}
+
+uint8_t
+AC_ISP_SPI_TX (uint8_t data)
+{
+ return 0;
+}
+
+void
+AC_ISP_FRAME_SEND_CHAR (uint8_t data)
+{
+}
+