Changeset - 4e72955028d8
[Not reviewed]
default
0 2 0
Ethan Zonca - 10 years ago 2014-07-10 19:47:46
ez@ethanzonca.com
Added LED defs
2 files changed with 11 insertions and 16 deletions:
0 comments (0 inline, 0 general)
libraries/oleddrv/bsp.h
Show inline comments
 
@@ -44,10 +44,7 @@ D1/Data 3  4  D0/Clk
 
 
// Use stdperiph
 
#define   SPI_SendByte(data)  SPI_I2S_SendData(SPI1, data);  //SPI1->DR = (data)
 
#define   SPI_Wait()           while(!(SPI1->SR&SPI_I2S_FLAG_TXE));while(SPI1->SR&SPI_I2S_FLAG_BSY);
 
 
#define   SSD1303_FPS                   50
 
 
#define   SPI_Wait()           while(!(SPI1->SR&SPI_I2S_FLAG_TXE));while(SPI1->SR&SPI_I2S_FLAG_BSY); #define   SSD1303_FPS                   50 
 
#define   IsLedOn()       (!(GPIOA->ODR & GPIO_Pin_8))
 
#define   LED_ON()        GPIOA->BRR = GPIO_Pin_8
 
#define   LED_OFF()       GPIOA->BSRR = GPIO_Pin_8
main.c
Show inline comments
 
@@ -2,6 +2,9 @@
 
#include "stm32l100c_discovery.h"
 
#include "ssd1306.h"
 
 
#define LED_POWER GPIOB,  GPIO_Pin_9
 
#define LED_STAT  GPIOA,  GPIO_Pin_15
 
 
static __IO uint32_t TimingDelay;
 
uint8_t BlinkSpeed = 0;
 
 
@@ -11,6 +14,8 @@ void init_spi();
 
/* Main */
 
int main(void)
 
{
 
 
   // Hopefully init clocks
 
   SystemInit();
 
   RCC_ClocksTypeDef RCC_Clocks;
 
  
 
@@ -18,11 +23,6 @@ int main(void)
 
  STM_EVAL_LEDInit(LED3);
 
  STM_EVAL_LEDInit(LED4);
 
  
 
 
//  RCC_Configuration();
 
  /* Initialize User_Button on STM32L100C-Discovery */
 
  //STM_EVAL_PBInit(BUTTON_USER, BUTTON_MODE_GPIO);
 
  
 
  /* SysTick end of count event each 1ms */
 
  RCC_GetClocksFreq(&RCC_Clocks);
 
  SysTick_Config(RCC_Clocks.HCLK_Frequency / 1000);
 
@@ -30,21 +30,19 @@ int main(void)
 
 /* Initiate Blink Speed variable */ 
 
  BlinkSpeed = 1;
 
 
//  while(1) {
 
//	  ITM_SendChar('!');
 
//  } 
 
 
 
  init_spi();
 
  //SPI_I2S_SendData(SPI1, 0x1); 
 
 /* Init lcd driver */
 
//  SSD1303_Init();
 
//  SSD1303_DrawPoint(3,3,1);
 
//  SSD1303_DrawPoint(5,5,0);
 
  
 
 
//testme
 
//  GPIO_SetBits(LED_PWR);
 
  STM_EVAL_LEDOn(LED4);
 
  Delay(1000);
 
  STM_EVAL_LEDOff(LED4);
 
// GPIO_ResetBits(LED_PWR);
 
STM_EVAL_LEDOff(LED4);
 
  Delay(1000);
 
 
  while(1)
0 comments (0 inline, 0 general)