Microchip® Advanced Software Framework

helper.h File Reference

ATmegaRFX RCB board header file.

This file contains definitions and services related to the features of the ATmega256RFR2 Xplained Pro board.

To use this board, define BOARD= ATMEGA256RFR2_XPLAINED_PRO.

Copyright (c) 2013-2018 Microchip Technology Inc. and its subsidiaries.

#include "compiler.h"
#include "conf_board.h"
#include "board.h"
#include "gpio.h"
#include "led.h"

Macros

#define button_id_t   uint32_t
 

Typedefs

typedef enum acc_status_tag acc_status_t
 
typedef enum adc_channel_tag adc_channel_t
 

Enumerations

enum  acc_status_tag {
  ACC_OFF,
  ACC_ON
}
 
enum  adc_channel_tag {
  X_AXIS,
  Y_AXIS,
  Z_AXIS,
  ADC_REF
}
 

Functions

void acc_disable (void)
 disable the Accelerometer More...
 
void acc_init (void)
 Initialize the Accelerometer. More...
 
void adc_init (void)
 Initialize ADC for Accelerometer. More...
 
uint16_t adc_read (adc_channel_t channel)
 Read the ADC for Accelerometer. More...
 
button_id_t button_scan (void)
 Button handling handles the button pressed events. More...
 
void led_ctrl (led_id_t led_no, led_action_t led_setting)
 Control LED status. More...
 
void pulse_latch (void)
 Pulse latch for connected external hardware. More...
 
void read_acc (uint16_t *x, uint16_t *y, uint16_t *z, uint16_t *ref)
 Read the ACC-Sensor Values with low-pass filtering. More...
 
void set_button_pins_for_normal_mode (void)
 Button pins setting for active/normal mode. More...
 
void update_latch_status (void)
 Update the latch status. More...
 

#define button_id_t   uint32_t

Enumerator
ACC_OFF 
ACC_ON 
Enumerator
X_AXIS 
Y_AXIS 
Z_AXIS 
ADC_REF 

void acc_disable ( void  )

disable the Accelerometer

References acc_enable(), and ACC_OFF.

void acc_init ( void  )

Initialize the Accelerometer.

References acc_enable(), ACC_ON, ADC_ref_val, x_axis_val, y_axis_val, and z_axis_val.

Referenced by board_init().

void adc_init ( void  )

Initialize ADC for Accelerometer.

Referenced by board_init().

uint16_t adc_read ( adc_channel_t  channel)

Read the ADC for Accelerometer.

Parameters
channelADC channel to be read
Returns
uint16_t Value read from ADC

Referenced by read_acc().

button_id_t button_scan ( void  )
void led_ctrl ( led_id_t  led_no,
led_action_t  led_setting 
)

Control LED status.

Parameters
[in]led_noLED ID
[in]led_settingLED_ON, LED_OFF, LED_TOGGLE

References latch_status, LED_OFF, LED_ON, LED_TOGGLE, and pulse_latch().

void pulse_latch ( void  )

Pulse latch for connected external hardware.

References LATCH_DATA, LATCH_DATA_DIR, LATCH_PULSE, and latch_status.

Referenced by acc_enable(), board_init(), and led_ctrl().

void read_acc ( uint16_t *  x,
uint16_t *  y,
uint16_t *  z,
uint16_t *  ref 
)

Read the ACC-Sensor Values with low-pass filtering.

Parameters
xX-axis value is read and stored in this parameter
yy-axis value is read and stored in this parameter
zz-axis value is read and stored in this parameter
refref value is read and stored in this parameter

References adc_read(), ADC_REF, ADC_ref_val, X_AXIS, x_axis_val, Y_AXIS, y_axis_val, Z_AXIS, and z_axis_val.

Referenced by acc_read_cb(), and app_task().

void set_button_pins_for_normal_mode ( void  )

Button pins setting for active/normal mode.

References BUTTON_PORT1, BUTTON_PORT1_DIR, BUTTON_PORT2, and BUTTON_PORT2_DIR.

Referenced by board_init().

void update_latch_status ( void  )

Update the latch status.

References latch_status.

Referenced by board_init().