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

mcp7940n.h

Committer:
rmaalmeida
Date:
2017-10-03
Revision:
6:3fb450ba1e95
Parent:
2:4b7f5a060c22

File content as of revision 6:3fb450ba1e95:

#ifndef DS1307RTC_h
#define DS1307RTC_h

//defini��o dos endere�os
#define SEC     0
#define MINUTES     1
#define HOUR    2
#define WEEKDAY 3
#define DAY     4
#define MONTH   5
#define YEAR    6

    //fun��es do DS1307
    void mcpInit(void);
    void mcpStartClock(void);
    void mcpStopClock(void);
    int dec2bcd(int value);
    int bcd2dec(int value);
    void mcpWriteData(unsigned char value, int address);
    int mcpReadData(int address);

//fun��es de leitura/escrita simplificadas
#define getSeconds()  (bcd2dec(mcpReadData(SEC)& 0x7f))
#define getMinutes()  (bcd2dec(mcpReadData(MINUTES)& 0x7f))
#define getHours()    (bcd2dec(mcpReadData(HOUR)& 0x5f))
#define getWeekDay()  (bcd2dec(mcpReadData(WEEKDAY)& 0x07))
#define getDays()     (bcd2dec(mcpReadData(DAY)& 0x5f))
#define getMonths()   (bcd2dec(mcpReadData(MONTH)& 0x3f))
#define getYears()    (bcd2dec(mcpReadData(YEAR)& 0xff))

#define setSeconds(v) (mcpWriteData(dec2bcd(v,SEC)))
#define setMinutes(v) (mcpWriteData(dec2bcd(v,MINUTES)))
#define setHours(v)   (mcpWriteData(dec2bcd(v,HOUR)))
#define setWeekDay(v) (mcpWriteData(dec2bcd(v,WEEKDAY)))
#define setDays(v)    (mcpWriteData(dec2bcd(v,DAY)))
#define setMonths(v)  (mcpWriteData(dec2bcd(v,MONTH)))
#define setYears(v)   (mcpWriteData(dec2bcd(v,YEAR)))

#endif