Commits

Dennis Muhlestein  committed 9354b71

gpif single write function.

  • Participants
  • Parent commits 92b0260

Comments (0)

Files changed (2)

File include/gpif.h

  * Should be multiple of 2.  Should this function
  * be coded to be smart enough for 8 bit bus and 16 both
  * or should there be a different function?
+ *
+ * At least one EPxFIFOCFG has to have wordwide=1 or these
+ * functions won't transfer both bytes right
  **/
-void gpif_single_read( BYTE* res , WORD len) ;
+void gpif_single_read( BYTE* res , WORD len);
+void gpif_single_write( BYTE* data, WORD len);
 
 void gpif_fifo_read ( GPIF_EP_NUM ep_num );
 
     }
 }
 
+void gpif_single_write( BYTE* dat, WORD len) {
+   BYTE c;
+   for (c=0;c<len;c+=2) {
+    while (!(GPIFTRIG & 0x80) );
+    XGPIFSGLDATH = dat[c];
+    XGPIFSGLDATLX = dat[c+1];
+   }
+}
+
 void gpif_fifo_read ( GPIF_EP_NUM ep_num ) {
     while ( !(GPIFTRIG & 0x80 ) ); // wait until things are finished
     GPIFTRIG = GPIFTRGRD | ep_num;