It was the Bitcointalk forum that inspired us to create Bitcointalksearch.org - Bitcointalk is an excellent site that should be the default page for anybody dealing in cryptocurrency, since it is a virtual gold-mine of data. However, our experience and user feedback led us create our site; Bitcointalk's search is slow, and difficult to get the results you need, because you need to log in first to find anything useful - furthermore, there are rate limiters for their search functionality.
The aim of our project is to create a faster website that yields more results and faster without having to create an account and eliminate the need to log in - your personal data, therefore, will never be in jeopardy since we are not asking for any of your data and you don't need to provide them to use our site with all of its capabilities.
We created this website with the sole purpose of users being able to search quickly and efficiently in the field of cryptocurrency so they will have access to the latest and most accurate information and thereby assisting the crypto-community at large.
#include
#include "stm8s.h"
void Delay (uint32_t nCount);
void spi_reset(void)
{
uint8_t i;
SPI_Cmd(DISABLE);
GPIO_WriteHigh(GPIOC,GPIO_PIN_5);
for (i = 0; i < 8; i++) {
GPIO_WriteReverse(GPIOC,GPIO_PIN_6);
}
SPI_Cmd(ENABLE);
}
#define SPIMAXSZ 450
static uint8_t spibuf[SPIMAXSZ], spibuf_rx[SPIMAXSZ];
static uint16_t spibufsz;
void spi_clear_buf(void) { spibufsz = 0; }
uint8_t *spi_getrxbuf(void) { return spibuf_rx; }
uint8_t *spi_gettxbuf(void) { return spibuf; }
uint16_t spi_getbufsz(void) { return spibufsz; }
int spi_txrx(const uint8_t *wrbuf, uint8_t *rdbuf, uint16_t bufsz)
{
uint16_t i;
for (i = 0; i < bufsz; i++) {
SPI_SendData(wrbuf[i]);
while (SPI_GetFlagStatus(SPI_FLAG_TXE)== RESET);
while (SPI_GetFlagStatus(SPI_FLAG_RXNE) == RESET);
rdbuf[i] = SPI_ReceiveData();
}
return 0;
}
int uart_tx(const uint8_t *rxbuf, uint16_t bufsz)
{
unsigned i;
for (i = 0; i < bufsz; i++) {
UART1_SendData8(rxbuf[i]);
while (UART1_GetFlagStatus(UART1_FLAG_TXE) == RESET);
}
return 0;
}
int uart_rx(uint8_t *rxbuf, uint16_t bufsz)
{
unsigned i;
uint16_t t=0;
spibufsz = SPIMAXSZ;
for (i = 0; i < spibufsz; i++) {
while (UART1_GetFlagStatus(UART1_FLAG_RXNE) == RESET)
{
if (t<5) t++;
else {
if (i!=0) spibufsz=i;else spibufsz=0;
return 0;
}
}
t=0;
rxbuf[i] = UART1_ReceiveData8();
}
spibufsz = i;
return 0;
}
void main(void)
{
CLK_DeInit();
/* Configure the Fcpu to DIV1*/
CLK_SYSCLKConfig(CLK_PRESCALER_CPUDIV1);
/* Configure the HSI prescaler to the optimal value */
CLK_SYSCLKConfig(CLK_PRESCALER_HSIDIV1);
CLK_PeripheralClockConfig(CLK_PERIPHERAL_SPI, ENABLE);
CLK_PeripheralClockConfig(CLK_PERIPHERAL_UART1, ENABLE);
GPIO_DeInit(GPIOC);
GPIO_Init(GPIOC,GPIO_PIN_7,GPIO_MODE_IN_FL_NO_IT);
GPIO_Init(GPIOC,GPIO_PIN_6,GPIO_MODE_OUT_PP_LOW_FAST);
GPIO_Init(GPIOC,GPIO_PIN_5,GPIO_MODE_OUT_PP_LOW_FAST);
UART1_DeInit();
UART1_Init((uint32_t)576000, UART1_WORDLENGTH_8D, UART1_STOPBITS_1, UART1_PARITY_NO,
UART1_SYNCMODE_CLOCK_DISABLE, UART1_MODE_TXRX_ENABLE);
UART1_Cmd(ENABLE);
SPI_DeInit();
SPI_Init(SPI_FIRSTBIT_MSB, SPI_BAUDRATEPRESCALER_8, SPI_MODE_MASTER, SPI_CLOCKPOLARITY_LOW,
SPI_CLOCKPHASE_1EDGE, SPI_DATADIRECTION_2LINES_FULLDUPLEX, SPI_NSS_SOFT,(uint8_t)0x07);
SPI_Cmd(DISABLE);
uart_tx("\x88",1);
uint32_t t;
BitStatus pin;
while (1)
{
uart_rx(spi_gettxbuf(),spi_getbufsz());
if(spibufsz>0) {
for(t=0;t<1000;t++) {
pin = GPIO_ReadInputPin(GPIOC, GPIO_PIN_7);
if (pin==0) {break;}
}
spi_reset();
spi_txrx(spi_gettxbuf(), spi_getrxbuf(), spi_getbufsz());
uart_tx("\x88",1);
uart_tx(spi_getrxbuf(),spi_getbufsz());
}
}
}
void Delay(uint32_t nCount)
{
while (nCount != 0)
{
nCount--;
}
}
#ifdef USE_FULL_ASSERT
void assert_failed(uint8_t* file, uint32_t line)
{
while (1)
{
}
}
#endif