This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef _SAPI_GPIO_H_ | |
#define _SAPI_GPIO_H_ | |
#include "sapi_datatypes.h" | |
#include "sapi_peripheral_map.h" | |
/* @question: Bitfield o valores unicos? | |
* Bitfield permite formar configuraciones no excluyentes que pueden | |
* tener sentido en muchas arquitecturas: | |
* GPIO_PULLUP | GPIP_PULLDOWN | GPIO_INPUT <- modo repeater en lpc43xx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define DECL_STRING(name, value) \ | |
char name##_strBuffer[sizeof(value)]; \ | |
String_t name = StringNewFromC(value, name##_strBuffer) | |
DECL_STRING(a, "Hola mundo"); | |
/* | |
char a_strBuffer[sizeof("Hola mundo")]; \ | |
String_t a = StringNewFromC("Hola mundo", a_strBuffer) | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Esto crea los defines traductores | |
silab_hack_head.h: silab_hack.txt | |
sed 's/^\(.*\)/#define silab_\1 \1/' $< > $@ | |
# esto crea los undef para que no se pisen los codigos | |
silab_hack_tail.h: silab_hack.txt | |
sed 's/^\(.*\)/#undef silab_\1 \1/' $< > $@ | |
# definir que silab_hack.h depende de *head.h y *tail.h para que se construyan automaticamente |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PACKAGES="coreutils git bash" | |
FILTERED="'/usr/share' perl terminfo" | |
_F_CMD=$(for f in $FILTERED; do echo -n "grep -v -F $f | "; done) | |
F_CMD=${_F_CMD::-2} | |
D_CMD=$(pacman -Q -l $(for p in $PACKAGES; do pactree.exe -lu $p; done)|cut -d ' ' -f 2|sort -u | eval $F_CMD ) | |
for f in $D_CMD | |
do | |
test -f $f && cp -v $f tmp$f; | |
test -d $f && mkdir -vp tmp$f | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import sys | |
if len(sys.argv) < 1: | |
print("Usage: {} <svdfile.svd>".format(sys.argv[0])) | |
regex = r"<interrupt>\s*<name>(\S+)<\/name>\s*<value>(\S+)<\/value>\s*<\/interrupt>" | |
def intname(name): return "0" if not name else "{}_IRQHandler".format(name) | |
def declname(name): return "void {} __attribute__((weak));".format(intname(name)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Copyright <year>, <author, authors> | |
<author> : <author url or mail> | |
<author> : <author url or mail> | |
<author> : <author url or mail> | |
This file is part of CIAA Hardware. | |
Redistribution and use in source and binary forms, with or without | |
modification, are permitted provided that the following conditions are met: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "staticTaskFreeRTOS.h" | |
TASK_DECL(task, configMINIMAL_STACK_SIZE) { | |
while(1) { | |
// DO anything | |
taskYIELD(); | |
} | |
} | |
int main(void) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <programa.h> | |
using namespace sapi; | |
struct { | |
DigitalIn button; | |
DigitalOut led; | |
} io[] = { | |
{ { TEC2 }, { LED1 } }, | |
{ { TEC3 }, { LED2 } }, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface ftdi | |
ftdi_device_desc "Dual RS232-HS" | |
ftdi_vid_pid 0x0403 0x6010 | |
ftdi_channel 0 | |
ftdi_layout_init 0x0708 0xFFFB | |
ftdi_layout_signal nTRST -data 0x0100 | |
ftdi_layout_signal nSRST -data 0x0200 | |
transport select jtag | |
adapter_khz 2000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add this to libs/sapi/sapi_v0.5.2/soc/peripherals/src/sapi_spi.c | |
void spiShiftBlock( spiMap_t spi, const uint8_t *in, uint8_t *out, uint32_t count) | |
{ | |
Chip_SSP_DATA_SETUP_T xferConfig; | |
uint8_t out; | |
xferConfig.tx_data = ∈ | |
xferConfig.tx_cnt = 0; | |
xferConfig.rx_data = &out; | |
xferConfig.rx_cnt = 0; |
OlderNewer