/*
==========================未经授权，转载需保留此信息============================
Function : 
Taobao website:http://zeyaotech.taobao.com/
Official website:http://www.ashining.com/
Written by:Lijian
TEL:028-64891123(Sales),028-64891129(Technology),e-mail: service@ashining.com
================================================================================
*/
#ifndef _BOARD_H_
#define _BOARD_H_

#include "STM8l10x_conf.h"
#include "mytypedef.h"

/*Exchange a byte via the SPI bus*/
INT8U SPI_ExchangeByte( INT8U input );

/*Initialize the SPI bus*/
void SPI_Initial( void );

/*Initialize the other GPIOs of the board*/
void GPIO_Initial( void );

void display_tx(void);
void display_rx(void);

/*turn on the LED*/
#define LED_On( )       GPIO_ResetBits( GPIOB, GPIO_Pin_0 )

/*turn off the LED*/
#define LED_Off( )      GPIO_SetBits( GPIOB, GPIO_Pin_0 )

/*toggle the LED*/
#define LED_Toggle( )   GPIO_ToggleBits( GPIOB, GPIO_Pin_0 )


//--------------operations for OLED module------------------------
#define OLED_CSN_H( )   GPIO_SetBits( GPIOB, GPIO_Pin_3)
#define OLED_CSN_L( )   GPIO_ResetBits( GPIOB, GPIO_Pin_3)

#define OLED_CMD_H( )   GPIO_SetBits( GPIOD, GPIO_Pin_0)
#define OLED_CMD_L( )   GPIO_ResetBits( GPIOD, GPIO_Pin_0)

#define OLED_RST_H( )   GPIO_SetBits( GPIOB, GPIO_Pin_2)
#define OLED_RST_L( )   GPIO_ResetBits( GPIOB, GPIO_Pin_2)




#endif //_BOARD_H_
/*
=================================================================================
------------------------------------End of FILE----------------------------------
=================================================================================
*/
