CROSS Technical Documentation User Manual and Technical Doc.
INFN Milano Bicocca
Loading...
Searching...
No Matches
Power_down.c File Reference
#include "tutti_gli_header.h"
#include "RTE_Device.h"
#include "core_cm3.h"

Go to the source code of this file.

Macros

#define power_down_conEINT3
 
#define LPC_CAN   (LPC_CAN1)
 
#define CAN_RD_PORT   (RTE_CAN1_RD_PORT)
 
#define CAN_RD_BIT   (RTE_CAN1_RD_BIT)
 
#define CAN_RD_FUNC   (RTE_CAN1_RD_FUNC)
 
#define CAN_TD_PORT   (RTE_CAN1_TD_PORT)
 
#define CAN_TD_BIT   (RTE_CAN1_TD_BIT)
 
#define CAN_INT_F_Enable   ((CAN_RD_PORT == 0) ? (LPC_GPIOINT->IO0IntEnF |= (1 << CAN_RD_BIT)) : (LPC_GPIOINT->IO2IntEnF |= (1 << CAN_RD_BIT)))
 
#define CAN_INT_F_Disable   ((CAN_RD_PORT == 0) ? (LPC_GPIOINT->IO0IntEnF &= ~(1 << CAN_RD_BIT)) : (LPC_GPIOINT->IO2IntEnF &= ~(1 << CAN_RD_BIT)))
 
#define CAN_INT_Clear   ((CAN_RD_PORT == 0) ? (LPC_GPIOINT->IO0IntClr |= (1 << CAN_RD_BIT)) : (LPC_GPIOINT->IO2IntClr |= (1 << CAN_RD_BIT)))
 
#define CAN_INT_Status   ((CAN_RD_PORT == 0) ? ((LPC_GPIOINT->IO0IntStatF & (1 << CAN_RD_BIT)) != 0) : ((LPC_GPIOINT->IO2IntStatF & (1 << CAN_RD_BIT)) != 0))
 
#define risveglio_di_Paolo
 
#define risveglio_di_gianluigi
 

Functions

void System_init (void)
 
void CANActivity_IRQHandler_mio (void)
 Peripherals Wake-up.
 
void PowerControl_PowerDown (void)
 Power down managing function.
 
void WakeResetCAN (void)
 CAN pins restoring.
 
void EINT3_IRQHandler (void)
 Wake-up managing function.
 

Variables

uint32_t tempo = 0U
 
uint8_t volatile fuffa =0
 
volatile uint32_t can_clock
 
volatile uint32_t POWER_DOWN_TEMPO_ATTESA =0
 Counter to wait for power down, multiple of 10 ms.
 
volatile uint32_t POWER_DOWN_MAX_ATTESA =5000
 upper limit for POWER_DOWN_TEMPO_ATTESA
 
volatile uint32_t POWER_DOWN_ABILITA_CONTEGGIO =0
 Power down couter and anable is set if this variable is true.