Pão de Queijo Development Board. This repo has all libraries from pqdb shield.

Dependents:   pqdb_demo

Pão de Queijo development board is a shield for add-on on any arduino compatible board.

/media/uploads/rmaalmeida/compatibilidade_branco.png

This project presents the libraries to control the board peripherals using mbed framework. The libraries works as interfaces to keep the main code compatible with the examples from the book "Programação de sistemas embarcados". The peripherals on the board are presented on the folowing picture

/media/uploads/rmaalmeida/pqdb_perifericos.png

The main objective of the project is to develop a low cost, easy to assemble board with a group of peripheral that allows one to start learning embedded systems. The board was routed on one side copper PCB to make easier to buid it yourself.

/media/uploads/rmaalmeida/pqdb_fenolite_-_cortada.png

The source code for Arduino boards (wiring) can be found on: https://github.com/projetopqdb/PQDB-Arduino

The source code for freedom frdm KL05 board (using direct register access) can be found on: https://github.com/projetopqdb/PQDB-KL05Z

The source code from the board schematics and layout can be found on: https://github.com/projetopqdb/PQDB-Hardware

Committer:
rmaalmeida
Date:
Tue Oct 03 01:27:24 2017 +0000
Revision:
6:3fb450ba1e95
Parent:
0:32fded6e1775
timer driver added

Who changed what in which revision?

UserRevisionLine numberNew contents of line
rmaalmeida 0:32fded6e1775 1 //#include "io.h"
rmaalmeida 0:32fded6e1775 2
rmaalmeida 0:32fded6e1775 3 #include "mbed.h"
rmaalmeida 0:32fded6e1775 4 //#define SO_CLK_PIN 11
rmaalmeida 0:32fded6e1775 5 //#define SO_EN_PIN 10
rmaalmeida 0:32fded6e1775 6 //#define SO_DATA_PIN 8
rmaalmeida 0:32fded6e1775 7
rmaalmeida 0:32fded6e1775 8 DigitalOut SO_CLK_PIN(D11);
rmaalmeida 0:32fded6e1775 9 DigitalOut SO_EN_PIN(D10);
rmaalmeida 0:32fded6e1775 10 DigitalOut SO_DATA_PIN(D8);
rmaalmeida 0:32fded6e1775 11
rmaalmeida 0:32fded6e1775 12 void soInit(void) {
rmaalmeida 0:32fded6e1775 13 //not nedded?
rmaalmeida 0:32fded6e1775 14 }
rmaalmeida 0:32fded6e1775 15 //pulso de clock para habilitar os dados na sáida
rmaalmeida 0:32fded6e1775 16 void PulseEnClock(void){
rmaalmeida 0:32fded6e1775 17 SO_EN_PIN = 1;
rmaalmeida 0:32fded6e1775 18 SO_EN_PIN = 0;
rmaalmeida 0:32fded6e1775 19 //digitalWrite(SO_EN_PIN, HIGH);
rmaalmeida 0:32fded6e1775 20 //digitalWrite(SO_EN_PIN, LOW);
rmaalmeida 0:32fded6e1775 21 }
rmaalmeida 0:32fded6e1775 22 //pulso de clock para enviar um bit
rmaalmeida 0:32fded6e1775 23 void PulseClockData(void){
rmaalmeida 0:32fded6e1775 24 SO_CLK_PIN = 1;
rmaalmeida 0:32fded6e1775 25 SO_CLK_PIN = 0;
rmaalmeida 0:32fded6e1775 26
rmaalmeida 0:32fded6e1775 27 //digitalWrite(SO_CLK_PIN, HIGH);
rmaalmeida 0:32fded6e1775 28 //digitalWrite(SO_CLK_PIN, LOW);
rmaalmeida 0:32fded6e1775 29 }
rmaalmeida 0:32fded6e1775 30 void soWrite(int value) {
rmaalmeida 0:32fded6e1775 31 char i;
rmaalmeida 0:32fded6e1775 32 SO_CLK_PIN = 0;
rmaalmeida 0:32fded6e1775 33 //digitalWrite(SO_CLK_PIN, LOW);
rmaalmeida 0:32fded6e1775 34 for (i = 0; i < 8; i++) {
rmaalmeida 0:32fded6e1775 35 //make shure its one(1) or zero(0)
rmaalmeida 0:32fded6e1775 36 SO_DATA_PIN = !(!(value & 0x80)) ;
rmaalmeida 0:32fded6e1775 37 //digitalWrite(SO_DATA_PIN, value & 0x80);
rmaalmeida 0:32fded6e1775 38 PulseClockData();
rmaalmeida 0:32fded6e1775 39 value <<= 1;
rmaalmeida 0:32fded6e1775 40 }
rmaalmeida 0:32fded6e1775 41 PulseEnClock();
rmaalmeida 0:32fded6e1775 42 }