Microchip® Advanced Software Framework

io1_board.c File Reference
#include "asf.h"
#include "io1_board.h"
#include "sd_mmc_spi.h"
#include "debug_conf.h"

Macros

#define BOARD_NAME_TOKEN_COUNT   1
 
#define BOARD_REVISION_NUMBER_TOKEN_COUNT   2
 
#define BOARD_SERIAL_NUMBER_TOKEN_COUNT   3
 
#define EDBG_ADDRESS   0x28;
 EDBG TWI interface address. More...
 
#define EDBG_EXTEN_BOARDS_TOKEN   0xE1;
 Request token of EDBG TWI information interface. More...
 
#define MANUFACTURE_TOKEN_COUNT   0
 
#define SD_FILE_KEY_CIK_CODE   "cik_key"
 
#define SETTING_FILE_PATH   "/settings.ini"
 

Functions

static bool _decode_board_info (uint8_t *buffer)
 
static void _lightsensor_init ()
 intialize light sensor More...
 
static bool _load_setting_from_sd (void)
 
static bool _save_setting_to_sd (void)
 
static void _sd_init (void)
 
io1_board_infoio1_board_get_info ()
 
int io1_board_get_lightvalue ()
 
int io1_board_get_temperature ()
 
bool io1_board_init ()
 
void io1_board_prepare_to_get_info ()
 
void io1_board_reset_cik_value ()
 
bool io1_board_save_cik_value_to_sd (char *pbuf)
 
void io1_board_set_led (bool on)
 
char * LTRIM (char *p)
 Remove leading white-space characters from the string. More...
 
char * RTRIM (char *p)
 Remove trailing white-space characters from the string. More...
 
char * TRIM (char *p)
 Remove both leading and trailing white-space characters from the string. More...
 

Variables

struct adc_module adc_instance
 Support and FAQ: visit Microchip Support More...
 
struct i2c_master_module dev_inst_at30tse75x
 
FATFS fs
 
static io1_board_info g_info
 
const char * sec_type_values []
 

#define BOARD_NAME_TOKEN_COUNT   1

Referenced by _decode_board_info().

#define BOARD_REVISION_NUMBER_TOKEN_COUNT   2

Referenced by _decode_board_info().

#define BOARD_SERIAL_NUMBER_TOKEN_COUNT   3

Referenced by _decode_board_info().

#define EDBG_ADDRESS   0x28;

EDBG TWI interface address.

Referenced by io1_board_get_info().

#define EDBG_EXTEN_BOARDS_TOKEN   0xE1;

Request token of EDBG TWI information interface.

Referenced by io1_board_get_info().

#define MANUFACTURE_TOKEN_COUNT   0

Referenced by _decode_board_info().

#define SD_FILE_KEY_CIK_CODE   "cik_key"
#define SETTING_FILE_PATH   "/settings.ini"

static void _lightsensor_init ( void  )
static

intialize light sensor

References adc_enable(), adc_get_config_defaults(), adc_init(), and adc_instance.

Referenced by io1_board_init().

int io1_board_get_lightvalue ( void  )
int io1_board_get_temperature ( void  )

References at30tse_read_temperature().

Referenced by main().

void io1_board_prepare_to_get_info ( void  )

References adc_instance, and adc_start_conversion().

Referenced by main().

void io1_board_reset_cik_value ( void  )
bool io1_board_save_cik_value_to_sd ( char *  pbuf)
void io1_board_set_led ( bool  on)
char * LTRIM ( char *  p)

Remove leading white-space characters from the string.

Parameters
[in]pthe string to be trimmed
Returns
pointer to the first byte of the trimmed string

References NULL.

Referenced by TRIM().

char * RTRIM ( char *  p)

Remove trailing white-space characters from the string.

Parameters
[in]pthe string to be trimmed
Returns
pointer to the first byte of the trimmed string

References NULL.

Referenced by TRIM().

char * TRIM ( char *  p)

Remove both leading and trailing white-space characters from the string.

Parameters
[in]pthe string to be trimmed
Returns
pointer to the first byte of the trimmed string

References LTRIM(), and RTRIM().

Referenced by _load_setting_from_sd().

struct adc_module adc_instance

Support and FAQ: visit Microchip Support

Support and FAQ: visit Microchip Support

Support and FAQ: visit Microchip Support

[adc_module_inst]

FATFS fs

Referenced by chk_mounted(), f_mount(), and main().

io1_board_info g_info
static

Referenced by io1_board_get_info().

const char* sec_type_values[]
Initial value:
= {
"invalid",
"none",
"wpa_psk",
"wep",
"802.1x"
}