Example #1
0
void BETABRITE::WriteStringFile ( const char Name, const char *Contents )
{
	BeginCommand ( );
	BeginNestedCommand ( );
	WriteStringFileNested ( Name, Contents );
	EndCommand ( );
}
Example #2
0
void BETABRITE::WriteTextFile ( const char Name, const char *Contents, const char initColor, const char Position, const char Mode, const char Special )
{
	BeginCommand ( );
	BeginNestedCommand ( );
	WriteTextFileNested ( Name, Contents, initColor, Position, Mode, Special );
	EndCommand ( );
}
Example #3
0
void BETABRITE::CancelPriorityTextFile ( void )
{
	BeginCommand ( );
	BeginNestedCommand ( );
	print ( BB_CC_WTEXT );
	print ( BB_PRIORITY_FILE_LABEL );
	EndCommand ( );
}
Example #4
0
static void WriteCommand(uint8_t cmd, unsigned argc, ...) {
  va_list args;
  va_start(args, argc);

  BeginCommand(cmd);
  ExpectReceive(argc);
  while (argc--) {
    SpiWriteByteAsync(va_arg(args, uint8_t));
  }
  SpinTransferComplete();
  EndCommand(cmd);

  va_end(args);
}
Example #5
0
void BeginWriteWindow(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1) {
  WriteCommand(ST7735_CASET, 4,  // column addr set
               0x00,
               x0+0,   // XSTART
               0x00,
               x1+0);   // XEND

  WriteCommand(ST7735_RASET, 4,  // row addr set
               0x00,
               y0+0,    // YSTART
               0x00,
               y1+0);    // YEND

  BeginCommand(ST7735_RAMWR);  // write to RAM
}
Example #6
0
void BETABRITE::SetMemoryConfiguration ( const char startingFile, unsigned int numFiles, unsigned int size )
{
  BeginCommand ( );  
  BeginNestedCommand ( );
  print ( BB_CC_WSPFUNC );
  print ( BB_SFL_CLEARMEM );

  char sizeBuf[5] = "0100";
  if (size <= 0xffff)
  {
    sprintf(sizeBuf, "%04x", size);
  }

  for (char c = startingFile; c <  startingFile + numFiles; c++)
  {
    print ( c );
    print ( BB_SFFT_TEXT );
    print ( BB_SFKPS_LOCKED );
    print ( sizeBuf );
    print ( "FF00" );    // AlwaysOn for text file
  }
  
  EndCommand ( );
}
Example #7
0
void BETABRITE::SetDateTime ( DateTime now, bool UseMilitaryTime )
{
	char		dow, strbuff[3];
	uint8_t		hour, minute, month, day;
	uint16_t	year;

	dow = now.dayOfWeek ( );
	dow += '1';
	hour = now.hour ( );
	minute = now.minute ( );
	month = now.month ( );
	day = now.day ( );
	year = now.year ( );

	BeginCommand ( );
	BeginNestedCommand ( );
	DelayBetweenCommands ( );
	print ( BB_CC_WSPFUNC );
	print ( ' ' );
	if ( hour <= 9 )
	{
		print ( '0' );
	}
	itoa ( hour, strbuff, 10 );
	print ( strbuff );
	if ( minute <= 9 )
	{
		print ( '0' );
	}
	itoa ( minute, strbuff, 10 );
	print ( strbuff );
	EndNestedCommand ( );
	BeginNestedCommand ( );
	DelayBetweenCommands ( );
	print ( BB_CC_WSPFUNC );
	print ( '\047' );
	print ( UseMilitaryTime ? 'M' : 'S' );
	EndNestedCommand ( );
	BeginNestedCommand ( );
	DelayBetweenCommands ( );
	print ( BB_CC_WSPFUNC );
	print ( '&' );
	print ( dow );
	EndNestedCommand ( );
	BeginNestedCommand ( );
	DelayBetweenCommands ( );
	print ( BB_CC_WSPFUNC );
	print ( ';' );
	if ( month <= 9 )
	{
		print ( '0' );
	}
	itoa ( month, strbuff, 10 );
	print ( strbuff );
	if ( day <= 9 )
	{
		print ( '0' );
	}
	itoa ( day, strbuff, 10 );
	print ( strbuff );
	if ( year < 2000 ) print ( "00" );
	else
	{
		year -= 2000;
		if ( year <= 9 )
		{
			print ( '0' );
		}
		itoa ( year, strbuff, 10 ); // 2 digits for the foreseeable future, and positive
		print ( strbuff );
	}
	EndNestedCommand ( );
	EndCommand ( );
}