uTrack
Loading...
Searching...
No Matches
Data Structures | Macros | Enumerations | Functions
utRadio.c File Reference

Software module to control the power on and set up of a UHF radio that can be attached to u_Track. More...

#include "utTypes.h"
#include "utHAL.h"
#include "utRadio.h"
#include "stdlib.h"

Data Structures

struct  utRadioCommandStruct
 

Macros

#define UHF_RX_BUFFER_SIZE   80
 
#define UHF_TX_BUFFER_SIZE   80
 
#define BANNER_TIMEOUT   25.0f
 
#define SOFT_RESET_MAX_RETRIES   5
 
#define HARD_RESET_MAX_RETRIES   5
 
#define RESTART_DELAY   5
 
#define CLEAR_TIME   500
 
#define POWER_OFF_DELAY   5000
 

Enumerations

enum  UT_UHF_STATE {
  UT_UHF_OFF , UT_UHF_TURN_ON , UT_UHF_STARTING_UP , UT_UHF_COMMAND_MODE ,
  UT_UHF_DATA_MODE , UT_UHF_RESTART
}
 
enum  UT_UHF_RESTART_STATE {
  UT_UHF_RESTART_NONE , UT_UHF_RESTART_TURN_OFF , UT_UHF_RESTART_OFF_DELAY , UT_UHF_RESTART_TURN_ON ,
  UT_UHF_RESTART_CLEAR_ONE , UT_UHF_RESTART_SEND_PLUS , UT_UHF_RESTART_CLEAR_TWO , UT_UHF_RESTART_FRESET ,
  UT_UHF_RESTART_FRESET_PAUSE , UT_UHF_RESTART_FRESET_SAVE , UT_UHF_RESTART_FRESET_RESTART , UT_UHF_RESTART_SEND_BOOT
}
 
enum  UT_UHF_RESTART_TYPE { UT_UHF_RESTART_SOFT , UT_UHF_RESTART_HARD }
 
enum  UT_UHF_STARTUP_STATE {
  WAIT_BANNER , SEND_PLUS , CHECK_SETUP , SEND_BAUD ,
  SEND_PROT , SEND_MOD , SEND_CHANTX , SEND_CHANRX ,
  SEND_TXDELAY , SEND_SYNRT , SEND_FREQ , SEND_MAP_SAVE ,
  SEND_BW , SEND_POWER , SEND_SAVE , SEND_DATA_MODE
}
 
enum  UT_UHF_FUNCTION_TYPE { WAITING_RESPONSE , WAITING_BEFORE_SEND , SENDING_DATA , IDLE }
 
enum  UT_UHF_RESPONSE_TYPE {
  UHF_RESP_OK , UHF_RESP_ERROR , UHF_RESP_BANNER , UHF_RESP_NONE ,
  UHF_RESP_UNDEF
}
 
enum  UT_UHF_BAUD_RATE { UT_UHF_BAUD_NORMAL = 38400 , UT_UHF_BAUD_SETUP = 115200 }
 

Functions

void radioHandleStartUp (void)
 
void radioSetState (UT_UHF_STARTUP_STATE newState, float pause)
 
void radioSetErrorState (void)
 
bool utUHF_IsRunning (void)
 
bool utUHF_Notify (UT_DeviceMessage state)
 

Detailed Description

Software module to control the power on and set up of a UHF radio that can be attached to u_Track.

This software module can be configured to turn on the radio and set the frquency, bandwith and power for transmission. If there is an error when configuring the radio the module will power down the radio

Precondition
First initialise the SERIAL UART.
Author
Kylie Robinson
Date
20/08/2014