Deplacer les fichiers
This commit is contained in:
parent
a79ec6a59c
commit
71e2f55c50
9 changed files with 69 additions and 312 deletions
Binary file not shown.
|
|
@ -1,80 +0,0 @@
|
||||||
#include "stm32f10x.h"
|
|
||||||
|
|
||||||
#define In_Floating 0x4
|
|
||||||
#define In_PullDown 0x8
|
|
||||||
#define In_PullUp 0x8
|
|
||||||
#define In_Analog 0x0
|
|
||||||
#define Out_Ppull 0x3
|
|
||||||
#define Out_OD 0x7
|
|
||||||
#define AltOut_Ppull 0xB
|
|
||||||
#define AltOut_OD 0xF
|
|
||||||
|
|
||||||
void MyGPIO_Init(GPIO_TypeDef * GPIO, char pin, char conf ){
|
|
||||||
int shift_pin;
|
|
||||||
//Start clock
|
|
||||||
if(GPIO == GPIOA){
|
|
||||||
RCC -> APB2ENR |= RCC_APB2ENR_IOPAEN;
|
|
||||||
}
|
|
||||||
else if(GPIO == GPIOB){
|
|
||||||
RCC -> APB2ENR |= RCC_APB2ENR_IOPBEN;
|
|
||||||
}
|
|
||||||
else if(GPIO == GPIOC){
|
|
||||||
RCC -> APB2ENR |= RCC_APB2ENR_IOPCEN;
|
|
||||||
}
|
|
||||||
else if(GPIO == GPIOD){
|
|
||||||
RCC -> APB2ENR |= RCC_APB2ENR_IOPDEN;
|
|
||||||
}
|
|
||||||
if(pin < 8){//CRL zone
|
|
||||||
shift_pin = pin*4;
|
|
||||||
GPIO -> CRL &= ~(0xF << shift_pin);
|
|
||||||
//PullUp and PullDown have the same conf number, so we need to change the ODR to diferenciate them both
|
|
||||||
if(conf == In_PullUp){
|
|
||||||
GPIO -> CRL |= ( In_PullUp << shift_pin);
|
|
||||||
GPIO -> ODR |= (1<<pin);
|
|
||||||
}
|
|
||||||
else if(conf == In_PullDown){
|
|
||||||
GPIO -> CRL |= ( In_PullDown << shift_pin);
|
|
||||||
GPIO -> ODR &= ~(1<<pin);
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
GPIO -> CRL |= ( conf << shift_pin);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else{//CRH zone
|
|
||||||
shift_pin = (pin-8)*4;
|
|
||||||
GPIO -> CRH &= ~(0xF << shift_pin);
|
|
||||||
if(conf == In_PullUp){
|
|
||||||
GPIO -> CRH |= ( In_PullUp << shift_pin);
|
|
||||||
GPIO -> ODR |= (1<<pin);
|
|
||||||
}
|
|
||||||
else if(conf == In_PullDown){
|
|
||||||
GPIO -> CRH |= ( In_PullDown << shift_pin);
|
|
||||||
GPIO -> ODR &= ~(1<<pin);
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
GPIO -> CRH |= ( conf << shift_pin);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
int MyGPIO_Read(GPIO_TypeDef * GPIO, char GPIO_Pin){
|
|
||||||
if(GPIO -> IDR & (1 << GPIO_Pin)){
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
void MyGPIO_Set(GPIO_TypeDef * GPIO, char GPIO_Pin){
|
|
||||||
GPIO -> BSRR = (1<<GPIO_Pin);//1 on set zone
|
|
||||||
}
|
|
||||||
void MyGPIO_Reset(GPIO_TypeDef * GPIO, char GPIO_Pin){
|
|
||||||
GPIO -> BSRR = (1<<(GPIO_Pin+16));//1 on reset zone
|
|
||||||
}
|
|
||||||
void MyGPIO_Toggle(GPIO_TypeDef * GPIO, char GPIO_Pin){
|
|
||||||
if((GPIO-> ODR & (1<<GPIO_Pin)) != 0){
|
|
||||||
GPIO -> BSRR = (1<<(GPIO_Pin+16));
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
GPIO -> BSRR = (1<<GPIO_Pin);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,106 +0,0 @@
|
||||||
#include "stm32f10x.h"
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include "../Include/GPIO.h"
|
|
||||||
|
|
||||||
int ChercherEtat(GPIO_TypeDef * GPIO, int pin){ // Trouvons la valeur d'un broche sur un certain GPIO
|
|
||||||
return((GPIO -> IDR & (0x01 << pin)));
|
|
||||||
}
|
|
||||||
|
|
||||||
void ResetBroche(uint32_t GPIO, int Broche){ // Mettre à zero d'un certain broche d'un certain GPIO
|
|
||||||
GPIO -> BSRR |= BS Broche;
|
|
||||||
}
|
|
||||||
|
|
||||||
void SetBroche(uint32_t GPIO, int Broche){ // Mettre à zero d'un certain broche d'un certain GPIO
|
|
||||||
GPIO -> BSRR |= BSBroche << 16;
|
|
||||||
}
|
|
||||||
|
|
||||||
void TogglePin(GPIO_TypeDef*GPIO, int Broche){ // Inverser la valueur de broche sur GPIO
|
|
||||||
GPIO -> ODR = GPIO -> ODR ^ (0x1 << Broche);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ConfigureGPIO(uint32_t GPIO, int Broche, int IO, char * Mode){ // Mettre un broche d'un GPIO sur un mode
|
|
||||||
// Possble de améliorer avec des int à la place de string
|
|
||||||
//Start clock pour les GPIO concernés
|
|
||||||
if(GPIO == GPIOA){
|
|
||||||
RCC -> APB2ENR |= RCC_APB2ENR_IOPAEN;
|
|
||||||
}
|
|
||||||
else if(GPIO == GPIOB){
|
|
||||||
RCC -> APB2ENR |= RCC_APB2ENR_IOPBEN;
|
|
||||||
}
|
|
||||||
else if(GPIO == GPIOC){
|
|
||||||
RCC -> APB2ENR |= RCC_APB2ENR_IOPCEN;
|
|
||||||
}
|
|
||||||
else if(GPIO == GPIOD){
|
|
||||||
RCC -> APB2ENR |= RCC_APB2ENR_IOPDEN;
|
|
||||||
}
|
|
||||||
// Cas d'u CRL, broche 0 à 7
|
|
||||||
if (Broche < 8) {
|
|
||||||
GPIO -> CRL &= ~(0x1 << Broche *4) & ~(0x1 << Broche *4 +1) & ~(0x1 << Broche *4 + 2) & ~(0x1 << Broche *4 + 3); // Clean bits
|
|
||||||
if (IO == 0){ //Input
|
|
||||||
if (strcmp(Mode,"Floating")) {
|
|
||||||
GPIO -> CRL |= (0x1 << Broche *4) | (0x1 << Broche * 4 + 1);
|
|
||||||
}
|
|
||||||
else if (strcmp(Mode,"Pull-Up") || strcmp(Mode,"Pull-Down")){
|
|
||||||
GPIO -> CRL |= (0x1 << 6*4 + 1);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return; // Mode invalid
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if ( IO < 5) { // Output
|
|
||||||
GPIO -> CRL |= (0xIO << Broche * 4 + 2); // Frequency mode
|
|
||||||
if (strcmp(Mode, "Open-Drain")){
|
|
||||||
GPIO -> CRL |= (0x1 << Broche *4);
|
|
||||||
}
|
|
||||||
else if (strcmp(Mode, "Push-Pull Alterne")){
|
|
||||||
GPIO -> CRL |= (0x1 << Broche *4 + 1);
|
|
||||||
RCC->APB2ENR |= RCC_APB2ENR_AFIOEN; // Alternate Function I/O clock enable GPIOA
|
|
||||||
}
|
|
||||||
else if (strcmp(Mode, "Open-Drain Alterne")){
|
|
||||||
GPIO -> CRL |= (0x1 << Broche * 4) | (0x1 << Broche * 4 + 1);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return; // Mode invalid
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (Broche < 16) {
|
|
||||||
GPIO -> CRH &= ~(0x1 << Broche *4) & ~(0x1 << Broche *4 +1) & ~(0x1 << Broche *4 + 2) & ~(0x1 << Broche *4 + 3); // Clean bits
|
|
||||||
if (IO == 0){ //Input
|
|
||||||
if (strcmp(Mode,"Floating")) {
|
|
||||||
GPIO -> CRH |= (0x1 << Broche *4) | (0x1 << Broche * 4 + 1);
|
|
||||||
}
|
|
||||||
else if (strcmp(Mode,"Pull-Up") || strcmp(Mode,"Pull-Down")){
|
|
||||||
GPIO -> CRH |= (0x1 << 6*4 + 1);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return; // Mode invalid or doesn't exist
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if ( IO < 5) { // Output
|
|
||||||
GPIO -> CRH |= (0xIO << Broche * 4 + 2); // Frequency mode
|
|
||||||
if (strcmp(Mode, "Open-Drain")){
|
|
||||||
GPIO -> CRH |= (0x1 << Broche *4);
|
|
||||||
}
|
|
||||||
else if (strcmp(Mode, "Push-Pull Alterne")){
|
|
||||||
GPIO -> CRH |= (0x1 << Broche *4 + 1);
|
|
||||||
}
|
|
||||||
else if (strcmp(Mode, "Open-Drain Alterne")){
|
|
||||||
GPIO -> CRH |= (0x1 << Broche * 4) | (0x1 << Broche * 4 + 1);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return; // Mode invalid or doesn't exits
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
return; // IO invalid
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
return; // Pin number invalid
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,24 +0,0 @@
|
||||||
#include "stm32f10x.h"
|
|
||||||
#include "MyTimer.h"
|
|
||||||
#include "Nucleo.h"
|
|
||||||
#include "Timer.h"
|
|
||||||
#include "DriverGPIO.h"
|
|
||||||
#include "Gironde.h"
|
|
||||||
|
|
||||||
void configEncoder(TIM_TypeDef * Timer){
|
|
||||||
Timer -> CCMR1 |= TIM_CCMR1_CC1S;
|
|
||||||
Timer -> CCMR2 |= TIM_CCMR1_CC2S;
|
|
||||||
Timer -> CCER &= ~(TIM_CCER_CC1P | TIM_CCER_CC1NP);
|
|
||||||
Timer -> CCMR1 &= ~(TIM_CCMR1_IC1F);
|
|
||||||
Timer -> CCER &= ~(TIM_CCER_CC2P | TIM_CCER_CC2NP);
|
|
||||||
Timer -> CCMR2 &= ~(TIM_CCMR1_IC2F);
|
|
||||||
Timer -> SMCR &= ~TIM_SMCR_SMS;
|
|
||||||
Timer -> SMCR |= TIM_SMCR_SMS_0 | TIM_SMCR_SMS_1;
|
|
||||||
Timer -> CR1 |= TIM_CR1_CEN;
|
|
||||||
Timer -> ARR = 0xFFFF;
|
|
||||||
}
|
|
||||||
void configChannel(){
|
|
||||||
MyGPIO_Init(GPIOA,7,In_Floating );
|
|
||||||
MyGPIO_Init(GPIOA,8,In_Floating );
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,36 +0,0 @@
|
||||||
#include "stm32f10x.h"
|
|
||||||
#include "../Include/Timer.h"
|
|
||||||
#include "../Include/PWM.h"
|
|
||||||
#include "../Include/DriverGPIO.h"
|
|
||||||
// Variables
|
|
||||||
#define ARR_TIM1 0xFFAD
|
|
||||||
#define PSC_TIM1 0xFF
|
|
||||||
#define ARR_TIM2 0xFFAD
|
|
||||||
#define PSC_TIM2 0x0225
|
|
||||||
#define ARR_TIM3 0x2CF
|
|
||||||
#define PSC_TIM3 0x0
|
|
||||||
|
|
||||||
volatile int g_tick_count;
|
|
||||||
void Test(void){
|
|
||||||
// Signal
|
|
||||||
g_tick_count++;
|
|
||||||
MyGPIO_Toggle(GPIOA, 8);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ConfigureTimers(){
|
|
||||||
MyTimer_Base_Init(TIM2, ARR_TIM2, PSC_TIM2);
|
|
||||||
MyTimer_Base_Init(TIM1, ARR_TIM1, PSC_TIM1);
|
|
||||||
MyTimer_Base_Init(TIM3, ARR_TIM2, PSC_TIM2);
|
|
||||||
EnableTimer(TIM1);
|
|
||||||
EnableTimer(TIM2);
|
|
||||||
EnableTimer(TIM3);
|
|
||||||
}
|
|
||||||
void ConfigureIT(){
|
|
||||||
//MyTimer_ActiveIT(TIM2, 4, Test); //start interruption with priority 4
|
|
||||||
//MyTimer_ActiveIT(TIM1, 4, Test); //start interruption with priority 4
|
|
||||||
MyTimer_ActiveIT(TIM3, 4, Test); //start interruption with priority 4
|
|
||||||
}
|
|
||||||
void ConfigurePWM(){
|
|
||||||
MyTimer_PWM(TIM1, 1);
|
|
||||||
MyTimer_Set_DutyCycle(TIM1, 1, 20.0);
|
|
||||||
}
|
|
||||||
Binary file not shown.
|
|
@ -10,71 +10,71 @@
|
||||||
#define AltOut_OD 0xF
|
#define AltOut_OD 0xF
|
||||||
|
|
||||||
void MyGPIO_Init(GPIO_TypeDef * GPIO, char pin, char conf ){
|
void MyGPIO_Init(GPIO_TypeDef * GPIO, char pin, char conf ){
|
||||||
int shift_pin;
|
int shift_pin;
|
||||||
//Start clock
|
//Start clock
|
||||||
if(GPIO == GPIOA){
|
if(GPIO == GPIOA){
|
||||||
RCC -> APB2ENR |= RCC_APB2ENR_IOPAEN;
|
RCC -> APB2ENR |= RCC_APB2ENR_IOPAEN;
|
||||||
}
|
}
|
||||||
else if(GPIO == GPIOB){
|
else if(GPIO == GPIOB){
|
||||||
RCC -> APB2ENR |= RCC_APB2ENR_IOPBEN;
|
RCC -> APB2ENR |= RCC_APB2ENR_IOPBEN;
|
||||||
}
|
}
|
||||||
else if(GPIO == GPIOC){
|
else if(GPIO == GPIOC){
|
||||||
RCC -> APB2ENR |= RCC_APB2ENR_IOPCEN;
|
RCC -> APB2ENR |= RCC_APB2ENR_IOPCEN;
|
||||||
}
|
}
|
||||||
else if(GPIO == GPIOD){
|
else if(GPIO == GPIOD){
|
||||||
RCC -> APB2ENR |= RCC_APB2ENR_IOPDEN;
|
RCC -> APB2ENR |= RCC_APB2ENR_IOPDEN;
|
||||||
}
|
}
|
||||||
if(pin < 8){//CRL zone
|
if(pin < 8){//CRL zone
|
||||||
shift_pin = pin*4;
|
shift_pin = pin*4;
|
||||||
GPIO -> CRL &= ~(0xF << shift_pin);
|
GPIO -> CRL &= ~(0xF << shift_pin);
|
||||||
//PullUp and PullDown have the same conf number, so we need to change the ODR to diferenciate them both
|
//PullUp and PullDown have the same conf number, so we need to change the ODR to diferenciate them both
|
||||||
if(conf == In_PullUp){
|
if(conf == In_PullUp){
|
||||||
GPIO -> CRL |= ( In_PullUp << shift_pin);
|
GPIO -> CRL |= ( In_PullUp << shift_pin);
|
||||||
GPIO -> ODR |= (1<<pin);
|
GPIO -> ODR |= (1<<pin);
|
||||||
}
|
}
|
||||||
else if(conf == In_PullDown){
|
else if(conf == In_PullDown){
|
||||||
GPIO -> CRL |= ( In_PullDown << shift_pin);
|
GPIO -> CRL |= ( In_PullDown << shift_pin);
|
||||||
GPIO -> ODR &= ~(1<<pin);
|
GPIO -> ODR &= ~(1<<pin);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
GPIO -> CRL |= ( conf << shift_pin);
|
GPIO -> CRL |= ( conf << shift_pin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{//CRH zone
|
else{//CRH zone
|
||||||
shift_pin = (pin-8)*4;
|
shift_pin = (pin-8)*4;
|
||||||
GPIO -> CRH &= ~(0xF << shift_pin);
|
GPIO -> CRH &= ~(0xF << shift_pin);
|
||||||
if(conf == In_PullUp){
|
if(conf == In_PullUp){
|
||||||
GPIO -> CRH |= ( In_PullUp << shift_pin);
|
GPIO -> CRH |= ( In_PullUp << shift_pin);
|
||||||
GPIO -> ODR |= (1<<pin);
|
GPIO -> ODR |= (1<<pin);
|
||||||
}
|
}
|
||||||
else if(conf == In_PullDown){
|
else if(conf == In_PullDown){
|
||||||
GPIO -> CRH |= ( In_PullDown << shift_pin);
|
GPIO -> CRH |= ( In_PullDown << shift_pin);
|
||||||
GPIO -> ODR &= ~(1<<pin);
|
GPIO -> ODR &= ~(1<<pin);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
GPIO -> CRH |= ( conf << shift_pin);
|
GPIO -> CRH |= ( conf << shift_pin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int MyGPIO_Read(GPIO_TypeDef * GPIO, char GPIO_Pin){
|
int MyGPIO_Read(GPIO_TypeDef * GPIO, char GPIO_Pin){
|
||||||
if(GPIO -> IDR & (1 << GPIO_Pin)){
|
if(GPIO -> IDR & (1 << GPIO_Pin)){
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void MyGPIO_Set(GPIO_TypeDef * GPIO, char GPIO_Pin){
|
void MyGPIO_Set(GPIO_TypeDef * GPIO, char GPIO_Pin){
|
||||||
GPIO -> BSRR = (1<<GPIO_Pin);//1 on set zone
|
GPIO -> BSRR = (1<<GPIO_Pin);//1 on set zone
|
||||||
}
|
}
|
||||||
void MyGPIO_Reset(GPIO_TypeDef * GPIO, char GPIO_Pin){
|
void MyGPIO_Reset(GPIO_TypeDef * GPIO, char GPIO_Pin){
|
||||||
GPIO -> BSRR = (1<<(GPIO_Pin+16));//1 on reset zone
|
GPIO -> BSRR = (1<<(GPIO_Pin+16));//1 on reset zone
|
||||||
}
|
}
|
||||||
void MyGPIO_Toggle(GPIO_TypeDef * GPIO, char GPIO_Pin){
|
void MyGPIO_Toggle(GPIO_TypeDef * GPIO, char GPIO_Pin){
|
||||||
if((GPIO-> ODR & (1<<GPIO_Pin)) != 0){
|
if((GPIO-> ODR & (1<<GPIO_Pin)) != 0){
|
||||||
GPIO -> BSRR = (1<<(GPIO_Pin+16));
|
GPIO -> BSRR = (1<<(GPIO_Pin+16));
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
GPIO -> BSRR = (1<<GPIO_Pin);
|
GPIO -> BSRR = (1<<GPIO_Pin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,19 +6,19 @@ int ChercherEtat(GPIO_TypeDef * GPIO, int pin){ // Trouvons la valeur d'un broch
|
||||||
return((GPIO -> IDR & (0x01 << pin)));
|
return((GPIO -> IDR & (0x01 << pin)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ResetBroche(uint32_t GPIO, int Broche){ // Mettre à zero d'un certain broche d'un certain GPIO
|
void ResetBroche(GPIO_TypeDef * GPIO, int Broche){ // Mettre à zero d'un certain broche d'un certain GPIO
|
||||||
GPIO -> BSRR |= BSBroche;
|
GPIO -> BSRR |= BS Broche;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetBroche(uint32_t GPIO, int Broche){ // Mettre à zero d'un certain broche d'un certain GPIO
|
void SetBroche(uint32_t * GPIO, int Broche){ // Mettre à zero d'un certain broche d'un certain GPIO
|
||||||
GPIO -> BSRR |= BSBroche << 16;
|
GPIO -> BSRR |= BSBroche << 16;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TogglePin(GPIO_TypeDef*GPIO, int Broche){ // Inverser la valueur de broche sur GPIO
|
void TogglePin(GPIO_TypeDef * GPIO, int Broche){ // Inverser la valueur de broche sur GPIO
|
||||||
GPIO -> ODR = GPIO -> ODR ^ (0x1 << Broche);
|
GPIO -> ODR = GPIO -> ODR ^ (0x1 << Broche);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigureGPIO(uint32_t GPIO, int Broche, int IO, char Mode){ // Mettre un broche d'un GPIO sur un mode
|
void ConfigureGPIO(uint32_t * GPIO, int Broche, int IO, char * Mode){ // Mettre un broche d'un GPIO sur un mode
|
||||||
// Possble de améliorer avec des int à la place de string
|
// Possble de améliorer avec des int à la place de string
|
||||||
//Start clock pour les GPIO concernés
|
//Start clock pour les GPIO concernés
|
||||||
if(GPIO == GPIOA){
|
if(GPIO == GPIOA){
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
#include "stm32f10x.h"
|
#include "stm32f10x.h"
|
||||||
#include "../Include/Timer.h"
|
#include "../Include/Timer.h"
|
||||||
#include "../Include/PWM.h"
|
#include "../Include/PWM.h"
|
||||||
#include "../Include/GPIO.h"
|
#include "../Include/DriverGPIO.h"
|
||||||
// Variables
|
// Variables
|
||||||
#define ARR_TIM1 0xFFAD
|
#define ARR_TIM1 0xFFAD
|
||||||
#define PSC_TIM1 0xFF
|
#define PSC_TIM1 0xFF
|
||||||
|
|
@ -14,13 +14,16 @@ volatile int g_tick_count;
|
||||||
void Test(void){
|
void Test(void){
|
||||||
// Signal
|
// Signal
|
||||||
g_tick_count++;
|
g_tick_count++;
|
||||||
TogglePin(GPIOA, 8);
|
MyGPIO_Toggle(GPIOA, 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigureTimers(){
|
void ConfigureTimers(){
|
||||||
MyTimer_Base_Init(TIM2, ARR_TIM2, PSC_TIM2);
|
MyTimer_Base_Init(TIM2, ARR_TIM2, PSC_TIM2);
|
||||||
MyTimer_Base_Init(TIM1, ARR_TIM1, PSC_TIM1);
|
MyTimer_Base_Init(TIM1, ARR_TIM1, PSC_TIM1);
|
||||||
MyTimer_Base_Init(TIM3, ARR_TIM2, PSC_TIM2);
|
MyTimer_Base_Init(TIM3, ARR_TIM2, PSC_TIM2);
|
||||||
|
EnableTimer(TIM1);
|
||||||
|
EnableTimer(TIM2);
|
||||||
|
EnableTimer(TIM3);
|
||||||
}
|
}
|
||||||
void ConfigureIT(){
|
void ConfigureIT(){
|
||||||
//MyTimer_ActiveIT(TIM2, 4, Test); //start interruption with priority 4
|
//MyTimer_ActiveIT(TIM2, 4, Test); //start interruption with priority 4
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue