Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ejemplo de texto deslizante en miniblip #47

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Binary file added felicidades/.hg/00changelog.i
Binary file not shown.
Binary file added felicidades/.hg/dirstate
Binary file not shown.
4 changes: 4 additions & 0 deletions felicidades/.hg/requires
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
revlogv1
fncache
store
dotencode
22 changes: 22 additions & 0 deletions felicidades/.hgignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
syntax: regexp
\.hgignore$
\.git$
\.svn$
\.orig$
\.msub$
\.meta$
\.ctags
\.uvproj$
\.uvopt$
\.project$
\.cproject$
\.launch$
\.project$
\.cproject$
\.launch$
Makefile$
\.ewp$
\.eww$
\.htm$
Debug$
.settings$
1 change: 1 addition & 0 deletions felicidades/GettingStarted.htm
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<meta http-equiv="refresh" content="0; url=http://mbed.org/handbook/Getting-Started-mbed-Exporters#gcc_arm"/>
90 changes: 90 additions & 0 deletions felicidades/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# This file was automagically generated by mbed.org. For more information,
# see http://mbed.org/handbook/Exporting-to-GCC-ARM-Embedded

GCC_BIN =
PROJECT = felicidades
OBJECTS = ./main.o ./PixelArray/neopixel.o ./PixelArray/BurstSPI/BurstSPI_LPC1768.o ./PixelArray/BurstSPI/BurstSPI_KL25Z.o ./PixelArray/BurstSPI/BurstSPI_NUCLEO_L152RE.o ./PixelArray/BurstSPI/BurstSPI_KL46Z.o ./USBDevice/USBHID/USBMouse.o ./USBDevice/USBHID/USBHID.o ./USBDevice/USBHID/USBMouseKeyboard.o ./USBDevice/USBHID/USBKeyboard.o ./USBDevice/USBDevice/USBHAL_KL25Z.o ./USBDevice/USBDevice/USBDevice.o ./USBDevice/USBDevice/USBHAL_LPC17.o ./USBDevice/USBDevice/USBHAL_LPC11U.o ./USBDevice/USBAudio/USBAudio.o ./USBDevice/USBSerial/USBSerial.o ./USBDevice/USBSerial/USBCDC.o ./USBDevice/USBMSD/USBMSD.o ./USBDevice/USBMIDI/USBMIDI.o
SYS_OBJECTS = ./mbed/TARGET_LPC11U24/TOOLCHAIN_GCC_ARM/board.o ./mbed/TARGET_LPC11U24/TOOLCHAIN_GCC_ARM/cmsis_nvic.o ./mbed/TARGET_LPC11U24/TOOLCHAIN_GCC_ARM/retarget.o ./mbed/TARGET_LPC11U24/TOOLCHAIN_GCC_ARM/startup_LPC11xx.o ./mbed/TARGET_LPC11U24/TOOLCHAIN_GCC_ARM/system_LPC11Uxx.o
INCLUDE_PATHS = -I. -I./PixelArray -I./PixelArray/BurstSPI -I./USBDevice -I./USBDevice/USBHID -I./USBDevice/USBDevice -I./USBDevice/USBAudio -I./USBDevice/USBSerial -I./USBDevice/USBMSD -I./USBDevice/USBMIDI -I./mbed -I./mbed/TARGET_LPC11U24 -I./mbed/TARGET_LPC11U24/TARGET_NXP -I./mbed/TARGET_LPC11U24/TARGET_NXP/TARGET_LPC11UXX -I./mbed/TARGET_LPC11U24/TARGET_NXP/TARGET_LPC11UXX/TARGET_LPC11U24_401 -I./mbed/TARGET_LPC11U24/TOOLCHAIN_GCC_ARM
LIBRARY_PATHS = -L./mbed/TARGET_LPC11U24/TOOLCHAIN_GCC_ARM
LIBRARIES = -lmbed
LINKER_SCRIPT = ./mbed/TARGET_LPC11U24/TOOLCHAIN_GCC_ARM/LPC11U24.ld

###############################################################################
AS = $(GCC_BIN)arm-none-eabi-as
CC = $(GCC_BIN)arm-none-eabi-gcc
CPP = $(GCC_BIN)arm-none-eabi-g++
LD = $(GCC_BIN)arm-none-eabi-gcc
OBJCOPY = $(GCC_BIN)arm-none-eabi-objcopy
OBJDUMP = $(GCC_BIN)arm-none-eabi-objdump
SIZE = $(GCC_BIN)arm-none-eabi-size


CPU = -mcpu=cortex-m0 -mthumb
CC_FLAGS = $(CPU) -c -g -fno-common -fmessage-length=0 -Wall -Wextra -fno-exceptions -ffunction-sections -fdata-sections -fomit-frame-pointer -MMD -MP
CC_SYMBOLS = -D__CORTEX_M0 -DTARGET_LPC11UXX -DTOOLCHAIN_GCC -DMBED_BUILD_TIMESTAMP=1451407919.0 -DTARGET_LPC11U24_401 -DTARGET_CORTEX_M -DTARGET_NXP -DTOOLCHAIN_GCC_ARM -DTARGET_M0 -DARM_MATH_CM0 -DTARGET_LPC11U24 -D__MBED__=1

LD_FLAGS = $(CPU) -Wl,--gc-sections --specs=nano.specs -Wl,--wrap,main -Wl,-Map=$(PROJECT).map,--cref
#LD_FLAGS += -u _printf_float -u _scanf_float
LD_SYS_LIBS = -lstdc++ -lsupc++ -lm -lc -lgcc -lnosys


ifeq ($(DEBUG), 1)
CC_FLAGS += -DDEBUG -O0
else
CC_FLAGS += -DNDEBUG -Os
endif

.PHONY: all clean lst size

all: $(PROJECT).bin $(PROJECT).hex size


clean:
rm -f $(PROJECT).bin $(PROJECT).elf $(PROJECT).hex $(PROJECT).map $(PROJECT).lst $(OBJECTS) $(DEPS)


.asm.o:
$(CC) $(CPU) -c -x assembler-with-cpp -o $@ $<
.s.o:
$(CC) $(CPU) -c -x assembler-with-cpp -o $@ $<
.S.o:
$(CC) $(CPU) -c -x assembler-with-cpp -o $@ $<

.c.o:
$(CC) $(CC_FLAGS) $(CC_SYMBOLS) -std=gnu99 $(INCLUDE_PATHS) -o $@ $<

.cpp.o:
$(CPP) $(CC_FLAGS) $(CC_SYMBOLS) -std=gnu++98 -fno-rtti $(INCLUDE_PATHS) -o $@ $<




$(PROJECT).elf: $(OBJECTS) $(SYS_OBJECTS)
$(LD) $(LD_FLAGS) -T$(LINKER_SCRIPT) $(LIBRARY_PATHS) -o $@ $^ $(LIBRARIES) $(LD_SYS_LIBS) $(LIBRARIES) $(LD_SYS_LIBS)

@echo ""
@echo "*****"
@echo "***** You must modify vector checksum value in *.bin and *.hex files."
@echo "*****"
@echo ""


$(PROJECT).bin: $(PROJECT).elf
$(OBJCOPY) -O binary $< $@

$(PROJECT).hex: $(PROJECT).elf
@$(OBJCOPY) -O ihex $< $@

$(PROJECT).lst: $(PROJECT).elf
@$(OBJDUMP) -Sdh $< > $@

lst: $(PROJECT).lst

size: $(PROJECT).elf
$(SIZE) $(PROJECT).elf

DEPS = $(OBJECTS:.o=.d) $(SYS_OBJECTS:.o=.d)
-include $(DEPS)


1 change: 1 addition & 0 deletions felicidades/PixelArray.lib
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
http://mbed.org/users/JacobBramley/code/PixelArray/#47802e75974e
Binary file added felicidades/PixelArray/.hg/00changelog.i
Binary file not shown.
1 change: 1 addition & 0 deletions felicidades/PixelArray/.hg/branch
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
default
2 changes: 2 additions & 0 deletions felicidades/PixelArray/.hg/cache/branchheads
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
47802e75974e8668340e597eaf1dd3a9040b05fe 5
47802e75974e8668340e597eaf1dd3a9040b05fe default
2 changes: 2 additions & 0 deletions felicidades/PixelArray/.hg/cache/tags
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
5 47802e75974e8668340e597eaf1dd3a9040b05fe

Binary file added felicidades/PixelArray/.hg/dirstate
Binary file not shown.
2 changes: 2 additions & 0 deletions felicidades/PixelArray/.hg/hgrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[paths]
default = http://mbed.org/users/JacobBramley/code/PixelArray/
4 changes: 4 additions & 0 deletions felicidades/PixelArray/.hg/requires
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
revlogv1
store
fncache
dotencode
Binary file added felicidades/PixelArray/.hg/store/00changelog.i
Binary file not shown.
Binary file added felicidades/PixelArray/.hg/store/00manifest.i
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
5 changes: 5 additions & 0 deletions felicidades/PixelArray/.hg/store/fncache
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
data/neopixel-spi.cpp.i
data/neopixel.cpp.i
data/BurstSPI.lib.i
data/neopixel-spi.h.i
data/neopixel.h.i
Binary file added felicidades/PixelArray/.hg/store/undo
Binary file not shown.
Empty file.
1 change: 1 addition & 0 deletions felicidades/PixelArray/.hg/undo.branch
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
default
3 changes: 3 additions & 0 deletions felicidades/PixelArray/.hg/undo.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
0
pull
file:///filer/web_data/repos/920/51465
Empty file.
19 changes: 19 additions & 0 deletions felicidades/PixelArray/.hgignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
syntax: regexp
\.hgignore$
\.git$
\.svn$
\.orig$
\.msub$
\.meta$
\.ctags
\.uvproj$
\.uvopt$
\.project$
\.cproject$
\.launch$
\.project$
\.cproject$
\.launch$
Makefile$
\.ewp$
\.eww$
1 change: 1 addition & 0 deletions felicidades/PixelArray/BurstSPI.lib
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
http://mbed.org/users/Sissors/code/BurstSPI/#97d75b6d5028
Binary file added felicidades/PixelArray/BurstSPI/.hg/00changelog.i
Binary file not shown.
1 change: 1 addition & 0 deletions felicidades/PixelArray/BurstSPI/.hg/branch
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
default
2 changes: 2 additions & 0 deletions felicidades/PixelArray/BurstSPI/.hg/cache/branchheads
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bc069279eb37718732464a0378c78bd938487de6 13
bc069279eb37718732464a0378c78bd938487de6 default
Binary file added felicidades/PixelArray/BurstSPI/.hg/dirstate
Binary file not shown.
2 changes: 2 additions & 0 deletions felicidades/PixelArray/BurstSPI/.hg/hgrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[paths]
default = http://mbed.org/users/Sissors/code/BurstSPI/
4 changes: 4 additions & 0 deletions felicidades/PixelArray/BurstSPI/.hg/requires
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
revlogv1
store
fncache
dotencode
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
10 changes: 10 additions & 0 deletions felicidades/PixelArray/BurstSPI/.hg/store/fncache
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
data/BurstSPI_KL46Z.cpp.i
data/BurstSPI_STM32F4.cpp.i
data/BurstSPI_Unsupported.cpp.i
data/BurstSPI_NUCLEO_L152RE.cpp.i
data/BurstSPI.h.i
data/BurstSPI_LPC1768.cpp.i
data/BurstSPI_LPC_X.cpp.i
data/BurstSPI_KL25Z.cpp.i
data/BurstSPI.cpp.i
data/BurstSPI_LPC_1549.cpp.i
Binary file added felicidades/PixelArray/BurstSPI/.hg/store/undo
Binary file not shown.
Empty file.
1 change: 1 addition & 0 deletions felicidades/PixelArray/BurstSPI/.hg/undo.branch
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
default
3 changes: 3 additions & 0 deletions felicidades/PixelArray/BurstSPI/.hg/undo.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
0
pull
file:///filer/web_data/repos/18579/41848
Empty file.
19 changes: 19 additions & 0 deletions felicidades/PixelArray/BurstSPI/.hgignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
syntax: regexp
\.hgignore$
\.git$
\.svn$
\.orig$
\.msub$
\.meta$
\.ctags
\.uvproj$
\.uvopt$
\.project$
\.cproject$
\.launch$
\.project$
\.cproject$
\.launch$
Makefile$
\.ewp$
\.eww$
114 changes: 114 additions & 0 deletions felicidades/PixelArray/BurstSPI/BurstSPI.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
#ifndef BURSTSPI_H
#define BURSTSPI_H

#include "mbed.h"


/** An SPI Master, used for communicating with SPI slave devices at very high speeds
*
* The default mbed SPI class allows for communication via the SPI bus at high clock frequencies,
* however at these frequencies there is alot of overhead from the mbed code.
* While this code makes sure your code is alot more robust, it is also relative slow.
* This library adds to your default SPI commands some extra commands to transmit data rapidly with
* very little overhead. Downsides are that currently it is TX only (all RX packets are discarded),
* and it requires some extra commands.
*
* Example:
* @code
* //Send 1000 SPI packets as fast as possible
* spi.setFormat();
* for (int i = 0; i<1000; i++)
* spi.fastWrite(data[i]);
* spi.clearRX();
* @endcode
*
* As an example, writing 76,800 16-bit data packets to an LCD screen at 48MHz requires 111ms with
* the normal mbed library. With this library it takes 25ms, which is also the theoretical
* amount of time it should take. If you are running at 1MHz this will do alot less.
*/
class BurstSPI : public SPI
{
public:
/** Create a SPI master connected to the specified pins
*
* Pin Options:
* (5, 6, 7) or (11, 12, 13)
*
* mosi or miso can be specfied as NC if not used
*
* @param mosi SPI Master Out, Slave In pin
* @param miso SPI Master In, Slave Out pin
* @param sclk SPI Clock pin
*/
BurstSPI(PinName mosi, PinName miso, PinName sclk) : SPI(mosi, miso, sclk) {};

/** Put data packet in the SPI TX FIFO buffer
*
* If there is no space in the FIFO buffer it will block until there is space.
* The FIFO buffer will automatically send the packets. There is no receiving here, only transmitting.
*
* @param data Data to be sent to the SPI slave
*/
void fastWrite(int data);

/** Use this function before fastWrite to set the correct settings
*
* It is not needed to use this if the last SPI commands were either normal SPI transmissions,
* or setting different format/frequency for this object. It is required to call this
* function when several SPI objects use the same peripheral, and your last transmission was
* from a different object with different settings. Not sure if you should use it?
* Use it, it takes very little time to execute, so can't hurt.
*/
void setFormat( void ) {
format(_bits, _mode);
frequency(_hz);
}

/** After you are done with fastWrite, call this function
*
* FastWrite simply fills the SPI's (SSP's actually) TX FIFO buffer as fast as it can,
* and that is the only thing it does. It doesn't do anything with received packages (currently, may change),
* so the the RX buffer is full with unneeded packets. This function waits until transmission is finished,
* and clears the RX buffer. You always have to call this before you want to receive
* SPI data after using fastWrite.
*/
void clearRX( void );


//Just for documentation:
#if 0
/** Configure the data transmission format
*
* @param bits Number of bits per SPI frame (4 - 16)
* @param mode Clock polarity and phase mode (0 - 3)
*
* @code
* mode | POL PHA
* -----+--------
* 0 | 0 0
* 1 | 0 1
* 2 | 1 0
* 3 | 1 1
* @endcode
*/
void format(int bits, int mode = 0);

/** Set the spi bus clock frequency
*
* @param hz SCLK frequency in hz (default = 1MHz)
*/
void frequency(int hz = 1000000);

/** Write to the SPI Slave and return the response
*
* @param value Data to be sent to the SPI slave
*
* @returns
* Response from the SPI slave
*/
virtual int write(int value);
#endif

};

#endif
24 changes: 24 additions & 0 deletions felicidades/PixelArray/BurstSPI/BurstSPI_KL25Z.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#ifdef TARGET_KL25Z
#include "BurstSPI.h"

void BurstSPI::fastWrite(int data) {
//Wait until FIFO has space
while(((_spi.spi->S) & SPI_S_SPTEF_MASK) == 0);
//transmit data
_spi.spi->D = data;
}

void BurstSPI::clearRX( void ) {
//We put in a delay here, this function shouldn't be called very often, so not a huge problem
//Without delay you will rise the CS line before it is finished (been there, done that)
//We use time required to transmit 20 bits (8 bits being transmitted, 8 bits in FIFO, 4 bits safety margin

float bytetime = 20.0/_hz;
wait(bytetime);

//Wait until status is flagged that we can read, read:
while (_spi.spi->S & SPI_S_SPRF_MASK == 0);
int dummy = _spi.spi->D;

}
#endif
24 changes: 24 additions & 0 deletions felicidades/PixelArray/BurstSPI/BurstSPI_KL46Z.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#ifdef TARGET_KL46Z
#include "BurstSPI.h"

void BurstSPI::fastWrite(int data) {
//Wait until FIFO has space
while(((_spi.spi->S) & SPI_S_SPTEF_MASK) == 0);
//transmit data
_spi.spi->DL = data;
}

void BurstSPI::clearRX( void ) {
//We put in a delay here, this function shouldn't be called very often, so not a huge problem
//Without delay you will rise the CS line before it is finished (been there, done that)
//We use time required to transmit 20 bits (8 bits being transmitted, 8 bits in FIFO, 4 bits safety margin

float bytetime = 20.0/_hz;
wait(bytetime);

//Wait until status is flagged that we can read, read:
while (_spi.spi->S & SPI_S_SPRF_MASK == 0);
int dummy = _spi.spi->DL;

}
#endif
Loading