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
function m=min_bisect(f,I,tol) | |
% min_bisect - beräknar nollställe till f(x) på intervallet I. | |
% Syntax: | |
% x = min_bisect(f,I,tol) | |
% Argument: | |
% f - funktionshandtag: pekar på namnet till en funktionsfil eller | |
% till en anonym funktion. T.ex. f=@funk eller f=@(x)cos(x)-x | |
% I - 1x2 matris, anger ett intervall I=[a,b]. Funktionen måste | |
% växla tecken på intervallet. | |
% tol - positivt tal som anger önskad noggrannhet för nollstället. |
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 VECTOR_DEST 0x2001C000 | |
#define SCB_VTOR ((volatile unsigned int *) 0xE000ED08) | |
#define SYSCFG_EXTICR1 ((volatile unsigned int*) 0x40013808) | |
#define EXTI_IMR ((volatile unsigned int*) 0x40013C00) | |
#define EXTI_RTSR ((volatile unsigned int*) 0x40013C08) | |
#define EXTI_FTSR ((volatile unsigned int*) 0x40013C0C) | |
#define EXTI_PR ((volatile unsigned int*) 0x40013C14) |
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 VECTOR_DEST 0x2001C000 | |
#define SCB_VTOR ((volatile unsigned int *) 0xE000ED08) | |
#define SYSCFG_EXTICR1 ((volatile unsigned int*) 0x40013808) | |
#define EXTI_IMR ((volatile unsigned int*) 0x40013C00) | |
#define EXTI_RTSR ((volatile unsigned int*) 0x40013C08) | |
#define EXTI_PR ((volatile unsigned int*) 0x40013C14) | |
#define EXTI3_IRQVEC (( void (**) (void)) 0x2001C064) |
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
@Anonym kod: EDA487-0059-PLX | |
@ R3=a | |
@ R4=b | |
@ R5=c | |
main: B init_data | |
LDR R0,#2020 @Argumentet ska ligga i R0 | |
B sum_grade | |
LDR R3,R0 @Return v�rdet flyttas till A | |
LDR R0,#2000 @Argumentet ska ligga i R0 | |
B sum_grade |
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 GPIO_E 0x40021000 | |
#define GPIO_E_MODER ((volatile int *) GPIO_E) | |
// OTYPER kan delas upp i två delar, dvs OTYPER_LOW och OTYPER_HIGH, kom dock ihåg att ändra 0x04 i så fall! Blir liksom 8 av portens bitar i så fall, t.ex E0-E7 man ändrar på då | |
#define GPIO_E_OTYPER ((volatile short *) GPIO_E+0x04) | |
// OSPEEDR kan delas upp i 4 delar, dvs OTYPER_LOW, "OTYPER_MID_LOW", "OTYPER_MID_HIGH" och OTYPER HIGH, kom dock ihåg att ändra 0x08 i så fall! Blir liksom 4 av portens bitar i så fall, t.ex E0-E3 man ändrar på då | |
// OSPEEDR kan också delas upp i två delar, dvs OSPEEDR_LOW och OSPEEDR_HIGH, kom dock ihåg att ändra 0x08 i så fall! Blir liksom 8 av portens bitar i så fall, t.ex E0-E7 man ändrar på då | |
#define GPIO_E_OSPEEDR ((volatile int *) GPIO_E+0x08) | |
// PUPDR kan delas upp i 4 delar, dvs PUPDR_LOW, "PUPDR_MID_LOW", "PUPDR_MID_HIGH" och PUPDR HIGH, kom dock ihåg att ändra 0x0C i så fall! Blir liksom 4 av portens bitar i så fall, t.ex E0-E3 man ändrar på då | |
// PUPDR kan också delas upp i två delar |
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
Denna länk är en bild på alla olika hopp (t.ex BNE, BLE osv..) https://i.imgur.com/1YQtKqJ.png | |
int i; | |
for (i = 0; i < 100; i++) | |
{ | |
satser | |
(här kan även break och continue användas) | |
} | |
Ges av Assembler av: |
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
/* | |
* startup.c | |
* | |
*/ | |
#include <stdio.h> | |
#include <libMD407.h> | |
__attribute__((naked)) __attribute__((section (".start_section")) ) | |
void startup (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
/* | |
* startup.c | |
* | |
*/ | |
#include <stdio.h> | |
#include <libMD407.h> | |
__attribute__((naked)) __attribute__((section (".start_section")) ) | |
void startup (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
/* | |
* startup.c | |
* | |
*/ | |
#include <stdio.h> | |
#include <libMD407.h> | |
__attribute__((naked)) __attribute__((section (".start_section")) ) | |
void startup (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
/* | |
* libMD407 | |
* asciidisplay_driver.c | |
* Display connected to PE | |
* Driver for ASCIIDISPLAY | |
*/ | |
#include "libMD407.h" | |
static int asciidisplay_init(int initval); | |
static void asciidisplay_deinit(int deinitval); |
NewerOlder