Compare commits
49 commits
feature-AD
...
master
Author | SHA1 | Date | |
---|---|---|---|
30fb6e7b75 | |||
d3a8307d90 | |||
7163e05d17 | |||
bea44470ab | |||
7e19976938 | |||
730d0cddd4 | |||
da4f66ed73 | |||
9e9fc9eb4e | |||
e06fea7cc1 | |||
4bf91d54e3 | |||
4d96c1d53e | |||
8e19bd842c | |||
6ac0111519 | |||
6b7db409d8 | |||
791fabf4a2 | |||
b1378c7cac | |||
24491a1b10 | |||
676a21ae66 | |||
9f8d4e08f3 | |||
6fb6599efe | |||
ed00a94bee | |||
f98a22a727 | |||
bf18c62846 | |||
2ed0bbf2c6 | |||
b6bc2334cb | |||
913ea43e8e | |||
f66834b128 | |||
cacec5a10a | |||
79d21ffed0 | |||
810204ad34 | |||
8df17e9e8f | |||
d926eef475 | |||
a631f22759 | |||
aef43a4062 | |||
8a7029b012 | |||
78c82605ae | |||
5de107765d | |||
6687cffd8f | |||
7930acf1ef | |||
27654ac30a | |||
7f879cf7af | |||
30ceea84e7 | |||
a9d0437841 | |||
582dd2b5b7 | |||
f979a89e5f | |||
e8800d0c58 | |||
4b6629eb48 | |||
c404ceeab2 | |||
f22d8aacd9 |
19 changed files with 562 additions and 109 deletions
21
Drivers/Include/Driver_ADC.h
Normal file
21
Drivers/Include/Driver_ADC.h
Normal file
|
@ -0,0 +1,21 @@
|
|||
#ifndef MYADC_H
|
||||
#define MYADC_H
|
||||
|
||||
#include "stm32f10x.h"
|
||||
#include "Driver_GPIO.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
ADC_TypeDef * ADC;
|
||||
char Channel;
|
||||
} MyADC_Struct_TypeDef;
|
||||
|
||||
|
||||
void MyADC_Base_Init(MyADC_Struct_TypeDef * ADC);
|
||||
void MyADC_Base_Start(ADC_TypeDef * ADC);
|
||||
void MyADC_Base_Stop(ADC_TypeDef * ADC);
|
||||
void MyADC_Base_Interuption(ADC_TypeDef * ADC);
|
||||
int MyADC_Base_Result (MyADC_Struct_TypeDef * ADC);
|
||||
void MyADC_Init_Periph (void (*fct)(void));
|
||||
|
||||
#endif
|
|
@ -9,6 +9,7 @@ char GPIO_Pin ; //numero de 0 a 15
|
|||
char GPIO_Conf ; // voir ci dessous
|
||||
} MyGPIO_Struct_TypeDef ;
|
||||
|
||||
#define Out_PullUp 0x01
|
||||
#define In_Floating 0x4
|
||||
#define In_PullDown 0x8
|
||||
#define In_PullUp 0x8
|
||||
|
@ -23,4 +24,5 @@ int MyGPIO_Read ( GPIO_TypeDef * GPIO , char GPIO_Pin ) ; // renvoie 0 ou autre
|
|||
void MyGPIO_Set ( GPIO_TypeDef * GPIO , char GPIO_Pin ) ;
|
||||
void MyGPIO_Reset ( GPIO_TypeDef * GPIO , char GPIO_Pin ) ;
|
||||
void MyGPIO_Toggle ( GPIO_TypeDef * GPIO , char GPIO_Pin ) ;
|
||||
|
||||
#endif
|
||||
|
|
|
@ -14,7 +14,7 @@ typedef struct
|
|||
void MyTimer_Base_Init(MyTimer_Struct_TypeDef * Timer);
|
||||
void MyTimer_Base_Start(TIM_TypeDef * Timer);
|
||||
void MyTimer_Base_Stop(TIM_TypeDef * Timer);
|
||||
|
||||
void MyTimer_PWM( MyTimer_Struct_TypeDef * Timer, uint16_t cycle);
|
||||
|
||||
/*#define MyTimer_Base_Start(Timer)
|
||||
#define MyTimer_Base_Stop(Timer)
|
||||
|
|
22
Drivers/Include/Driver_UART.h
Normal file
22
Drivers/Include/Driver_UART.h
Normal file
|
@ -0,0 +1,22 @@
|
|||
#ifndef MYUART_H
|
||||
#define MYUART_H
|
||||
|
||||
#include "stm32f10x.h"
|
||||
|
||||
typedef struct {
|
||||
USART_TypeDef * UART;
|
||||
unsigned int baudrate;
|
||||
}MyUART_Struct_Typedef;
|
||||
|
||||
void UART_send(char data);
|
||||
char UART_read(char data, MyUART_Struct_Typedef * UART);
|
||||
void UART_init(MyUART_Struct_Typedef * UART);
|
||||
void USART1_IRQHandler(void);
|
||||
void USART2_IRQHandler(void);
|
||||
void USART3_IRQHandler(void);
|
||||
void UART_InitGPIO(MyUART_Struct_Typedef * UART);
|
||||
void UART_interruption (MyUART_Struct_Typedef * UART);
|
||||
|
||||
|
||||
|
||||
#endif
|
60
Drivers/Sources/Driver_ADC.c
Normal file
60
Drivers/Sources/Driver_ADC.c
Normal file
|
@ -0,0 +1,60 @@
|
|||
#include "Driver_ADC.h"
|
||||
#include "Driver_GPIO.h"
|
||||
|
||||
|
||||
void (*PtrfctADC)(void); /* Déclaration du pointeur de fonction ADC pour l'interrupt */
|
||||
|
||||
//---------------------INIT-------------------//
|
||||
void MyADC_Base_Init(MyADC_Struct_TypeDef * ADC){
|
||||
|
||||
MyGPIO_Struct_TypeDef * GPIO_ADC; /* Déclaration du GPIO lié à l'ADC */
|
||||
|
||||
|
||||
RCC->CFGR |= RCC_CFGR_ADCPRE_DIV6; /*Division par 6 de la clock (72MHz) pour l'ADC (12MHz) car clock max ADC : 14MHz */
|
||||
RCC->APB2ENR |= RCC_APB2ENR_ADC1EN; /* Start clock de l'ADC1 */
|
||||
|
||||
GPIO_ADC->GPIO = GPIOC; /* Initialisation du GPIO lié à l'ADC */
|
||||
GPIO_ADC->GPIO_Conf = In_Analog;
|
||||
GPIO_ADC->GPIO_Pin = 0;
|
||||
MyGPIO_Init(GPIO_ADC);
|
||||
|
||||
|
||||
ADC1->SQR1 &= ADC_SQR1_L; /* Fixation du nombre de conversion à 1 */
|
||||
ADC1->SQR3|= ADC->Channel; /* Choix de la voie à convertir */
|
||||
ADC1->CR2 |= ADC_CR2_EXTTRIG; /* Activation du trigger externe */
|
||||
ADC1->CR2 |= ADC_CR2_EXTSEL; /* event externe choisis : SWSTART */
|
||||
|
||||
MyADC_Base_Start(ADC->ADC); /* Sart ADC1 et Horloge ADC1 */
|
||||
|
||||
}
|
||||
|
||||
|
||||
//--------------------START-------------------//
|
||||
void MyADC_Base_Start(ADC_TypeDef * ADC){
|
||||
ADC1->CR2 |= ADC_CR2_ADON;
|
||||
}
|
||||
|
||||
//------------------INTERRUPTION--------------//
|
||||
void MyADC_Base_Interuption(ADC_TypeDef * ADC){
|
||||
/* Activation du trigger externe */
|
||||
ADC->CR1 |= ADC_CR1_EOCIE; /* Interruption de l'ADC autorisée */
|
||||
NVIC->ISER[0] |= (0x1<<ADC1_2_IRQn); /* Interruption active au niveau NVIC */
|
||||
NVIC->IP[ADC1_2_IRQn] |= 1<<4; /* Affectation du niveau de priorité */
|
||||
}
|
||||
|
||||
//--------------------HANDLER-----------------//
|
||||
void ADC1_2_IRQHandler (void) {
|
||||
(*PtrfctADC)(); /* Appel de la fonction pointée par le pointeur fonction ADC */
|
||||
MyADC_Base_Start(ADC1);
|
||||
ADC1->SR &= ~ADC_SR_EOC; /* RAZ du flag de fin de conversion */
|
||||
}
|
||||
|
||||
//--------------------DATA--------------------//
|
||||
int MyADC_Base_Result (MyADC_Struct_TypeDef * ADC){
|
||||
return ADC1->DR & ~((0x0F)<<12); /* Récuperation du résultat de la conversion de l'ADC */
|
||||
}
|
||||
|
||||
//-------------------POINTEUR-----------------//
|
||||
void MyADC_Init_Periph (void (*fct)(void)){
|
||||
PtrfctADC=fct; /* Affectation du pointeur de fonction ADC */
|
||||
}
|
|
@ -2,42 +2,56 @@
|
|||
|
||||
|
||||
//---------------------FONCTION D'INITIALISATION-----------------//
|
||||
void MyGPIO_Init ( MyGPIO_Struct_TypeDef * GPIOStructPtr){
|
||||
void MyGPIO_Init ( MyGPIO_Struct_TypeDef * GPIOStructPtr )
|
||||
{
|
||||
|
||||
//INITIALISATION DE LA CLOCK CORRESPONDANT AU GPIO A, B ou C
|
||||
if (GPIOStructPtr->GPIO == GPIOA) {
|
||||
RCC->APB2ENR |= RCC_APB2ENR_IOPAEN;
|
||||
} else if (GPIOStructPtr->GPIO == GPIOB) {
|
||||
RCC->APB2ENR |= RCC_APB2ENR_IOPBEN;
|
||||
} else if (GPIOStructPtr->GPIO == GPIOC) {
|
||||
RCC->APB2ENR |= RCC_APB2ENR_IOPCEN;
|
||||
} else if (GPIOStructPtr->GPIO == GPIOD) {
|
||||
RCC->APB2ENR |= RCC_APB2ENR_IOPDEN;
|
||||
/* Activation de la clock liée au GPIO sélectionné */
|
||||
if (GPIOStructPtr->GPIO == GPIOA)
|
||||
{
|
||||
RCC->APB2ENR |= RCC_APB2ENR_IOPAEN;
|
||||
}
|
||||
else if (GPIOStructPtr->GPIO == GPIOB)
|
||||
{
|
||||
RCC->APB2ENR |= RCC_APB2ENR_IOPBEN;
|
||||
}
|
||||
else if (GPIOStructPtr->GPIO == GPIOC)
|
||||
{
|
||||
RCC->APB2ENR |= RCC_APB2ENR_IOPCEN;
|
||||
}
|
||||
else if (GPIOStructPtr->GPIO == GPIOD)
|
||||
{
|
||||
RCC->APB2ENR |= RCC_APB2ENR_IOPDEN;
|
||||
}
|
||||
|
||||
|
||||
/* Reset & configuration de la pin avec le mode adéquat */
|
||||
if(GPIOStructPtr->GPIO_Pin <= 8)
|
||||
{
|
||||
GPIOStructPtr->GPIO->CRL &= ~0xF<<(4*(GPIOStructPtr->GPIO_Pin));
|
||||
GPIOStructPtr->GPIO->CRL |= (GPIOStructPtr->GPIO_Conf)<<(4*(GPIOStructPtr->GPIO_Pin));
|
||||
}
|
||||
else
|
||||
{
|
||||
GPIOStructPtr->GPIO->CRH &= ~0xF<<(4*((GPIOStructPtr->GPIO_Pin)%8));
|
||||
GPIOStructPtr->GPIO->CRH |= (GPIOStructPtr->GPIO_Conf)<<(4*((GPIOStructPtr->GPIO_Pin)%8));
|
||||
}
|
||||
|
||||
//CONFIGURATION DE LA PIN UTILISEE (voir table20 p9.1)
|
||||
if(GPIOStructPtr->GPIO_Pin < 8){
|
||||
GPIOStructPtr->GPIO->CRL &= ~(0xF << (4 * GPIOStructPtr->GPIO_Pin));
|
||||
GPIOStructPtr->GPIO->CRL |= (GPIOStructPtr->GPIO_Conf << (4 * GPIOStructPtr->GPIO_Pin));
|
||||
/* Ecriture de l'ODR pour choisir entre pulldown & pushpull*/
|
||||
if(GPIOStructPtr->GPIO_Conf == (char)In_PullDown)
|
||||
{
|
||||
GPIOStructPtr->GPIO->ODR &= ~(0x1<<(GPIOStructPtr->GPIO_Pin));
|
||||
}
|
||||
else {
|
||||
GPIOStructPtr->GPIO->CRH &= ~(0xF << (4 * GPIOStructPtr->GPIO_Pin - 8));
|
||||
GPIOStructPtr->GPIO->CRH |= (GPIOStructPtr->GPIO_Conf << (4 * GPIOStructPtr->GPIO_Pin - 8));
|
||||
}
|
||||
|
||||
//CONFIGURATION DE L'ODR EN ENTREE (pull up et down uniquement)
|
||||
if(GPIOStructPtr->GPIO_Conf == In_PullUp){
|
||||
GPIOStructPtr->GPIO->ODR = 0x1;
|
||||
}
|
||||
else if(GPIOStructPtr->GPIO_Conf == In_PullDown){
|
||||
GPIOStructPtr->GPIO->ODR = 0x0;
|
||||
else if(GPIOStructPtr->GPIO_Conf == (char)In_PullUp)
|
||||
{
|
||||
GPIOStructPtr->GPIO->ODR |= 0x1<<(GPIOStructPtr->GPIO_Pin);
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------READ--------------------------//
|
||||
int MyGPIO_Read ( GPIO_TypeDef * GPIO , char GPIO_Pin ){
|
||||
int etatbit;
|
||||
//On vérifie si la valeur lue dans l'IDR est un 0 ou un 1
|
||||
|
||||
/* Verification de la valeur de l'IDR */
|
||||
if((GPIO->IDR & (1<<GPIO_Pin))!=0){
|
||||
etatbit = 1;
|
||||
}
|
||||
|
@ -49,16 +63,20 @@ int MyGPIO_Read ( GPIO_TypeDef * GPIO , char GPIO_Pin ){
|
|||
|
||||
//---------------------SET-------------------//
|
||||
void MyGPIO_Set ( GPIO_TypeDef * GPIO , char GPIO_Pin ){
|
||||
|
||||
/*Ecriture du 1 sur le numéro de la pin dans le registre BSRR*/
|
||||
GPIO->BSRR |= (1 << GPIO_Pin);
|
||||
}
|
||||
|
||||
//---------------------RESET-----------------//
|
||||
void MyGPIO_Reset ( GPIO_TypeDef * GPIO , char GPIO_Pin ){
|
||||
|
||||
/*Ecriture du 1 sur le numéro de la pin dans le registre BRR*/
|
||||
GPIO->BRR = (1 << GPIO_Pin);
|
||||
//Pas besoin de | puisque les 0 n'impactent pas la fonction reset
|
||||
}
|
||||
|
||||
//---------------------TOGGLE-----------------//
|
||||
void MyGPIO_Toggle ( GPIO_TypeDef * GPIO , char GPIO_Pin ){
|
||||
GPIO->ODR ^= (1 << GPIO_Pin);
|
||||
}
|
||||
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
//-----------------------INITIALISATION TIMER---------------------//
|
||||
void MyTimer_Base_Init(MyTimer_Struct_TypeDef * Timer){
|
||||
|
||||
/* Activation de la clock liée au TIMER sélectionné */
|
||||
if(Timer->Timer == TIM1){
|
||||
//RCC->APB2ENR |= 0x0001<<11;
|
||||
RCC->APB2ENR |= RCC_APB2ENR_TIM1EN;
|
||||
|
@ -19,6 +21,7 @@ void MyTimer_Base_Init(MyTimer_Struct_TypeDef * Timer){
|
|||
RCC->APB1ENR |= RCC_APB1ENR_TIM4EN;
|
||||
}
|
||||
|
||||
/* Load des valeurs de l'ARR et du PSC pour définir la période de comptage du TIMER et sa limite*/
|
||||
Timer->Timer->ARR = Timer->ARR;
|
||||
Timer->Timer->PSC = Timer->PSC;
|
||||
|
||||
|
@ -27,12 +30,21 @@ void MyTimer_Base_Init(MyTimer_Struct_TypeDef * Timer){
|
|||
|
||||
//-----------------------START----------------------//
|
||||
void MyTimer_Base_Start(TIM_TypeDef * Timer){
|
||||
Timer->CR1 |= TIM_CR1_CEN; //Masque OU pour placer un 1 décalé avec des 0
|
||||
Timer->CR1 |= TIM_CR1_CEN; //* Masque OU pour placer un 1 décalé avec des 0 */
|
||||
}
|
||||
|
||||
//------------------------STOP----------------------//
|
||||
void MyTimer_Base_Stop(TIM_TypeDef * Timer){
|
||||
Timer->CR1 |= ~TIM_CR1_CEN; //Masque ET pour placer un 0 décalé avec des 1 (~)
|
||||
Timer->CR1 |= ~TIM_CR1_CEN; /* Masque ET pour placer un 0 décalé avec des 1 (~) */
|
||||
}
|
||||
|
||||
|
||||
void MyTimer_PWM( MyTimer_Struct_TypeDef * Timer, uint16_t cycle){
|
||||
|
||||
Timer->Timer->CCMR1 &= ~TIM_CCMR1_OC1M_0; /* Configuration du canal CH1 */
|
||||
Timer->Timer->CCMR1 |= TIM_CCMR1_OC1M_1| TIM_CCMR1_OC1M_2; /* Ajouter 110 aux bits OC1M (registre CCMR1) */
|
||||
|
||||
Timer->Timer->CCER |= TIM_CCER_CC1E; /* Canal CH1 validé par bit CC1E (registre CCER) */
|
||||
Timer->Timer->CR1 |= TIM_CR1_CEN; /* Lancement du timer */
|
||||
Timer->Timer->CCR1 = (cycle * Timer->ARR) / 100; /* Fixer la durée à 20% */
|
||||
}
|
||||
|
|
143
Drivers/Sources/Driver_UART.c
Normal file
143
Drivers/Sources/Driver_UART.c
Normal file
|
@ -0,0 +1,143 @@
|
|||
#include "Driver_UART.h"
|
||||
#include "Driver_GPIO.h"
|
||||
|
||||
|
||||
char received_data1, received_data2, received_data3;
|
||||
|
||||
void UART_init(MyUART_Struct_Typedef * UART)
|
||||
{
|
||||
if(UART->UART ==USART1)
|
||||
RCC->APB2ENR |= RCC_APB2ENR_USART1EN;
|
||||
else if(UART->UART ==USART2)
|
||||
RCC->APB1ENR |= RCC_APB1ENR_USART2EN;
|
||||
else if(UART->UART ==USART3)
|
||||
RCC->APB1ENR |= RCC_APB1ENR_USART3EN;
|
||||
|
||||
|
||||
RCC->APB2ENR |= RCC_APB2ENR_USART1EN; // Validation horloge USART1
|
||||
USART1->CR1 |= USART_CR1_UE; // Activer l'USART
|
||||
USART1->CR1 &= ~USART_CR1_M; // Choisir la taille 8bits de donnée
|
||||
USART1->CR2 |= USART_CR2_STOP; // 1 seul bit de stop
|
||||
//USART1->BRR |= 468 << 4; // Fixe le baud rate à 9600bps partie entière
|
||||
//USART1->BRR |= 75; // Fixe le baud rate à 9600bps partie fractionnaire
|
||||
UART->UART->BRR = 72000000/(UART->baudrate);
|
||||
USART1->CR1 |= USART_CR1_TE; // Autoriser la transmission
|
||||
USART1->CR1 |= USART_CR1_RE; // Activer la réception
|
||||
// USART1->CR1 |= USART_CR1_TCIE; // Activer l'interruption de transmission
|
||||
USART1->CR1 |= USART_CR1_RXNEIE; // Activer l'interruption de réception
|
||||
UART_interruption(UART);
|
||||
|
||||
}
|
||||
|
||||
void UART_send(char data)
|
||||
{
|
||||
while(!(USART1->SR & USART_SR_TXE) | !(USART2->SR & USART_SR_TXE)){} //Attendre l'autorisation de transmission
|
||||
USART1->DR |= data;
|
||||
while(!(USART1->SR & USART_SR_TC) | !(USART2->SR & USART_SR_TC)){} //Attendre la fin de transmission
|
||||
}
|
||||
|
||||
char UART_read(char data, MyUART_Struct_Typedef * UART)
|
||||
{
|
||||
if(UART->UART == USART1)
|
||||
return received_data1;
|
||||
else if (UART->UART == USART2)
|
||||
return received_data2;
|
||||
else if (UART->UART == USART3)
|
||||
return received_data3;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void USART1_IRQHandler(void)
|
||||
{
|
||||
if (USART1->SR & USART_SR_RXNE) // si une donnée a été reçue
|
||||
{
|
||||
received_data1 = USART1->DR; // lire la donnée reçue
|
||||
}
|
||||
|
||||
if (USART1->SR & USART_SR_TC) // si la transmission est terminée
|
||||
{
|
||||
USART1->SR &= ~USART_SR_TC; // effacer le bit de transmission terminée
|
||||
}
|
||||
}
|
||||
|
||||
void USART2_IRQHandler(void)
|
||||
{
|
||||
if (USART2->SR & USART_SR_RXNE) // si une donnée a été reçue
|
||||
{
|
||||
received_data2 = USART2->DR; // lire la donnée reçue
|
||||
}
|
||||
|
||||
if (USART2->SR & USART_SR_TC) // si la transmission est terminée
|
||||
{
|
||||
USART2->SR &= ~USART_SR_TC; // effacer le bit de transmission terminée
|
||||
}
|
||||
}
|
||||
|
||||
void USART3_IRQHandler(void)
|
||||
{
|
||||
if (USART3->SR & USART_SR_RXNE) // si une donnée a été reçue
|
||||
{
|
||||
received_data3 = USART3->DR; // lire la donnée reçue
|
||||
}
|
||||
|
||||
if (USART3->SR & USART_SR_TC) // si la transmission est terminée
|
||||
{
|
||||
USART3->SR &= ~USART_SR_TC; // effacer le bit de transmission terminée
|
||||
}
|
||||
}
|
||||
|
||||
void UART_interruption (MyUART_Struct_Typedef * UART)
|
||||
{
|
||||
UART->UART->CR1 |= USART_CR1_RXNEIE;
|
||||
|
||||
if (UART->UART==USART1)
|
||||
{
|
||||
NVIC->ISER[1] |= (1<<(USART1_IRQn-32));
|
||||
}
|
||||
if (UART->UART==USART2)
|
||||
{
|
||||
NVIC->ISER[1] |= (1<<(USART2_IRQn-32));
|
||||
}
|
||||
if (UART->UART==USART3)
|
||||
{
|
||||
NVIC->ISER[1] |= (1<<(USART3_IRQn-32));
|
||||
}
|
||||
}
|
||||
|
||||
void UART_InitGPIO(MyUART_Struct_Typedef * UART)
|
||||
{
|
||||
if(UART->UART == USART1)
|
||||
{
|
||||
MyUART_Struct_Typedef UART1 = {USART1,9600};
|
||||
MyGPIO_Struct_TypeDef PA9 = {GPIOA,9,AltOut_Ppull};
|
||||
MyGPIO_Struct_TypeDef PA10 = {GPIOA,10,In_PullUp};
|
||||
MyGPIO_Init (&PA9);
|
||||
MyGPIO_Init (&PA10);
|
||||
UART_init(&UART1);
|
||||
}
|
||||
else if(UART->UART == USART2) {
|
||||
MyUART_Struct_Typedef UART2 = {USART2,9600};
|
||||
MyGPIO_Struct_TypeDef PA2 = {GPIOA,2,AltOut_Ppull};
|
||||
MyGPIO_Struct_TypeDef PA3 = {GPIOA,3,In_Floating};
|
||||
MyGPIO_Init (&PA2);
|
||||
MyGPIO_Init (&PA3);
|
||||
UART_init(&UART2);
|
||||
}
|
||||
else if(UART->UART == USART3) {
|
||||
MyUART_Struct_Typedef UART3 = {USART3,9600};
|
||||
MyGPIO_Struct_TypeDef PA10 = {GPIOA,10,AltOut_Ppull};
|
||||
MyGPIO_Struct_TypeDef PA11 = {GPIOA,11,In_PullUp};
|
||||
MyGPIO_Init (&PA10);
|
||||
MyGPIO_Init (&PA11);
|
||||
UART_init(&UART3);
|
||||
}
|
||||
else {
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
1
Drivers/Voilier_fonction/Girouette.c
Normal file
1
Drivers/Voilier_fonction/Girouette.c
Normal file
|
@ -0,0 +1 @@
|
|||
#include "Driver_Timer.h"
|
42
Drivers/Voilier_fonction/Plateau.c
Normal file
42
Drivers/Voilier_fonction/Plateau.c
Normal file
|
@ -0,0 +1,42 @@
|
|||
#include "Driver_Timer.h"
|
||||
#include "Driver_UART.h"
|
||||
#include "Plateau.h"
|
||||
#include "Driver_GPIO.h"
|
||||
|
||||
|
||||
void Plateau_init(void)
|
||||
{
|
||||
MyTimer_Struct_TypeDef Timer;
|
||||
MyGPIO_Struct_TypeDef Pin_Sens;
|
||||
|
||||
Pin_Sens.GPIO=GPIOB;
|
||||
Pin_Sens.GPIO_Pin=1;
|
||||
Pin_Sens.GPIO_Conf = Out_PullUp;
|
||||
|
||||
//Fréquence
|
||||
Timer.Timer = TIM3;
|
||||
Timer.ARR=3599;
|
||||
Timer.PSC=0;
|
||||
|
||||
|
||||
|
||||
MyTimer_Base_Init(&Timer);
|
||||
MyGPIO_Init(&Pin_Sens);
|
||||
|
||||
MyTimer_PWM(&Timer, 50);
|
||||
|
||||
MyTimer_Base_Start(TIM3);
|
||||
|
||||
Plateau_direction(DROITE);
|
||||
}
|
||||
|
||||
|
||||
void Plateau_direction(uint8_t Sens)
|
||||
{
|
||||
if(Sens == DROITE)
|
||||
MyGPIO_Set(GPIOB,1);
|
||||
if (Sens == GAUCHE)
|
||||
MyGPIO_Reset(GPIOB,1);
|
||||
|
||||
}
|
||||
|
12
Drivers/Voilier_fonction/Plateau.h
Normal file
12
Drivers/Voilier_fonction/Plateau.h
Normal file
|
@ -0,0 +1,12 @@
|
|||
#ifndef MYPLATEAU_H
|
||||
#define MYPLATEAU_H
|
||||
#include "stm32f10x.h"
|
||||
|
||||
#define DROITE 0x1
|
||||
#define GAUCHE 0x0
|
||||
|
||||
|
||||
void Plateau_init(void);
|
||||
void Plateau_direction(uint8_t Sens);
|
||||
|
||||
#endif
|
32
Drivers/Voilier_fonction/telecommande.c
Normal file
32
Drivers/Voilier_fonction/telecommande.c
Normal file
|
@ -0,0 +1,32 @@
|
|||
#include "telecommande.h"
|
||||
#include "Driver_GPIO.h"
|
||||
#include "Plateau.h"
|
||||
|
||||
MyUART_Struct_Typedef UART_plateau = {USART1,9600};
|
||||
|
||||
void init_telecommande(void)
|
||||
{
|
||||
UART_InitGPIO(&UART_plateau);
|
||||
UART_init(&UART_plateau);
|
||||
}
|
||||
|
||||
|
||||
void telecommande_plateau (int data)
|
||||
{
|
||||
int datar;
|
||||
UART_send(data);
|
||||
datar = data;
|
||||
|
||||
if(datar >= 0)
|
||||
Plateau_direction(DROITE);
|
||||
else
|
||||
Plateau_direction(GAUCHE);
|
||||
}
|
||||
void testRemote(void)
|
||||
{
|
||||
UART_send('t');
|
||||
UART_send('e');
|
||||
UART_send('s');
|
||||
UART_send('t');
|
||||
}
|
||||
|
12
Drivers/Voilier_fonction/telecommande.h
Normal file
12
Drivers/Voilier_fonction/telecommande.h
Normal file
|
@ -0,0 +1,12 @@
|
|||
#ifndef TELECOMMANDE_H
|
||||
#define TELECOMMANDE_H
|
||||
#include "Driver_UART.h"
|
||||
#include "stm32f10x.h"
|
||||
|
||||
|
||||
void init_telecommande(void);
|
||||
void telecommande_plateau (int data);
|
||||
void testRemote(void);
|
||||
|
||||
|
||||
#endif
|
|
@ -75,7 +75,7 @@
|
|||
<OPTFL>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<IsCurrentTarget>1</IsCurrentTarget>
|
||||
<IsCurrentTarget>0</IsCurrentTarget>
|
||||
</OPTFL>
|
||||
<CpuCode>18</CpuCode>
|
||||
<DebugOpt>
|
||||
|
@ -125,7 +125,7 @@
|
|||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>DLGDARM</Key>
|
||||
<Name>(1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)(100=-1,-1,-1,-1,0)(110=-1,-1,-1,-1,0)(111=-1,-1,-1,-1,0)(1011=-1,-1,-1,-1,0)(180=-1,-1,-1,-1,0)(120=297,604,718,1031,0)(121=-1,-1,-1,-1,0)(122=546,289,967,716,0)(123=-1,-1,-1,-1,0)(140=-1,-1,-1,-1,0)(240=-1,-1,-1,-1,0)(190=-1,-1,-1,-1,0)(200=-1,-1,-1,-1,0)(170=-1,-1,-1,-1,0)(130=-1,-1,-1,-1,0)(131=997,343,1591,1094,0)(132=-1,-1,-1,-1,0)(133=-1,-1,-1,-1,0)(160=-1,-1,-1,-1,0)(161=-1,-1,-1,-1,0)(162=-1,-1,-1,-1,0)(210=-1,-1,-1,-1,0)(211=-1,-1,-1,-1,0)(220=-1,-1,-1,-1,0)(221=-1,-1,-1,-1,0)(230=-1,-1,-1,-1,0)(234=-1,-1,-1,-1,0)(231=-1,-1,-1,-1,0)(232=-1,-1,-1,-1,0)(233=-1,-1,-1,-1,0)(150=-1,-1,-1,-1,0)(151=-1,-1,-1,-1,0)</Name>
|
||||
<Name>(1010=937,133,1313,690,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)(100=-1,-1,-1,-1,0)(110=-1,-1,-1,-1,0)(111=-1,-1,-1,-1,0)(1011=-1,-1,-1,-1,0)(180=-1,-1,-1,-1,0)(120=1357,482,1778,909,0)(121=1042,189,1463,616,0)(122=546,289,967,716,0)(123=-1,-1,-1,-1,0)(140=-1,-1,-1,-1,0)(240=-1,-1,-1,-1,0)(190=-1,-1,-1,-1,0)(200=-1,-1,-1,-1,0)(170=-1,-1,-1,-1,0)(130=911,135,1505,886,0)(131=997,343,1591,1094,0)(132=-1,-1,-1,-1,0)(133=-1,-1,-1,-1,0)(160=1375,56,1823,470,0)(161=1383,268,1831,682,0)(162=-1,-1,-1,-1,0)(210=-1,-1,-1,-1,0)(211=-1,-1,-1,-1,0)(220=-1,-1,-1,-1,0)(221=-1,-1,-1,-1,0)(230=-1,-1,-1,-1,0)(234=-1,-1,-1,-1,0)(231=-1,-1,-1,-1,0)(232=-1,-1,-1,-1,0)(233=-1,-1,-1,-1,0)(150=240,283,843,1034,0)(151=-1,-1,-1,-1,0)</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
|
@ -150,21 +150,21 @@
|
|||
<DebugFlag>
|
||||
<trace>0</trace>
|
||||
<periodic>1</periodic>
|
||||
<aLwin>1</aLwin>
|
||||
<aLwin>0</aLwin>
|
||||
<aCover>0</aCover>
|
||||
<aSer1>0</aSer1>
|
||||
<aSer1>1</aSer1>
|
||||
<aSer2>0</aSer2>
|
||||
<aPa>0</aPa>
|
||||
<viewmode>1</viewmode>
|
||||
<vrSel>0</vrSel>
|
||||
<aSym>0</aSym>
|
||||
<aTbox>1</aTbox>
|
||||
<aTbox>0</aTbox>
|
||||
<AscS1>0</AscS1>
|
||||
<AscS2>0</AscS2>
|
||||
<AscS3>0</AscS3>
|
||||
<aSer3>0</aSer3>
|
||||
<eProf>0</eProf>
|
||||
<aLa>1</aLa>
|
||||
<aLa>0</aLa>
|
||||
<aPa1>0</aPa1>
|
||||
<AscS4>0</AscS4>
|
||||
<aSer4>0</aSer4>
|
||||
|
@ -193,12 +193,6 @@
|
|||
<SecondString>FF000000000000000000000000000000E0FFEF400100000000000000000000000000000028504F5254412026203078303030303030323029203E3E2035000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000001000000000000000000F03F1700000000000000000000000000000000000000DA040008</SecondString>
|
||||
</Wi>
|
||||
</LogicAnalyzers>
|
||||
<SystemViewers>
|
||||
<Entry>
|
||||
<Name>System Viewer\GPIOA</Name>
|
||||
<WinId>35905</WinId>
|
||||
</Entry>
|
||||
</SystemViewers>
|
||||
<DebugDescription>
|
||||
<Enable>1</Enable>
|
||||
<EnableFlashSeq>0</EnableFlashSeq>
|
||||
|
@ -263,7 +257,7 @@
|
|||
<OPTFL>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<IsCurrentTarget>0</IsCurrentTarget>
|
||||
<IsCurrentTarget>1</IsCurrentTarget>
|
||||
</OPTFL>
|
||||
<CpuCode>18</CpuCode>
|
||||
<DebugOpt>
|
||||
|
@ -343,9 +337,9 @@
|
|||
<DebugFlag>
|
||||
<trace>0</trace>
|
||||
<periodic>1</periodic>
|
||||
<aLwin>1</aLwin>
|
||||
<aLwin>0</aLwin>
|
||||
<aCover>0</aCover>
|
||||
<aSer1>0</aSer1>
|
||||
<aSer1>1</aSer1>
|
||||
<aSer2>0</aSer2>
|
||||
<aPa>0</aPa>
|
||||
<viewmode>1</viewmode>
|
||||
|
@ -422,24 +416,24 @@
|
|||
<File>
|
||||
<GroupNumber>1</GroupNumber>
|
||||
<FileNumber>3</FileNumber>
|
||||
<FileType>5</FileType>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\Drivers\Include\Driver_GPIO.h</PathWithFileName>
|
||||
<FilenameWithoutPath>Driver_GPIO.h</FilenameWithoutPath>
|
||||
<PathWithFileName>..\Drivers\Sources\Driver_UART.c</PathWithFileName>
|
||||
<FilenameWithoutPath>Driver_UART.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>1</GroupNumber>
|
||||
<FileNumber>4</FileNumber>
|
||||
<FileType>5</FileType>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\Drivers\Include\Driver_Timer.h</PathWithFileName>
|
||||
<FilenameWithoutPath>Driver_Timer.h</FilenameWithoutPath>
|
||||
<PathWithFileName>..\Drivers\Sources\Driver_ADC.c</PathWithFileName>
|
||||
<FilenameWithoutPath>Driver_ADC.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
|
@ -447,7 +441,7 @@
|
|||
|
||||
<Group>
|
||||
<GroupName>SRC</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
|
@ -455,7 +449,7 @@
|
|||
<GroupNumber>2</GroupNumber>
|
||||
<FileNumber>5</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>.\Sources\Main.c</PathWithFileName>
|
||||
|
@ -465,6 +459,50 @@
|
|||
</File>
|
||||
</Group>
|
||||
|
||||
<Group>
|
||||
<GroupName>Voilier_fonction</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
<File>
|
||||
<GroupNumber>3</GroupNumber>
|
||||
<FileNumber>6</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\Drivers\Voilier_fonction\telecommande.c</PathWithFileName>
|
||||
<FilenameWithoutPath>telecommande.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>3</GroupNumber>
|
||||
<FileNumber>7</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\Drivers\Voilier_fonction\Girouette.c</PathWithFileName>
|
||||
<FilenameWithoutPath>Girouette.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>3</GroupNumber>
|
||||
<FileNumber>8</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\Drivers\Voilier_fonction\Plateau.c</PathWithFileName>
|
||||
<FilenameWithoutPath>Plateau.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
</Group>
|
||||
|
||||
<Group>
|
||||
<GroupName>::CMSIS</GroupName>
|
||||
<tvExp>0</tvExp>
|
||||
|
@ -475,7 +513,7 @@
|
|||
|
||||
<Group>
|
||||
<GroupName>::Device</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>1</RteFlg>
|
||||
|
|
|
@ -339,7 +339,7 @@
|
|||
<MiscControls></MiscControls>
|
||||
<Define></Define>
|
||||
<Undefine></Undefine>
|
||||
<IncludePath>..\Drivers\Include</IncludePath>
|
||||
<IncludePath>..\Drivers\Include;..\Drivers\Voilier_fonction;..\Drivers\Sources</IncludePath>
|
||||
</VariousControls>
|
||||
</Cads>
|
||||
<Aads>
|
||||
|
@ -394,14 +394,14 @@
|
|||
<FilePath>..\Drivers\Sources\Driver_Timer.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>Driver_GPIO.h</FileName>
|
||||
<FileType>5</FileType>
|
||||
<FilePath>..\Drivers\Include\Driver_GPIO.h</FilePath>
|
||||
<FileName>Driver_UART.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\Drivers\Sources\Driver_UART.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>Driver_Timer.h</FileName>
|
||||
<FileType>5</FileType>
|
||||
<FilePath>..\Drivers\Include\Driver_Timer.h</FilePath>
|
||||
<FileName>Driver_ADC.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\Drivers\Sources\Driver_ADC.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
|
@ -415,6 +415,26 @@
|
|||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>Voilier_fonction</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>telecommande.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\Drivers\Voilier_fonction\telecommande.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>Girouette.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\Drivers\Voilier_fonction\Girouette.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>Plateau.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\Drivers\Voilier_fonction\Plateau.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>::CMSIS</GroupName>
|
||||
</Group>
|
||||
|
@ -756,7 +776,7 @@
|
|||
<MiscControls></MiscControls>
|
||||
<Define></Define>
|
||||
<Undefine></Undefine>
|
||||
<IncludePath>..\Drivers\Include</IncludePath>
|
||||
<IncludePath>..\Drivers\Include;..\Drivers\Voilier_fonction</IncludePath>
|
||||
</VariousControls>
|
||||
</Cads>
|
||||
<Aads>
|
||||
|
@ -811,14 +831,14 @@
|
|||
<FilePath>..\Drivers\Sources\Driver_Timer.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>Driver_GPIO.h</FileName>
|
||||
<FileType>5</FileType>
|
||||
<FilePath>..\Drivers\Include\Driver_GPIO.h</FilePath>
|
||||
<FileName>Driver_UART.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\Drivers\Sources\Driver_UART.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>Driver_Timer.h</FileName>
|
||||
<FileType>5</FileType>
|
||||
<FilePath>..\Drivers\Include\Driver_Timer.h</FilePath>
|
||||
<FileName>Driver_ADC.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\Drivers\Sources\Driver_ADC.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
|
@ -832,6 +852,26 @@
|
|||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>Voilier_fonction</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>telecommande.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\Drivers\Voilier_fonction\telecommande.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>Girouette.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\Drivers\Voilier_fonction\Girouette.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>Plateau.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\Drivers\Voilier_fonction\Plateau.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>::CMSIS</GroupName>
|
||||
</Group>
|
||||
|
|
|
@ -1,54 +1,33 @@
|
|||
#include "Driver_GPIO.h"
|
||||
#include "Driver_Timer.h"
|
||||
#include "Driver_UART.h"
|
||||
#include "Driver_ADC.h"
|
||||
#include "Plateau.h"
|
||||
#include "telecommande.h"
|
||||
|
||||
|
||||
|
||||
int main (void){
|
||||
//Déclaration d'une LED et d'un BP par structure GPIO
|
||||
MyGPIO_Struct_TypeDef LED;
|
||||
MyGPIO_Struct_TypeDef BP;
|
||||
//Déclaration d'un Timer 500 ms
|
||||
MyTimer_Struct_TypeDef TIM500ms;
|
||||
//Config LED PA5
|
||||
LED.GPIO_Conf = Out_Ppull;
|
||||
LED.GPIO_Pin = 5;
|
||||
LED.GPIO = GPIOA;
|
||||
MyGPIO_Init (&LED) ;
|
||||
//Config BP PC13
|
||||
BP.GPIO_Conf = In_Floating;
|
||||
BP.GPIO_Pin = 13;
|
||||
BP.GPIO = GPIOC;
|
||||
//Init BP & LED
|
||||
MyGPIO_Init (&LED);
|
||||
MyGPIO_Init (&BP);
|
||||
//Init Timer 2 et Test
|
||||
TIM500ms.Timer = TIM2;
|
||||
TIM500ms.PSC = 0xD2F0; // =0.5ms(calculé à partir de la fréquence du micro)
|
||||
TIM500ms.ARR = 1000;
|
||||
MyTimer_Base_Init(&TIM500ms);
|
||||
|
||||
MyGPIO_Struct_TypeDef * GPIO;
|
||||
|
||||
//init_telecommande();
|
||||
//Plateau_init();
|
||||
//Plateau_direction(DROITE);
|
||||
|
||||
|
||||
TIM2->DIER |= 1<< 0 ; //INTERRUPTION PERIPH
|
||||
//TIM2->DIER |= TIM_DIER_UIE ;
|
||||
NVIC->ISER[0] |= 1<<TIM2_IRQn ; //INTERRUPTION COEUR
|
||||
NVIC->IP[TIM2_IRQn] = 2<< 4 ;
|
||||
|
||||
MyTimer_Base_Start(TIM500ms.Timer);
|
||||
//Boucle infinie de la réponse de la LED à l'état BP
|
||||
|
||||
//testRemote();
|
||||
MyGPIO_Init(GPIO);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
while(1){
|
||||
// if (MyGPIO_Read(BP.GPIO,BP.GPIO_Pin)==0){
|
||||
// MyGPIO_Set(LED.GPIO,LED.GPIO_Pin);
|
||||
// }else{
|
||||
// MyGPIO_Reset(LED.GPIO,LED.GPIO_Pin);
|
||||
// }
|
||||
|
||||
MyGPIO_Set(GPIOA,3);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void TIM2_IRQHandler (void)
|
||||
{
|
||||
MyGPIO_Toggle(GPIOA,5);
|
||||
TIM2->SR &= ~(1<<0);
|
||||
}
|
||||
|
|
19
README.md
Normal file
19
README.md
Normal file
|
@ -0,0 +1,19 @@
|
|||
# Projet Voilier
|
||||
## Equipe 4
|
||||
* Clement MARCE
|
||||
* Louis ROUSSET
|
||||
* Cedric CHANFREAU
|
||||
|
||||
## Réalisation des drivers :
|
||||
* [GPIOS](https://git.etud.insa-toulouse.fr/marce/Voilier/src/branch/master/Drivers/Sources/Driver_GPIO.c) //Done
|
||||
* [TIMERS](https://git.etud.insa-toulouse.fr/marce/Voilier/src/branch/master/Drivers/Sources/Driver_Timer.c) //Done
|
||||
* [PWM](https://git.etud.insa-toulouse.fr/marce/Voilier/src/branch/master/Drivers/Sources/Driver_Timer.c) //Done (Cédric)
|
||||
* [ADC](https://git.etud.insa-toulouse.fr/marce/Voilier/src/branch/master/Drivers/Sources/Driver_ADC.c) //Done (Clement+Louis)
|
||||
* [UART](https://git.etud.insa-toulouse.fr/marce/Voilier/src/branch/master/Drivers/Sources/Driver_UART.c) //Done (Cédric)
|
||||
|
||||
## Réalisation des différentes fonctions du bateau :
|
||||
* [Girouette](https://git.etud.insa-toulouse.fr/marce/Voilier/src/branch/master/Drivers/Voilier_fonction/Girouette.c) //Work in progress (Clement)
|
||||
* [Plateau](https://git.etud.insa-toulouse.fr/marce/Voilier/src/branch/master/Drivers/Voilier_fonction/Plateau.c) //Need to test (Cédric)
|
||||
|
||||
|
||||
! : Rousset Louis a été absent à 3séances de TP sur les 6 prévues, ce qui a causé du retard à l'équipe.
|
BIN
README_picture/APB2ENR.png
Normal file
BIN
README_picture/APB2ENR.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
BIN
README_picture/Thumbs.db
Normal file
BIN
README_picture/Thumbs.db
Normal file
Binary file not shown.
Loading…
Reference in a new issue