diff options
Diffstat (limited to 'include/app.h')
-rw-r--r-- | include/app.h | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/include/app.h b/include/app.h index ed946d5..c26c131 100644 --- a/include/app.h +++ b/include/app.h | |||
@@ -43,7 +43,7 @@ | |||
43 | 43 | ||
44 | /****************************************************************************** | 44 | /****************************************************************************** |
45 | Button indexing is as follows - numbers in brackets do not correspond to real | 45 | Button indexing is as follows - numbers in brackets do not correspond to real |
46 | buttons, but can be harmessly sent in hal_set_led. | 46 | buttons, but can be harmessly sent in hal_set_led. |
47 | 47 | ||
48 | (90)91 92 93 94 95 96 97 98 (99) | 48 | (90)91 92 93 94 95 96 97 98 (99) |
49 | ....... | 49 | ....... |
@@ -92,6 +92,40 @@ void hal_send_midi(u8 port, u8 status, u8 data1, u8 data2); | |||
92 | */ | 92 | */ |
93 | void hal_send_sysex(u8 port, const u8* data, u16 length); | 93 | void hal_send_sysex(u8 port, const u8* data, u16 length); |
94 | 94 | ||
95 | /** | ||
96 | * Read some data from flash. | ||
97 | * | ||
98 | * Flash storage is in a single block, currently corresponding to one page. | ||
99 | * The block is always USER_AREA_SIZE bytes long. You can read/write any bytes | ||
100 | * within it - you do not need to worry about paging, that's handled by the HAL. | ||
101 | * | ||
102 | * The block size may increase to span multiple pages in future :) | ||
103 | * | ||
104 | * @param offset - how far into the USER_AREA_SIZE byte block to start reading | ||
105 | * @param data - buffer to receive data (must be at least length bytes long) | ||
106 | * @param length - bytes to read | ||
107 | * | ||
108 | * Attempts to read beyond the end of the block will fail silently. | ||
109 | * | ||
110 | * Note that your first ever read from a new device will contain 0xFF's until | ||
111 | * you overwrite them. | ||
112 | */ | ||
113 | void hal_read_flash(u32 offset, u8 *data, u32 length); | ||
114 | |||
115 | /** | ||
116 | * Write data to flash | ||
117 | * | ||
118 | * Do take care to avoid thrashing it, as you can wear it out with excessive | ||
119 | * writes. The HAL does not currently do anything clever to mitigate this. | ||
120 | * | ||
121 | * @param offset - how far into the USER_AREA_SIZE byte block to start writing | ||
122 | * @param data - buffer to write (must be at least length bytes long) | ||
123 | * @param length - bytes to write | ||
124 | * | ||
125 | * Attempts to write beyond the end of the block will fail silently | ||
126 | */ | ||
127 | void hal_write_flash(u32 offset,const u8 *data, u32 length); | ||
128 | |||
95 | // ____________________________________________________________________________ | 129 | // ____________________________________________________________________________ |
96 | // | 130 | // |
97 | // Callbacks from the hardware (implemented in your app.c) | 131 | // Callbacks from the hardware (implemented in your app.c) |