Pão de Queijo Development Board. This repo has all libraries from pqdb shield.
Pão de Queijo development board is a shield for add-on on any arduino compatible board.
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
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.
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@6:3fb450ba1e95, 2017-10-03 (annotated)
- Committer:
- rmaalmeida
- Date:
- Tue Oct 03 01:27:24 2017 +0000
- Revision:
- 6:3fb450ba1e95
- Parent:
- 2:4b7f5a060c22
timer driver added
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
rmaalmeida | 2:4b7f5a060c22 | 1 | #ifndef DS1307RTC_h |
rmaalmeida | 2:4b7f5a060c22 | 2 | #define DS1307RTC_h |
rmaalmeida | 2:4b7f5a060c22 | 3 | |
rmaalmeida | 2:4b7f5a060c22 | 4 | //defini��o dos endere�os |
rmaalmeida | 2:4b7f5a060c22 | 5 | #define SEC 0 |
rmaalmeida | 2:4b7f5a060c22 | 6 | #define MINUTES 1 |
rmaalmeida | 2:4b7f5a060c22 | 7 | #define HOUR 2 |
rmaalmeida | 2:4b7f5a060c22 | 8 | #define WEEKDAY 3 |
rmaalmeida | 2:4b7f5a060c22 | 9 | #define DAY 4 |
rmaalmeida | 2:4b7f5a060c22 | 10 | #define MONTH 5 |
rmaalmeida | 2:4b7f5a060c22 | 11 | #define YEAR 6 |
rmaalmeida | 2:4b7f5a060c22 | 12 | |
rmaalmeida | 2:4b7f5a060c22 | 13 | //fun��es do DS1307 |
rmaalmeida | 2:4b7f5a060c22 | 14 | void mcpInit(void); |
rmaalmeida | 2:4b7f5a060c22 | 15 | void mcpStartClock(void); |
rmaalmeida | 2:4b7f5a060c22 | 16 | void mcpStopClock(void); |
rmaalmeida | 2:4b7f5a060c22 | 17 | int dec2bcd(int value); |
rmaalmeida | 2:4b7f5a060c22 | 18 | int bcd2dec(int value); |
rmaalmeida | 2:4b7f5a060c22 | 19 | void mcpWriteData(unsigned char value, int address); |
rmaalmeida | 2:4b7f5a060c22 | 20 | int mcpReadData(int address); |
rmaalmeida | 2:4b7f5a060c22 | 21 | |
rmaalmeida | 2:4b7f5a060c22 | 22 | //fun��es de leitura/escrita simplificadas |
rmaalmeida | 2:4b7f5a060c22 | 23 | #define getSeconds() (bcd2dec(mcpReadData(SEC)& 0x7f)) |
rmaalmeida | 2:4b7f5a060c22 | 24 | #define getMinutes() (bcd2dec(mcpReadData(MINUTES)& 0x7f)) |
rmaalmeida | 2:4b7f5a060c22 | 25 | #define getHours() (bcd2dec(mcpReadData(HOUR)& 0x5f)) |
rmaalmeida | 2:4b7f5a060c22 | 26 | #define getWeekDay() (bcd2dec(mcpReadData(WEEKDAY)& 0x07)) |
rmaalmeida | 2:4b7f5a060c22 | 27 | #define getDays() (bcd2dec(mcpReadData(DAY)& 0x5f)) |
rmaalmeida | 2:4b7f5a060c22 | 28 | #define getMonths() (bcd2dec(mcpReadData(MONTH)& 0x3f)) |
rmaalmeida | 2:4b7f5a060c22 | 29 | #define getYears() (bcd2dec(mcpReadData(YEAR)& 0xff)) |
rmaalmeida | 2:4b7f5a060c22 | 30 | |
rmaalmeida | 2:4b7f5a060c22 | 31 | #define setSeconds(v) (mcpWriteData(dec2bcd(v,SEC))) |
rmaalmeida | 2:4b7f5a060c22 | 32 | #define setMinutes(v) (mcpWriteData(dec2bcd(v,MINUTES))) |
rmaalmeida | 2:4b7f5a060c22 | 33 | #define setHours(v) (mcpWriteData(dec2bcd(v,HOUR))) |
rmaalmeida | 2:4b7f5a060c22 | 34 | #define setWeekDay(v) (mcpWriteData(dec2bcd(v,WEEKDAY))) |
rmaalmeida | 2:4b7f5a060c22 | 35 | #define setDays(v) (mcpWriteData(dec2bcd(v,DAY))) |
rmaalmeida | 2:4b7f5a060c22 | 36 | #define setMonths(v) (mcpWriteData(dec2bcd(v,MONTH))) |
rmaalmeida | 2:4b7f5a060c22 | 37 | #define setYears(v) (mcpWriteData(dec2bcd(v,YEAR))) |
rmaalmeida | 2:4b7f5a060c22 | 38 | |
rmaalmeida | 2:4b7f5a060c22 | 39 | #endif |