CLEON  Version 1
Cloud-Offloaded GPS Receiver
hal_gpio.c File Reference

GPIO configuration. More...

#include "cleon_conf.h"
#include "app_define.h"
#include "sys_define.h"
#include "hal_define.h"
#include "fs_define.h"
Include dependency graph for hal_gpio.c:

Go to the source code of this file.

Functions

void HAL_GPIO_Init (void)
 Initializing GPIO.
 
__interrupt void PORT1_VECTOR_ISR (void)
 

Variables

FATFS Fatfs
 
FIL fileObject
 
char sFilename [50]
 
bool bFLAG_CLEONSampleIntervalConuter
 
bool bFLAG_MicroSDInserted
 
bool bFLAG_USBConnected
 
bool bFLAG_ISLoggingRequested
 
bool bFLAG_IsTimeSynced
 
milliseoncd_time_tick_u uniMillisecondTimeTick
 
seoncd_time_tick_u uniSecondTimeTick
 
unsigned long ulSampleCount
 
unsigned long ulSampleGap
 
unsigned long ulChunkCount
 
unsigned long ulChunkGap
 
unsigned char ucRTCNumberOfSecondCounter
 
unsigned long ulNumberOfCLEONSamplesInAFileCount
 
time_measurement_s stTimeMeasurement [NUMBER_OF_TIME_MEASUREMENT_TEST]
 

Detailed Description

GPIO configuration.

Definition in file hal_gpio.c.

Function Documentation

void HAL_GPIO_Init ( void  )

Initializing GPIO.

Returns
void
Parameters
void

Definition at line 53 of file hal_gpio.c.

Here is the caller graph for this function:

__interrupt void PORT1_VECTOR_ISR ( void  )

Definition at line 79 of file hal_gpio.c.

{
switch(__even_in_range(P1IV,16))
{
case 0: break;
case 2:
// This flag is set only when time has been synchronized
#if TIME_MEASUREMENT == _ENABLE_
// Logging current system time tick
}
#endif
if(ulSampleCount == 1){
__low_power_mode_off_on_exit();
}
}
}
break;
case 4: break;
case 6:
// Mount FatFs moudle
// Create directory
FS_MakeDir("CLEON");
// Change directory
FS_ChangeDir("/CLEON");
if(ulSampleCount == 1){
// Initailize filename
memset(sFilename, 0, sizeof(sFilename));
// File name will start with CLEON's current system time
#if (APP_LOG_TEMP_AND_HUM_SENSORS == _ENABLE_) || (APP_LOG_LIGHT_SENSORS == _ENABLE_)
#else
#endif
// The created file will remain openned until the number of samples defined in 'APP_LOG_SAMPLES_IN_A_FILE' are captured
}
// Micro SD is inserted
// Turn LED1 off if Micro SD is inserted
// Change interrupt edge to low-to-high
}else{
// Micro SD is missing
// Disable logging
// Set number of seconds counter to zero
// Move pointer to the end of file to append
// Flush cached information of a writing file
// Close file
// Unmount file system
FS_Mount(0, NULL);
// Set counter value to zero to start over the logging process
// Turn LED1 on if Micro SD is not inserted
// Change interrupt edge to high-to-low
}
break;
case 8:
// USB is connected
// Change interrupt edge to low-to-high
// Exit low power mode
__low_power_mode_off_on_exit();
}else{
// USB is disconnected
// Change interrupt edge to high-to-low
}
break;
case 10: break;
case 12: break;
case 14: break;
case 16: break;
default: break;
}
}

Variable Documentation

bool bFLAG_CLEONSampleIntervalConuter

Definition at line 33 of file app_log.c.

bool bFLAG_ISLoggingRequested

Definition at line 31 of file app_log.c.

bool bFLAG_IsTimeSynced

Definition at line 23 of file hal_rtc.c.

bool bFLAG_MicroSDInserted

Definition at line 18 of file sys_mmc.c.

bool bFLAG_USBConnected

Definition at line 20 of file sys_usb.c.

FATFS Fatfs

Definition at line 14 of file fs_init.c.

FIL fileObject

Definition at line 15 of file fs_init.c.

char sFilename[50]

Definition at line 25 of file app_log.c.

Definition at line 47 of file hal_rtc.c.

unsigned char ucRTCNumberOfSecondCounter

Definition at line 44 of file hal_rtc.c.

unsigned long ulChunkCount

Definition at line 44 of file app_log.c.

unsigned long ulChunkGap

Definition at line 45 of file app_log.c.

unsigned long ulNumberOfCLEONSamplesInAFileCount

Definition at line 39 of file app_log.c.

unsigned long ulSampleCount

Definition at line 42 of file app_log.c.

unsigned long ulSampleGap

Definition at line 43 of file app_log.c.

milliseoncd_time_tick_u uniMillisecondTimeTick

Definition at line 40 of file hal_rtc.c.

seoncd_time_tick_u uniSecondTimeTick

Definition at line 41 of file hal_rtc.c.