some stuff

This commit is contained in:
2022-01-28 14:00:31 -06:00
parent d94c63a964
commit 8dc484e0d1
49 changed files with 3511 additions and 664 deletions

37
labW6barnestr/Inc/delay.h Normal file
View File

@@ -0,0 +1,37 @@
/*
* delay.h
*
* Created on: Dec 10, 2021
* Author: Trevor Barnes
*/
//include guards
#ifndef DELAY_H_
#define DELAY_H_
#include <inttypes.h>
#define STK_CTRL (volatile uint32_t*) 0xE000E010
#define STK_LOAD (volatile uint32_t*) 0xE000E014
#define STK_VAL (volatile uint32_t*) 0xE000E018
#define EN 1
#define TICKINT (1<<1)
#define CLKSOURCE (1<<2)
#define COUNTFLAG (1<<16)
/*
* delay_1ms
* Busy wait for n ms
*
* For n iterations
* load number of cycles for 1 ms
* set one to enable and clock source
*
* wait for countflag to be set
*/
void delay_1ms(uint32_t n);
#endif /* DELAY_H_ */