Esempio n. 1
0
byte readLockBits()
{
	SendSPI(0x24);
	SendSPI(COMMAND_END);
	SendSPI(COMMAND_END);
	return SendSPI(COMMAND_END);
}
Esempio n. 2
0
byte readSign(byte AH, byte AL)
{
	SendSPI(0x28);
	SendSPI(AH);
	SendSPI(AL);
	return SendSPI(COMMAND_END);
}
Esempio n. 3
0
void writeLockBits(byte lockByte)
{
	SendSPI(0xAC);
	SendSPI(lockByte);
	SendSPI(COMMAND_END);
	SendSPI(COMMAND_END);
}
Esempio n. 4
0
void writeProgmem(byte AH, byte AL, byte data)
{
	SendSPI(0x40);
	SendSPI(AH);
	SendSPI(AL);
	SendSPI(data);
}
Esempio n. 5
0
byte progEnable()
{
	SendSPI(0xAC);
	SendSPI(0x53);
	SendSPI(COMMAND_END);
	return SendSPI(COMMAND_END);
}
Esempio n. 6
0
byte readProgmem(byte AH, byte AL)
{

	SendSPI(0x20);
	SendSPI(AH);
	SendSPI(AL);
	return SendSPI(COMMAND_END);
}
Esempio n. 7
0
void eraseChip()
{
	SendSPI(0xAC);
	SendSPI(0x9F);
	SendSPI(COMMAND_END);
	SendSPI(COMMAND_END);

	Sleep(520);
}
void checkKeys()
{

   //      Tasten
   if(input(Minus_p)==0)
      SendSPI(0x0004);
   
   if(input(Plus_p)==0)
      SendSPI(0x0002);

   if(input(Up_p)==0) 
      SendSPI(0x0008);
      
   if(input(Down_p)==0)
      SendSPI(0x0010);
      
   SendSPI(0x0000); 

}
inline void SSD1283A_wr_cmd(uint8_t cmd)
{
	SSD1283A_DC_CLR();							/* DC=L		     */
	DISPLAY_ASSART_CS();						/* CS=L		     */
	
	SendSPI(cmd);

	DISPLAY_NEGATE_CS();						/* CS=H		     */
	SSD1283A_DC_SET();							/* DC=H		     */
}
Esempio n. 10
0
void main () 
{
   int R_B,L_B,inputOn;
   
   coldstart();                        // Grundinitialisierung
      enable_interrupts(GLOBAL);

   while (TRUE)                         // Beginn Hauptprogramm
   {
      /*
      inputOn = 0;

      set_adc_channel(2);
      delay_ms (1);
      inputOn += read_adc();
      
      set_adc_channel(3);
      delay_ms (1);
      inputOn += read_adc();
      
      set_adc_channel(4);
      delay_ms (1);
      inputOn += read_adc();
      */
        //      VU-Meter
      set_adc_channel(0);
      delay_ms (1);
      L_B = Makevu (read_adc());
      set_adc_channel(1);
      delay_ms (1);
      R_B = Makevu (read_adc());
      
      if((R_B+L_B) > 1){
 
         //      VU-Meter - Portout
         Portout (L_B,R_B);
         
         //      Bass, mid, treble
           
      
         set_adc_channel(2);
         delay_ms (1);
         if (read_adc() > 560) output_low (Ledb_p);
         else output_high (Ledb_p);
         
         set_adc_channel(3);
         delay_ms (1);
         if (read_adc() > 570) output_low (Ledm_p);
         else output_high (Ledm_p);
         
         set_adc_channel(4);
         delay_ms (1);
         if (read_adc() > 550) output_low (Ledt_p);
         else output_high (Ledt_p);
      }
      else {
         LEDTest();
      }
//      Tasten
      if(input(Minus_p)==0)
         SendSPI(0x0004);
   
      if(input(Plus_p)==0)
         SendSPI(0x0002);

      if(input(Up_p)==0) 
         SendSPI(0x0008);
      
      if(input(Down_p)==0) 
         SendSPI(0x0010);
      
      SendSPI(0x0000);      
   } 
}
void checkKeys()
{
   //      Tasten
   SPIActive = 1;
   if((input(Minus_p) == 0) && (input(Plus_p) == 0)){
     //Mute
      SendSPI(0x0001);
      SendSPI(0x0000);
   } else { 
      if(input(Minus_p)==0){
       //Leiser
         SendSPI(0x0004);
         SendSPI(0x0000);
      }
      if(input(Plus_p)==0){
       //Lauter
         SendSPI(0x0002);
         SendSPI(0x0000);
      }
   }
   if((input(Up_p) == 0) && (input(Down_p) == 0)){
     //Mute
      SendSPI(0x0040);
      SendSPI(0x0000);
   } else {  
      if(input(Up_p)==0){
        //Weiter
         SendSPI(0x0008);
         SendSPI(0x0000);
      }
      if(input(Down_p)==0){
        //Zurück
         SendSPI(0x0010);
         SendSPI(0x0000);
      }
   }   
   
   SPIActive= 0;

}