Skip to content

Instantly share code, notes, and snippets.

View ahmetserdar's full-sized avatar

ahmet serdar ahmetserdar

  • Gebze Technical University
  • Turkey
View GitHub Profile
@jkiv
jkiv / main.cpp
Created November 15, 2020 00:31
FTDI GPIO example
#include <iostream>
#include <iomanip>
#include <chrono> // for std::chrono::milliseconds
#include <thread> // for std::this_thread::sleep_for
#include "ftd2xx.h" // must be in project include path
/*** HELPER FUNCTION DECLARATIONS ***/
// Formats and writes FT_DEVICE_LIST_INFO_NODE structure to output

I believe the article was originally written by fede.tft.

It appears they have copied source code to github and updated it for C++11: https://github.com/fedetft/serial-port

Introduction

The serial port protocol is one of the most long lived protocols currently in use. According to wikipedia, it has been standadized in 1969. First, a note: here we're talking about the RS232 serial protocol. This note is necessary because there are many other serial protocols, like SPI, I2C, CAN, and even USB and SATA.

Some time ago, when the Internet connections were done using a 56k modem, the serial port was the most common way of connecting a modem to a computer. Now that we have ADSL modems, the serial ports have disappeared from newer computers, but the protocol is still widely used.

In fact, most microcontrollers, even the newer ones have one or more peripherals capable of communicating using this protocol, and from the PC side, all operating system

#include <SoftSPI.h>
/*
This code based from pecanpico6 Si446x Driver by KT5TK
https://github.com/tkrahn/pecanpico5a
*/
/*
const static uint8_t SS = 30; // PIC32 SS2
const static uint8_t MOSI = 29; // PIC32 SDO2
const static uint8_t MISO = 27; // PIC32 SDI2
@prasadwrites
prasadwrites / aligned_malloc.c
Created December 6, 2014 05:11
n byte aligned malloc implementation
/*
* nMalloc.cpp
*
* Created on: Dec 5, 2014
* Author: prasadnair
*/
#include <stdlib.h>
#include <stdio.h>
@ujentus
ujentus / RIOServer_sm9.cpp
Created July 15, 2013 02:11
Windows Registered I/O (RIO) Sample Code (Echo Server)
/*********************************************************************************************************
* Windows Registered I/O (RIO) Sample Code (Echo Server)
* Minimum requirement: Windows 8 or Windows Server 2012
* Author: @sm9kr
*
* Notice
* 몇몇 코드 조각들은 (http://www.serverframework.com/asynchronousevents/rio/)에서 가져옴.
* 그런데 여기도 제대로 완성된 코드가 있었던 것은 아니라서 상당 부분 기능을 추가하여 동작하도록 함.
* RIO의 사용법을 보여주기 위한 코드라 최대한 간단하게 필요한 부분만 넣었음.
* 그래서, 버그가 있을 수 있음...