Class Module for EA DOGS102 Graphic LCD display SPI Interface

Dependents:   mDotEVBM2X MTDOT-EVB-LinkCheck-AL MTDOT-EVBDemo-DRH MTDOT_BOX_EVB_LCD_Helloworld ... more

Files at this revision

API Documentation at this revision

Comitter:
Leon Lindenfelser
Date:
Mon Oct 17 08:43:06 2016 -0500
Parent:
4:8797ad72a9a8
Commit message:
Remove disable and enable of irqs around SPI accesses. Mbed5 takes care of peripheral access protection.

Changed in this revision

DOGS102.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 8797ad72a9a8 -r e66152f036d9 DOGS102.cpp
--- a/DOGS102.cpp	Mon Dec 21 10:48:01 2015 -0600
+++ b/DOGS102.cpp	Mon Oct 17 08:43:06 2016 -0500
@@ -175,10 +175,8 @@
 {
     uint8_t result = 0;
     
-    __disable_irq();
     _spi->frequency(4000000);
     _spi->format(8,3);		// 8bit transfers, SPI mode 3
-    __enable_irq();
     _lcd_cs->write(1);		// initialize chip select pin
     _cmnd_data->write(1);	// initialize command/data pin
     _update_flag = 0;		// initialize update semaphore
@@ -284,10 +282,8 @@
 
     if (result == 0)
     {
-	__disable_irq();
         _spi->frequency(4000000);
         _spi->format(8,3);		// 8bit transfers, SPI mode 3
-	__enable_irq();
 
         _lcd_cs->write (0);			// enable LCD SPI interface
     	_cmnd_data->write(0);		// set to command mode
@@ -296,15 +292,11 @@
     	{
     	case SETELECVOL :
     	case SETAPROGCTRL :
-		__disable_irq();
         	_spi->write(reg);
-		__enable_irq();
         	break;
         }
 
-	__disable_irq();
     	_spi->write(buf);			// send command register
-	__enable_irq();
 
     	_cmnd_data->write(1);		// set back to data mode
     	_lcd_cs->write(1);			// disable LCD SPI Interface
@@ -324,19 +316,15 @@
     uint8_t result = 0;
     uint8_t i;
     
-    __disable_irq();
     _spi->frequency(4000000);
     _spi->format(8,3);		// 8bit transfers, SPI mode 3
-    __enable_irq();
 
     _lcd_cs->write(0);			// enable LCD SPI interface
 	i = 0;						// initialize transfer counter
 
     do
     {
-	__disable_irq();
         _spi->write(data[i]);
-	__enable_irq();
         i++;
     } while ((result == 0) && (i <= count)) ;