Merge pull request #1390 from tsparber/fix-doxygen-whitespace

Cleanup some trailing spaces and convert tabs to spaces
This commit is contained in:
George Oikonomou 2015-11-22 11:53:01 +00:00
commit 41ea0308a3
29 changed files with 1001 additions and 1033 deletions

File diff suppressed because it is too large Load diff

View file

@ -49,7 +49,7 @@
#define RADIO_SPI_CLK_FREQ 4000000 // 4 MHz SPI CLK for radio interface
#define SYSTEM_UCLK 16000000 // 16 MHz UCLK
// Default Radio Parameters
#define DEFAULT_CHNL_FREQ 915000000
#define DEFAULT_CHNL_FREQ 915000000
#define FREQ_CNVRT_VAL 0.00252061538
// Defines for radio memory mapped areas
#define PACKETRAM_START 0x10
@ -68,14 +68,14 @@
#define MCR_rssi_readback_Adr 0x312
#define MCR_gpio_configure_Adr 0x3fa
#define MCR_ext_uc_clk_divide_Adr 0x32e
#define MCR_interrupt_source_0_Adr 0x336
#define MCR_interrupt_source_0_Adr 0x336
#define MCR_interrupt_source_1_Adr 0x337
// Macros for manual GPIO checking of Radio MISO pin P2.0 (SPI0)
#define RADIO_MISO_IN GP2IN_IN0_BBA
#define RADIO_MISO_IN GP2IN_IN0_BBA
// Macros for manual GPIO control of P2.3 (Radio SPI CS) (SPI0)
#define RADIO_CSN_DEASSERT (pADI_GP2->GPSET = GP2SET_SET3)
#define RADIO_CSN_ASSERT (pADI_GP2->GPCLR = GP2CLR_CLR3)
#define RADIO_CSN_DEASSERT (pADI_GP2->GPSET = GP2SET_SET3)
#define RADIO_CSN_ASSERT (pADI_GP2->GPCLR = GP2CLR_CLR3)
// Macros for Sending\Receiving single bytes via SPI
#define SEND_SPI(x) pADI_SPI0->SPITX = x
#define WAIT_SPI_RX while((pADI_SPI0->SPISTA & SPISTA_RXFSTA_MSK) == 0x0);
@ -92,7 +92,7 @@
/*************************************************************************/
/* Radio Command Codes */
/*************************************************************************/
typedef enum
typedef enum
{
CMD_SYNC = 0xA2, // Synchronizatio
CMD_PHY_OFF = 0xB0, // Transition to state PHY_OFF
@ -137,54 +137,54 @@ typedef enum
/*************************************************************************/
/* Radio Configuration Structure */
/*************************************************************************/
/**
/**
\internal Hide from Doxegen
\var TyRadioConfiguration
**/
typedef struct
{
RIE_U8 interrupt_mask_0_r; // 0x100
RIE_U8 cfg_101_r; // 0x101
RIE_U8 cfg_102_r; // 0x102
RIE_U8 cfg_103_r; // 0x103
RIE_U8 cfg_104_r; // 0x104
RIE_U8 cfg_105_r; // 0x105
RIE_U8 cfg_106_r; // 0x106
RIE_U8 cfg_107_r; // 0x107
RIE_U8 cfg_108_r; // 0x108
RIE_U8 channel_freq_0_r; // 0x109
RIE_U8 channel_freq_1_r; // 0x10A
RIE_U8 channel_freq_2_r; // 0x10B
RIE_U8 cfg_10C_r; // 0x10C
RIE_U8 cfg_10D_r; // 0x10D
RIE_U8 cfg_10E_r; // 0x10E
RIE_U8 cfg_10F_r; // 0x10F
RIE_U8 cfg_110_r; // 0x110
RIE_U8 cfg_111_r; // 0x111
RIE_U8 cfg_112_r; // 0x112
RIE_U8 cfg_113_r; // 0x113
RIE_U8 radio_cfg_8_r; // 0x114
RIE_U8 radio_cfg_9_r; // 0x115
RIE_U8 cfg_116_r; // 0x116
RIE_U8 cfg_117_r; // 0x117
RIE_U8 image_reject_cal_phase_r; // 0x118
RIE_U8 image_reject_cal_amplitude_r; // 0x119
RIE_U8 cfg_11A_r; // 0x11A
RIE_U8 cfg_11B_r; // 0x11B
RIE_U8 symbol_mode_r; // 0x11C
RIE_U8 cfg_11D_r; // 0x11D
RIE_U8 cfg_11E_r; // 0x11E
RIE_U8 cfg_11F_r; // 0x11F
RIE_U8 cfg_120_r; // 0x120
RIE_U8 cfg_121_r; // 0x121
RIE_U8 cfg_122_r; // 0x122
RIE_U8 cfg_123_r; // 0x123
RIE_U8 tx_base_adr_r; // 0x124
RIE_U8 rx_base_adr_r; // 0x125
RIE_U8 packet_length_control_r; // 0x126
RIE_U8 packet_length_max_r; // 0x127
RIE_U8 cfg_128_r; // 0x128
RIE_U8 cfg_129_r; // 0x129
RIE_U8 interrupt_mask_0_r; // 0x100
RIE_U8 cfg_101_r; // 0x101
RIE_U8 cfg_102_r; // 0x102
RIE_U8 cfg_103_r; // 0x103
RIE_U8 cfg_104_r; // 0x104
RIE_U8 cfg_105_r; // 0x105
RIE_U8 cfg_106_r; // 0x106
RIE_U8 cfg_107_r; // 0x107
RIE_U8 cfg_108_r; // 0x108
RIE_U8 channel_freq_0_r; // 0x109
RIE_U8 channel_freq_1_r; // 0x10A
RIE_U8 channel_freq_2_r; // 0x10B
RIE_U8 cfg_10C_r; // 0x10C
RIE_U8 cfg_10D_r; // 0x10D
RIE_U8 cfg_10E_r; // 0x10E
RIE_U8 cfg_10F_r; // 0x10F
RIE_U8 cfg_110_r; // 0x110
RIE_U8 cfg_111_r; // 0x111
RIE_U8 cfg_112_r; // 0x112
RIE_U8 cfg_113_r; // 0x113
RIE_U8 radio_cfg_8_r; // 0x114
RIE_U8 radio_cfg_9_r; // 0x115
RIE_U8 cfg_116_r; // 0x116
RIE_U8 cfg_117_r; // 0x117
RIE_U8 image_reject_cal_phase_r; // 0x118
RIE_U8 image_reject_cal_amplitude_r; // 0x119
RIE_U8 cfg_11A_r; // 0x11A
RIE_U8 cfg_11B_r; // 0x11B
RIE_U8 symbol_mode_r; // 0x11C
RIE_U8 cfg_11D_r; // 0x11D
RIE_U8 cfg_11E_r; // 0x11E
RIE_U8 cfg_11F_r; // 0x11F
RIE_U8 cfg_120_r; // 0x120
RIE_U8 cfg_121_r; // 0x121
RIE_U8 cfg_122_r; // 0x122
RIE_U8 cfg_123_r; // 0x123
RIE_U8 tx_base_adr_r; // 0x124
RIE_U8 rx_base_adr_r; // 0x125
RIE_U8 packet_length_control_r; // 0x126
RIE_U8 packet_length_max_r; // 0x127
RIE_U8 cfg_128_r; // 0x128
RIE_U8 cfg_129_r; // 0x129
RIE_U8 cfg_12A_r; // 0x12A
RIE_U8 cfg_12B_r; // 0x12B
RIE_U8 cfg_12C_r; // 0x12C
@ -205,14 +205,14 @@ typedef struct
RIE_U8 cfg_13B_r; // 0x13B
RIE_U8 cfg_13C_r; // 0x13C
RIE_U8 cfg_13D_r; // 0x13D
RIE_U8 cfg_13E_r; // 0x13E
RIE_U8 cfg_13F_r; // 0x13F
RIE_U8 cfg_13E_r; // 0x13E
RIE_U8 cfg_13F_r; // 0x13F
} TyRadioConfiguration;
/*************************************************************************/
/* Radio Configuration Constants */
/*************************************************************************/
#define interrupt_mask_0_interrupt_tx_eof (0x1 << 4)
#define interrupt_mask_0_interrupt_crc_correct (0x1 << 2)
#define interrupt_mask_0_interrupt_tx_eof (0x1 << 4)
#define interrupt_mask_0_interrupt_crc_correct (0x1 << 2)
#define packet_length_control_length_offset_offset (0)
#define packet_length_control_length_offset_minus0 (0x4 << packet_length_control_length_offset_offset)
@ -237,7 +237,7 @@ typedef struct
#define radio_cfg_8_pa_power_setting_63 (0xF << radio_cfg_8_pa_power_offset)
#define radio_cfg_8_pa_ramp_numbits (3)
#define radio_cfg_8_pa_ramp_offset (0)
#define radio_cfg_8_pa_ramp_16 (0x5 << radio_cfg_8_pa_ramp_offset)
#define radio_cfg_8_pa_ramp_16 (0x5 << radio_cfg_8_pa_ramp_offset)
#define radio_cfg_9_demod_scheme_offset (0)
#define radio_cfg_9_demod_scheme_FSK (0x0 << radio_cfg_9_demod_scheme_offset)
@ -256,13 +256,13 @@ typedef struct
/* Local Variables */
/*************************************************************************/
static TyRadioConfiguration RadioConfiguration;
static RIE_BOOL bRadioConfigurationChanged = RIE_FALSE;
static RIE_BOOL bTestModeEnabled = RIE_FALSE;
static RIE_U32 DataRate = 38400;
static RIE_BOOL bRadioConfigurationChanged = RIE_FALSE;
static RIE_BOOL bTestModeEnabled = RIE_FALSE;
static RIE_U32 DataRate = 38400;
static volatile RIE_BOOL bPacketTx = RIE_FALSE;
static volatile RIE_BOOL bPacketRx = RIE_FALSE;
const RIE_U8 DR_38_4kbps_Dev20kHz_Configuration[] =
const RIE_U8 DR_38_4kbps_Dev20kHz_Configuration[] =
{
0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x00,0x76,0x62,0x21,
@ -272,11 +272,11 @@ const RIE_U8 DR_38_4kbps_Dev20kHz_Configuration[] =
0x40,0x0C,0x00,0x0C,0x00,0x00,
0x10,0x00,0xC3,0x36,0x10,0x10,0x24,0xF0,0x2A,0x00,0x2F,0x19,0x5E,0x46,0x5F,0x78,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
};
const RIE_U8 DR_300_0kbps_Dev75_0kHz_Configuration[] =
const RIE_U8 DR_300_0kbps_Dev75_0kHz_Configuration[] =
{
0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x00,0x76,0x62,0x21,
@ -291,7 +291,7 @@ const RIE_U8 DR_300_0kbps_Dev75_0kHz_Configuration[] =
const RIE_U8 DR_1_0kbps_Dev10_0kHz_Configuration[] =
const RIE_U8 DR_1_0kbps_Dev10_0kHz_Configuration[] =
{
0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x00,0x76,0x62,0x21,
// 0 1 2 3 4 5 6 7 8 9 A B
@ -312,8 +312,8 @@ static RIE_Responses RadioSendCommandBytes (RIE_U8 * pCmdBytes,
RIE_U8 NumBytes);
static RIE_Responses RadioSendCommandNoWait (Radio_CmdCodes CmdCode);
static RIE_Responses RadioSendCommandWait (Radio_CmdCodes CmdCode);
static RIE_Responses RadioMMapRead (RIE_U32 ulAdr,
RIE_U32 ulLen,
static RIE_Responses RadioMMapRead (RIE_U32 ulAdr,
RIE_U32 ulLen,
RIE_U8 * pData);
static RIE_Responses RadioMMapWrite (RIE_U32 ulAdr,
RIE_U32 ulLen,
@ -337,7 +337,7 @@ static RIE_Responses RadioWaitOnCmdLdr (void);
@brief Return the Radio Interface Engine API Version
@param pVersion :{}
pVersion Storage for Radio Interface Engine API version.
@code
@code
RIE_U32 Version;
Response = RadioGetAPIVersion(&Version);
@endcode
@ -361,8 +361,8 @@ RIE_Responses RadioGetAPIVersion(RIE_U32 *pVersion)
- DR_1_0kbps_Dev10_0kHz Base configuration of 1 kbps datarate, 10.0 kHz frequency deviation.
- DR_38_4kbps_Dev20kHz Base configuration of 38.4 kbps datarate, 20 kHz frequency deviation.
- DR_300_0kbps_Dev75_0kHz Base configuration of 300 kbps datarate, 75 kHz frequency deviation.
@pre
RadioInit() must be called before this function is called.
@pre
RadioInit() must be called before this function is called.
@return RIE_Responses Error code.
**/
@ -388,7 +388,7 @@ RIE_Responses RadioSwitchConfig(RIE_BaseConfigs BaseConfig)
- DR_1_0kbps_Dev10_0kHz Base configuration of 1 kbps datarate, 10.0 kHz frequency deviation.
- DR_38_4kbps_Dev20kHz Base configuration of 38.4 kbps datarate, 20 kHz frequency deviation.
- DR_300_0kbps_Dev75_0kHz Base configuration of 300 kbps datarate, 75 kHz frequency deviation.
@note
@note
This must be called before any other function is called.
@return RIE_Responses Error code.
**/
@ -401,13 +401,13 @@ RIE_Responses RadioInit(RIE_BaseConfigs BaseConfig)
NVIC_DisableIRQ(UHFTRX_IRQn);
// Initialise GPIO Port 2 for Radio Use
pADI_GP2->GPCON = GP2CON_CON0_SPI0MISO | GP2CON_CON1_SPI0SCLK |
GP2CON_CON2_SPI0MOSI | GP2CON_CON3_GPIO |
pADI_GP2->GPCON = GP2CON_CON0_SPI0MISO | GP2CON_CON1_SPI0SCLK |
GP2CON_CON2_SPI0MOSI | GP2CON_CON3_GPIO |
GP2CON_CON4_IRQ8 | GP2CON_CON5_GPIO |
GP2CON_CON6_GPIO | GP2CON_CON7_GPIOIRQ7;
pADI_GP2->GPOEN = GP2OEN_OEN0_IN | GP2OEN_OEN1_IN |
GP2OEN_OEN2_IN | GP2OEN_OEN3_OUT |
pADI_GP2->GPOEN = GP2OEN_OEN0_IN | GP2OEN_OEN1_IN |
GP2OEN_OEN2_IN | GP2OEN_OEN3_OUT |
GP2OEN_OEN4_IN | GP2OEN_OEN5_IN |
GP2OEN_OEN6_IN | GP2OEN_OEN7_IN;
@ -435,8 +435,8 @@ RIE_Responses RadioInit(RIE_BaseConfigs BaseConfig)
// we enable the Cortex interrupt handling of it
if(Response == RIE_Success)
Response = RadioPowerOff();
// Configure a "high level" radio interrupt ...
pADI_INTERRUPT->EI2CFG = EI2CFG_IRQ8MDE_HIGHLEVEL | EI2CFG_IRQ8EN;
// Configure a "high level" radio interrupt ...
pADI_INTERRUPT->EI2CFG = EI2CFG_IRQ8MDE_HIGHLEVEL | EI2CFG_IRQ8EN;
// ... and set it up in the NVIC so that our interrupt handler is called
// when the radio wants our attention. Clear any pre-existing condition
// before enabling the interrupt.
@ -463,7 +463,7 @@ RIE_Responses RadioInit(RIE_BaseConfigs BaseConfig)
/**
@fn RIE_U32 RadioDeInit(void)
@brief Deinitialise the Radio, and power it down.
@note
@note
This can be called independently of all other functions to power down
the radio
@return RIE_Responses Error code.
@ -477,13 +477,13 @@ RIE_Responses RadioDeInit(void)
NVIC_DisableIRQ(UHFTRX_IRQn);
// Initialise GPIO Port 2 for Radio Use
pADI_GP2->GPCON = GP2CON_CON0_SPI0MISO | GP2CON_CON1_SPI0SCLK |
GP2CON_CON2_SPI0MOSI | GP2CON_CON3_GPIO |
pADI_GP2->GPCON = GP2CON_CON0_SPI0MISO | GP2CON_CON1_SPI0SCLK |
GP2CON_CON2_SPI0MOSI | GP2CON_CON3_GPIO |
GP2CON_CON4_IRQ8 | GP2CON_CON5_GPIO |
GP2CON_CON6_GPIO | GP2CON_CON7_GPIOIRQ7;
pADI_GP2->GPOEN = GP2OEN_OEN0_IN | GP2OEN_OEN1_IN |
GP2OEN_OEN2_IN | GP2OEN_OEN3_OUT |
pADI_GP2->GPOEN = GP2OEN_OEN0_IN | GP2OEN_OEN1_IN |
GP2OEN_OEN2_IN | GP2OEN_OEN3_OUT |
GP2OEN_OEN4_IN | GP2OEN_OEN5_IN |
GP2OEN_OEN6_IN | GP2OEN_OEN7_IN;
@ -512,8 +512,8 @@ RIE_Responses RadioDeInit(void)
/**
@fn RIE_Responses RadioPowerOff(void)
@brief Shutdown the radio and place it in its lowest power sleep mode.
@pre
@brief Shutdown the radio and place it in its lowest power sleep mode.
@pre
RadioInit() must be called before this function is called.
@return RIE_Response Error code.
**/
@ -532,14 +532,14 @@ RIE_Responses RadioPowerOff(void)
return Response;
}
/**
/**
@fn RIE_Responses RadioTerminateRadioOp(void)
@brief Terminate a currently running radio RX or TX operation.
@pre RadioInit() must be called before this function is called.
@code
@code
if (RIE_Response == RIE_Success)
RIE_Response = RadioRxPacketFixedLen(12);
// Delay for a while waiting for a packet
// Delay for a while waiting for a packet
if (RIE_Response == RIE_Success)
{
// Abort the waiting
@ -557,15 +557,15 @@ RIE_Responses RadioTerminateRadioOp (void)
return Response;
}
/**
/**
@fn RIE_Responses RadioSetFrequency(RIE_U32 Frequency)
@brief Set frequency for radio communications
@param Frequency :{431000000-928000000}
- This must be within the available bands of the radio:
- 431000000Hz to 464000000Hz and
@param Frequency :{431000000-928000000}
- This must be within the available bands of the radio:
- 431000000Hz to 464000000Hz and
- 862000000Hz to 928000000Hz.
@pre RadioInit() must be called before this function is called.
@code
@code
if (RIE_Response == RIE_Success)
RIE_Response = RadioSetFrequency(915000000);
@endcode
@ -584,18 +584,18 @@ RIE_Responses RadioSetFrequency(RIE_U32 Frequency)
RadioConfiguration.channel_freq_2_r = (EncodedFrequency >> 16)& 0xFF;
if (Frequency >= 862000000)
{
RadioConfiguration.image_reject_cal_amplitude_r = 0x07;
RadioConfiguration.image_reject_cal_amplitude_r = 0x07;
RadioConfiguration.image_reject_cal_phase_r = 0x16;
}
else
{
RadioConfiguration.image_reject_cal_amplitude_r = 0x03;
RadioConfiguration.image_reject_cal_amplitude_r = 0x03;
RadioConfiguration.image_reject_cal_phase_r = 0x08;
}
return Response;
}
/**
/**
@fn RIE_Responses RadioSetModulationType(RIE_ModulationTypes ModulationType)
@brief Set the Radio Transmitter Modulation Type. Can be FSK_Modulation or GFSK_Modulation.
@param ModulationType :{DR_1_0kbps_Dev10_0kHz , DR_38_4kbps_Dev20kHz ,DR_300_0kbps_Dev75_0kHz }
@ -603,7 +603,7 @@ RIE_Responses RadioSetFrequency(RIE_U32 Frequency)
- DR_38_4kbps_Dev20kHz Base configuration of 38.4 kbps datarate, 20 kHz frequency deviation.
- DR_300_0kbps_Dev75_0kHz Base configuration of 300 kbps datarate, 75 kHz frequency deviation.
@pre RadioInit() must be called before this function is called.
@code
@code
Response = RadioSetModulationType(GFSK_Modulation);
@endcode
@note FSK_Modulation is used by default.
@ -636,31 +636,31 @@ RIE_Responses RadioSetModulationType(RIE_ModulationTypes ModulationType)
if (ucNewRegVal != RadioConfiguration.radio_cfg_9_r )
{
bRadioConfigurationChanged = RIE_TRUE;
RadioConfiguration.radio_cfg_9_r = ucNewRegVal;
RadioConfiguration.radio_cfg_9_r = ucNewRegVal;
}
}
return Response;
}
/**
@fn RIE_Responses RadioPayldManchesterEncode(RIE_BOOL bEnable)
/**
@fn RIE_Responses RadioPayldManchesterEncode(RIE_BOOL bEnable)
@brief Enable or Disable Manchester Encoding of payload data.
Manchester encoding can be used to ensure a dc-free (zero mean)
transmission.
Manchester encoding can be used to ensure a dc-free (zero mean)
transmission.
A Binary 0 is mapped to 10, and a Binary 1 is mapped to 01.
A Binary 0 is mapped to 10, and a Binary 1 is mapped to 01.
Manchester encoding and decoding are applied to the payload data
and the CRC.
Manchester encoding and decoding are applied to the payload data
and the CRC.
@param bEnable :{RIE_FALSE,RIE_TRUE}
- RIE_TRUE if Manchester Encoding is to be enabled.
- RIE_TRUE if Manchester Encoding is to be enabled.
- RIE_FALSE if disabled.
@pre RadioInit() must be called before this function is called.
@code
@code
Response = RadioPayldManchesterEncode(RIE_TRUE);
@endcode
@ -689,37 +689,37 @@ RIE_Responses RadioPayldManchesterEncode(RIE_BOOL bEnable)
if (ucNewRegVal != RadioConfiguration.symbol_mode_r )
{
bRadioConfigurationChanged = RIE_TRUE;
RadioConfiguration.symbol_mode_r = ucNewRegVal;
RadioConfiguration.symbol_mode_r = ucNewRegVal;
}
}
return Response;
}
/**
/**
@fn RIE_Responses RadioPayldDataWhitening(RIE_BOOL bEnable)
@brief Enable or Disable Data Whitening of payload data.
@brief Enable or Disable Data Whitening of payload data.
Data whitening can be employed to avoid long runs of 1s or 0s
in the transmitted data stream.
in the transmitted data stream.
This ensures sufficient bit transitions in the packet, which
aids in receiver clock and data recovery because the encoding
breaks up long runs of 1s or 0s in the transmit packet.
This ensures sufficient bit transitions in the packet, which
aids in receiver clock and data recovery because the encoding
breaks up long runs of 1s or 0s in the transmit packet.
The data, excluding the preamble and sync word, is automatically
whitened before transmission by XORing the data with an 8-bit
pseudorandom sequence.
whitened before transmission by XORing the data with an 8-bit
pseudorandom sequence.
At the receiver, the data is XORed with the same pseudorandom
sequence, thereby reversing the whitening.
At the receiver, the data is XORed with the same pseudorandom
sequence, thereby reversing the whitening.
The linear feedback shift register polynomial used is x7 + x1 + 1.
@param bEnable :{RIE_FALSE, RIE_TRUE}
- RIE_TRUE if Manchester Encoding is to be enabled.
- RIE_TRUE if Manchester Encoding is to be enabled.
- RIE_FALSE if disabled.
@pre RadioInit() must be called before this function is called.
@code
@code
Response = RadioPayldDataWhitening(RIE_TRUE);
@endcode
@ -748,19 +748,19 @@ RIE_Responses RadioPayldDataWhitening(RIE_BOOL bEnable)
if (ucNewRegVal != RadioConfiguration.symbol_mode_r )
{
bRadioConfigurationChanged = RIE_TRUE;
RadioConfiguration.symbol_mode_r = ucNewRegVal;
RadioConfiguration.symbol_mode_r = ucNewRegVal;
}
}
return Response;
}
/**
@fn RIE_Responses RadioTxPacketFixedLen(RIE_U8 Len, RIE_U8 *pData)
@brief Transmit a fixed length packet.
/**
@fn RIE_Responses RadioTxPacketFixedLen(RIE_U8 Len, RIE_U8 *pData)
@brief Transmit a fixed length packet.
@param Len :{1-240} Length of packet to be transmitted.
@param pData :{} Data bytes to be transmitted.
@pre RadioInit() must be called before this function is called.
@code
@code
if (RIE_Response == RIE_Success)
RIE_Response = RadioTxSetPA(DifferentialPA,PowerLevel15);
if (RIE_Response == RIE_Success)
@ -795,13 +795,13 @@ RIE_Responses RadioTxPacketFixedLen(RIE_U8 Len, RIE_U8 *pData)
return Response;
}
/**
@fn RIE_Responses RadioTxPacketVariableLen(RIE_U8 Len, RIE_U8 *pData)
@brief Transmit a Variable length packet.
/**
@fn RIE_Responses RadioTxPacketVariableLen(RIE_U8 Len, RIE_U8 *pData)
@brief Transmit a Variable length packet.
@param Len :{1-240} Length of packet to be transmitted.
@param pData :{} Data bytes to be transmitted.
@pre RadioInit() must be called before this function is called.
@code
@code
if (RIE_Response == RIE_Success)
RIE_Response = RadioTxSetPA(DifferentialPA,PowerLevel15);
if (RIE_Response == RIE_Success)
@ -841,12 +841,12 @@ RIE_Responses RadioTxPacketVariableLen(RIE_U8 Len, RIE_U8 *pData)
}
/**
@fn RIE_BOOL RadioTxPacketComplete(void)
/**
@fn RIE_BOOL RadioTxPacketComplete(void)
@brief Checks if a packet has finished transmitting
@pre RadioInit() must be called before this function is called.
@pre RadioRxPacketFixedLen() or equivalent should be called first.
@code
@code
if (RIE_Response == RIE_Success)
RIE_Response = RadioTxSetPA(DifferentialPA,PowerLevel15);
if (RIE_Response == RIE_Success)
@ -860,16 +860,16 @@ RIE_BOOL RadioTxPacketComplete (void)
return bPacketTx;
}
/**
@fn RIE_Responses RadioTxSetPA(RIE_PATypes PAType,RIE_PAPowerLevel Power)
@brief Set PA Type and the Transmit Power Level for Radio Transmission.
/**
@fn RIE_Responses RadioTxSetPA(RIE_PATypes PAType,RIE_PAPowerLevel Power)
@brief Set PA Type and the Transmit Power Level for Radio Transmission.
@param PAType :{DifferentialPA, SingleEndedPA} Select Single Ended or Differential PA Type
@param Power :{PowerLevel0 ,PowerLevel1 ,PowerLevel2 ,PowerLevel3,
PowerLevel4 ,PowerLevel5 ,PowerLevel6 ,PowerLevel7,
PowerLevel8 ,PowerLevel9 ,PowerLevel10,PowerLevel11,
PowerLevel12,PowerLevel13,PowerLevel14,PowerLevel15}
PowerLevel12,PowerLevel13,PowerLevel14,PowerLevel15}
@pre RadioInit() must be called before this function is called.
@code
@code
Response = RadioTxSetPA(SingleEndedPA,PowerLevel8);
@endcode
@note Differential PA is enabled by default.
@ -940,17 +940,17 @@ RIE_Responses RadioTxSetPA(RIE_PATypes PAType,RIE_PAPowerLevel Power)
if (ucNewRegVal != RadioConfiguration.radio_cfg_8_r )
{
bRadioConfigurationChanged = RIE_TRUE;
RadioConfiguration.radio_cfg_8_r = ucNewRegVal;
RadioConfiguration.radio_cfg_8_r = ucNewRegVal;
}
}
return Response;
}
/**
/**
@fn RIE_Responses RadioTxCarrier(void)
@brief Transmit a carrier tone
using the current radio configuration.
@pre RadioInit() must be called before this function is called.
@code
@code
Response = RadioTxCarrier();
@endcode
@note Terminate this mode by calling RadioTerminateRadioOp();
@ -973,12 +973,12 @@ RIE_Responses RadioTxCarrier (void)
Response = RadioSendCommandWait(CMD_PHY_TX);
return Response;
}
/**
/**
@fn RIE_Responses RadioTxPreamble(void)
@brief Transmit a pre-amble (alternating ones and zeros)
using the current radio configuration.
@pre RadioInit() must be called before this function is called.
@code
@code
Response = RadioTxPreamble();
@endcode
@note Terminate this mode by calling RadioTerminateRadioOp();
@ -1002,14 +1002,14 @@ RIE_Responses RadioTxPreamble (void)
return Response;
}
/**
/**
@fn RIE_Responses RadioRxPacketFixedLen(RIE_U8 Len)
@brief Enter receive mode and wait for a packet to be received.
Radio will stay in Receive Mode until
1) A packet is received.
Radio will stay in Receive Mode until
1) A packet is received.
2) User manually exits Receive Mode with a call to RadioTerminateRadioOp()
@param Len :{1-240} Fixed Length of packet to be received.
@pre RadioInit() must be called before this function is called.
@return RIE_Responses Error code
@ -1036,14 +1036,14 @@ RIE_Responses RadioRxPacketFixedLen(RIE_U8 Len)
return Response;
}
/**
/**
@fn RIE_Responses RadioRxPacketVariableLen(void)
@brief Enter receive mode and wait for a packet to be received.
Radio will stay in Receive Mode until
1) A packet is received.
Radio will stay in Receive Mode until
1) A packet is received.
2) User manually exits Receive Mode with a call to RadioTerminateRadioOp()
@pre RadioInit() must be called before this function is called.
@return RIE_Responses Error code
**/
@ -1067,12 +1067,12 @@ RIE_Responses RadioRxPacketVariableLen(void)
return Response;
}
/**
@fn RIE_BOOL RadioRxPacketAvailable(void)
@brief Checks if a packet has been received.
/**
@fn RIE_BOOL RadioRxPacketAvailable(void)
@brief Checks if a packet has been received.
@pre RadioInit() must be called before this function is called.
@pre RadioRxPacketFixedLen() or equivalent should be called first.
@code
@code
if (RIE_Response == RIE_Success)
RIE_Response = RadioRxPacketFixedLen(12);
if (RIE_Response == RIE_Success)
@ -1095,7 +1095,7 @@ RIE_BOOL RadioRxPacketAvailable(void)
}
/**
/**
@fn RIE_Responses RadioRxPacketRead(RIE_U8 BufferLen,RIE_U8 *pPktLen,RIE_U8 *pData,RIE_S8 *pRSSIdBm)
@brief Read the packet that was received by the radio.
@param BufferLen :{1-240} Size of passed in buffer
@ -1104,7 +1104,7 @@ RIE_BOOL RadioRxPacketAvailable(void)
@param pRSSIdBm :{} RSSI of received packet in dBm.
@pre RadioInit() must be called before this function is called.
@pre RadioRxPacketFixedLen() or equivalent should be called first.
@code
@code
if (RIE_Response == RIE_Success)
RIE_Response = RadioRxPacketFixedLen(12);
if (RIE_Response == RIE_Success)
@ -1170,13 +1170,13 @@ RIE_Responses RadioRxPacketRead(RIE_U8 BufferLen,RIE_U8 *pPktLen,RIE_U8 *pData,R
return Response;
}
/**
/**
@fn RIE_Responses RadioRxBERTestMode(void)
@brief Enter receiver Bit Error Rate (BER) test mode where the
clock and data appear on GPIO pins.
Clock on P0.6 and Data on P2.6
@pre RadioInit() must be called before this function is called.
@code
@code
Response = RadioRxBERTestMode();
@endcode
@note Terminate this mode by calling RadioTerminateRadioOp();
@ -1187,7 +1187,7 @@ RIE_Responses RadioRxBERTestMode(void)
RIE_Responses Response = RIE_Success;
RIE_U8 Data;
// Enables internal radio signals on external pins
// but overrides some of the standard GPIO muxed
// but overrides some of the standard GPIO muxed
// functionality (UART?)
pADI_MISC->RFTST = 0x7E1;
@ -1211,7 +1211,7 @@ RIE_Responses RadioRxBERTestMode(void)
return Response;
}
/**
/**
@internal Hide from Doxegen
@fn RIE_Responses RadioCommitRadioConfig(void)
@brief Configures the radio if any changes were made
@ -1247,7 +1247,7 @@ static RIE_Responses RadioCommitRadioConfig(void)
}
return Response;
}
/**
/**
@fn RIE_Responses RadioReadState(RadioState *pState)
@brief Read the current state
@param pState Pointer to return storage of state
@ -1271,7 +1271,7 @@ static RIE_Responses RadioReadState(RadioState *pState)
return Response;
}
/**
/**
@fn RIE_Responses RadioWaitOnState(RadioState FinalState)
@brief Wait for Final State to be reached
@param FinalState State to wait on
@ -1289,7 +1289,7 @@ static RIE_Responses RadioWaitOnState(RadioState FinalState)
return Response;
}
/**
/**
@fn RIE_Responses RadioWaitOnCmdLdr(void)
@brief Wait for Final State to be reached
@param FinalState State to wait on
@ -1307,7 +1307,7 @@ static RIE_Responses RadioWaitOnCmdLdr(void)
Response = RadioSPIXferByte(SPI_NOP,NULL);
if (Response == RIE_Success)
Response = RadioSPIXferByte(SPI_NOP,&StatusByte);
RADIO_CSN_DEASSERT;
RADIO_CSN_DEASSERT;
NVIC_EnableIRQ (UHFTRX_IRQn);
if ((Response == RIE_Success))
if(StatusByte & STATUS_BYTE_CMD_READY)
@ -1317,13 +1317,13 @@ static RIE_Responses RadioWaitOnCmdLdr(void)
return Response;
}
/**
/**
@internal Hide from Doxegen
@fn RIE_Responses RadioToOnMode(void)
@brief Transition to On Mode
Handle all possible states that the radio could be in
and brings it back to PHY_ON state
Handle all possible states that the radio could be in
and brings it back to PHY_ON state
@param None
@return RIE_Responses Error code
**/
@ -1365,12 +1365,12 @@ static RIE_Responses RadioToOnMode(void)
}
return Response;
}
/**
/**
@internal Hide from Doxegen
@fn RIE_Responses RadioToOffMode(void)
@brief Transition to Off Mode
Handle all possible states that the radio could be in
Handle all possible states that the radio could be in
and bring it back to PHY_OFF state.
@param None
@ -1414,7 +1414,7 @@ static RIE_Responses RadioToOffMode(void)
}
return Response;
}
/**
/**
@internal Hide from Doxegen
@fn RIE_Responses RadioSyncComms (void)
@brief Sync comms with the radio
@ -1430,7 +1430,7 @@ static RIE_Responses RadioSyncComms (void)
Response = RadioWaitOnCmdLdr();
return Response;
}
/**
/**
@fn RIE_Responses RadioWaitForPowerUp(void)
@brief Wake Up the Part
@ -1444,7 +1444,7 @@ static RIE_Responses RadioWaitForPowerUp(void)
RIE_Responses Response = RIE_Success;
int i = 0x0;
RADIO_CSN_ASSERT;
while (!RADIO_MISO_IN && (i < 1000))
while (!RADIO_MISO_IN && (i < 1000))
i++;
if (1000 == i)// Timed out waiting for MISO high?
Response = RIE_RadioSPICommsFail;
@ -1452,7 +1452,7 @@ static RIE_Responses RadioWaitForPowerUp(void)
return Response;
}
/**
/**
\internal Hide from Doxegen
\fn void Ext_Int8_Handler(void)
\brief Radio Interrupt Handler
@ -1482,7 +1482,7 @@ void Ext_Int8_Handler (void)
// Clear the interrupt
pADI_INTERRUPT->EICLR = EICLR_IRQ8;
}
/**
/**
\internal Hide from Doxegen
\fn void RadioSPIXferByte(RIE_U8 ucByte,RIE_U8 *pData)
\brief Transfer a byte via SPI to the radio and optionally return
@ -1504,13 +1504,13 @@ static RIE_Responses RadioSPIXferByte(RIE_U8 ucByte,RIE_U8 *pData)
(void)READ_SPI;
return Response;
}
/**
/**
\internal Hide from Doxegen
\fn RIE_Responses RadioSendCommandBytes(RIE_U8 *pCmdBytes,RIE_U8 NumBytes)
\brief Send a complete command to the radio.
It is neccessary to disable the radio interrupt when doing this
as a command in progress must finish before a radio interrupt
as a command in progress must finish before a radio interrupt
can be handled.
\param pCmdBytes Pointer to a number of bytes to be transferred.
@ -1531,7 +1531,7 @@ static RIE_Responses RadioSendCommandBytes(RIE_U8 *pCmdBytes,RIE_U8 NumBytes)
return Response;
}
/**
/**
\internal Hide from Doxegen
\fn RIE_Responses RadioSendCommandNoWait (Radio_CmdCodes CmdCode )
\brief Send a single byte command to the radio.
@ -1543,7 +1543,7 @@ static RIE_Responses RadioSendCommandNoWait (Radio_CmdCodes CmdCode )
RIE_U8 Command = (RIE_U8)CmdCode;
return RadioSendCommandBytes(&Command,0x1);
}
/**
/**
\internal Hide from Doxegen
\fn RIE_Responses RadioSendCommandWait (Radio_CmdCodes CmdCode )
\brief Send a single byte command to the radio.
@ -1561,7 +1561,7 @@ static RIE_Responses RadioSendCommandWait (Radio_CmdCodes CmdCode )
Response = RadioSendCommandBytes(&Command,0x1);
return Response;
}
/**
/**
\fn RIE_Responses RadioMMapRead(RIE_U32 ulAdr, RIE_U32 ulLen, RIE_U8 *pData)
\brief Read bytes from specified memory map address
\param ulAdr Address to read at.
@ -1575,7 +1575,7 @@ static RIE_Responses RadioMMapRead(RIE_U32 ulAdr, RIE_U32 ulLen, RIE_U8 *pData)
NVIC_DisableIRQ(UHFTRX_IRQn);
RADIO_CSN_ASSERT;
if(Response == RIE_Success) // Send first byte (SPI_MEMR_RD + Bytes)
Response = RadioSPIXferByte(SPI_MEM_RD | ((ulAdr & 0x700) >> 8),NULL);
if(Response == RIE_Success)// Send Second byte remainder of address
@ -1589,7 +1589,7 @@ static RIE_Responses RadioMMapRead(RIE_U32 ulAdr, RIE_U32 ulLen, RIE_U8 *pData)
return Response;
}
/**
/**
\fn RIE_Responses RadioMMapWrite(RIE_U32 ulAdr, RIE_U32 ulLen, RIE_U8 *pData)
\brief Read bytes from specified memory map address
\param ulAdr Address to read at.
@ -1615,7 +1615,7 @@ static RIE_Responses RadioMMapWrite(RIE_U32 ulAdr,RIE_U32 ulLen,RIE_U8 * pDat
return Response;
}
/**
/**
\internal Hide from Doxegen
\fn void SetRadioConfiguration(void)
\brief Create a default radio configuration that all base configurations
@ -1654,7 +1654,7 @@ static RIE_Responses SetRadioConfiguration(RIE_BaseConfigs BaseConfig)
}
return Response;
}
/**
/**
@internal Hide from Doxegen
@fn RIE_Responses RadioConfigure (void)
@brief Configure the Radio as per the current configuration
@ -1666,8 +1666,8 @@ RIE_Responses RadioConfigure (void)
if(Response == RIE_Success)
Response = RadioToOffMode();
if(Response == RIE_Success) // Write the configuration to the radio memory
Response = RadioMMapWrite(BBRAM_START,
sizeof(TyRadioConfiguration),
Response = RadioMMapWrite(BBRAM_START,
sizeof(TyRadioConfiguration),
(RIE_U8 *)&RadioConfiguration);
if(Response == RIE_Success) // Apply that configuration to the radio
Response = RadioSendCommandWait(CMD_CONFIG_DEV);
@ -1677,12 +1677,12 @@ RIE_Responses RadioConfigure (void)
}
/**
/**
@fn RIE_Responses RadioRadioGetRSSI (RIE_S8 *pRSSIdBm)
@brief Return a Received Signal Strength Indicator value
@param pRSSIdBm :{} detected RSSI in dBm.
@pre RadioInit() must be called before this function is called.
@code
@code
RIE_S8 RSSIdBm;
if (RIE_Response == RIE_Success)
RIE_Response = RadioRadioGetRSSI(&RSSIdBm);
@ -1700,7 +1700,7 @@ RIE_Responses RadioRadioGetRSSI (RIE_S8 *pRSSIdBm)
if (Response == RIE_Success)
Response = RadioSendCommandWait(CMD_GET_RSSI);
if (Response == RIE_Success)
Response = RadioSyncComms(); //
Response = RadioSyncComms(); //
if (pRSSIdBm)
{
if (Response == RIE_Success)
@ -1710,15 +1710,15 @@ RIE_Responses RadioRadioGetRSSI (RIE_S8 *pRSSIdBm)
return Response;
}
/**
@fn RIE_Responses RadioTxSetPower(RIE_PAPowerLevel Power)
@brief Set the Transmit Power Level for Radio Transmission.
/**
@fn RIE_Responses RadioTxSetPower(RIE_PAPowerLevel Power)
@brief Set the Transmit Power Level for Radio Transmission.
@param Power :{PowerLevel0 ,PowerLevel1 ,PowerLevel2 ,PowerLevel3,
PowerLevel4 ,PowerLevel5 ,PowerLevel6 ,PowerLevel7,
PowerLevel8 ,PowerLevel9 ,PowerLevel10,PowerLevel11,
PowerLevel12,PowerLevel13,PowerLevel14,PowerLevel15}
PowerLevel12,PowerLevel13,PowerLevel14,PowerLevel15}
@pre RadioInit() must be called before this function is called.
@code
@code
Response = RadioTxSetPower(PowerLevel8);
@endcode
@note Max TX Power is used by default.
@ -1783,7 +1783,7 @@ RIE_Responses RadioTxSetPower (RIE_PAPowerLevel Power)
// Write directly to the MCR in this case and avoid a reconfigure
if (Response == RIE_Success)
Response = RadioMMapWrite(MCR_pa_level_mcr_Adr, 0x1, (RIE_U8 *)&ucNewRegVal);
RadioConfiguration.radio_cfg_8_r = ucNewRegVal;
RadioConfiguration.radio_cfg_8_r = ucNewRegVal;
}
}
return Response;

View file

@ -89,10 +89,10 @@
* processor.
*/
int elfloader_arch_relocate(int input_fd,
struct elfloader_output *output,
unsigned int sectionoffset,
char *sectionaddr,
struct elf32_rela *rela, char *addr);
struct elfloader_output *output,
unsigned int sectionoffset,
char *sectionaddr,
struct elf32_rela *rela, char *addr);
#endif /* ELFLOADER_ARCH_H_ */

View file

@ -37,7 +37,7 @@
* Header file for the Contiki ELF loader.
* \author
* Adam Dunkels <adam@sics.se>
* Simon Berg <ksb@users.sourceforge.net>
* Simon Berg <ksb@users.sourceforge.net>
*
*/
@ -132,7 +132,7 @@
* Return value from elfloader_load() indicating that the offset for
* a relative addressing mode was too big.
*/
#define ELFLOADER_OUTOF_RANGE 9
#define ELFLOADER_OUTOF_RANGE 9
/**
* Return value from elfloader_load() indicating that the relocations
@ -144,13 +144,13 @@
* Return value from elfloader_load() indicating that reading from the
* ELF file failed in some way.
*/
#define ELFLOADER_INPUT_ERROR 11
#define ELFLOADER_INPUT_ERROR 11
/**
* Return value from elfloader_load() indicating that writing to a segment
* failed.
*/
#define ELFLOADER_OUTPUT_ERROR 12
#define ELFLOADER_OUTPUT_ERROR 12
#define ELFLOADER_SEG_TEXT 1
@ -164,10 +164,10 @@
* This object defines methods (callbacks) for writing the segments to memory.
* It can be extended by the user to include any necessary state.
*/
struct elfloader_output {
const struct elfloader_output_ops *ops;
};
/**
* \brief Allocate a new segment
* \param input The output object
@ -178,9 +178,8 @@ struct elfloader_output {
* The returned address doesn't need to correspond to any real memory,
* since it's only used for calculating the relocations.
*/
void *elfloader_allocate_segment(struct elfloader_output *output,
unsigned int type, int size);
unsigned int type, int size);
/**
* \brief Start writing to a new segment
@ -191,15 +190,14 @@ void *elfloader_allocate_segment(struct elfloader_output *output,
* \return Returns ELFLOADER_OK if successful, otherwise an error code
*
*/
int elfloader_start_segment(struct elfloader_output *output,
unsigned int type, void *addr, int size);
unsigned int type, void *addr, int size);
/**
* \brief Mark end of segment
* \param input The output object
* \return Zero if successful
*/
int elfloader_end_segment(struct elfloader_output *output);
/**
@ -209,9 +207,8 @@ int elfloader_end_segment(struct elfloader_output *output);
* \param len Length of data
* \return The number of bytes actually written, or negative if failed.
*/
int elfloader_write_segment(struct elfloader_output *output, const char *buf,
unsigned int len);
unsigned int len);
/**
* \brief Get the current offset in the file where the next data will
@ -219,7 +216,6 @@ int elfloader_write_segment(struct elfloader_output *output, const char *buf,
* \param input The output object
* \return The current offset.
*/
unsigned int elfloader_segment_offset(struct elfloader_output *output);
#define elfloader_output_alloc_segment(output, type, size) \
@ -240,12 +236,12 @@ unsigned int elfloader_segment_offset(struct elfloader_output *output);
struct elfloader_output_ops {
void * (*allocate_segment)(struct elfloader_output *output,
unsigned int type, int size);
unsigned int type, int size);
int (*start_segment)(struct elfloader_output *output,
unsigned int type, void *addr, int size);
unsigned int type, void *addr, int size);
int (*end_segment)(struct elfloader_output *output);
int (*write_segment)(struct elfloader_output *output, const char *buf,
unsigned int len);
unsigned int len);
unsigned int (*segment_offset)(struct elfloader_output *output);
};
@ -269,8 +265,7 @@ void elfloader_init(void);
* elfloader_loaded_process variable.
*
*/
int elfloader_load(int input_fd,
struct elfloader_output *output);
int elfloader_load(int input_fd, struct elfloader_output *output);
/**
* A pointer to the processes loaded with elfloader_load().

View file

@ -1001,11 +1001,11 @@ static NETBUF *NicGetPacket(void)
* Hack alert: Rev A chips never set the odd frame indicator.
*/
fbc -= 3;
/* nb = NutNetBufAlloc(0, NBAF_DATALINK, fbc);*/
/* nb = NutNetBufAlloc(0, NBAF_DATALINK, fbc);*/
/* Perform the read. */
/* if (nb)
NicRead(nb->nb_dl.vp, fbc);*/
/* if (nb)
NicRead(nb->nb_dl.vp, fbc);*/
}
/* Release the packet. */
@ -1191,12 +1191,12 @@ PROCESS_THREAD(lanc111_process, ev, data)
*/
imsk = nic_inlb(NIC_MSK);
nic_outlb(NIC_MSK, 0);
/* while ((nb = NicGetPacket()) != 0) {
if (nb != (NETBUF *) 0xFFFF) {
ni->ni_rx_packets++;
(*ifn->if_recv) (dev, nb);
}
}*/
/* while ((nb = NicGetPacket()) != 0) {
if (nb != (NETBUF *) 0xFFFF) {
ni->ni_rx_packets++;
(*ifn->if_recv) (dev, nb);
}
}*/
nic_outlb(NIC_MSK, imsk | INT_RCV | INT_ERCV);
}
@ -1351,7 +1351,7 @@ lanc111_init(void)
/* Register interrupt handler and enable interrupts. */
/* if (NutRegisterIrqHandler(&LANC111_SIGNAL, NicInterrupt, dev))
return -1;*/
return -1;*/
/*
* Start the receiver thread.

View file

@ -1,31 +1,30 @@
/*
* Copyright (c) 2006, Swedish Institute of Computer Science
* All rights reserved.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
/**
* \file

View file

@ -28,7 +28,7 @@
* SUCH DAMAGE.
*
* This file is part of libmc1322x: see http://mc1322x.devl.org
* for details.
* for details.
*
*
*/

View file

@ -80,15 +80,15 @@ ISR(TIMERA1, timera1)
++count;
/* Make sure the CLOCK_CONF_SECOND is a power of two, to ensure
that the modulo operation below becomes a logical and and not
an expensive divide. Algorithm from Wikipedia:
http://en.wikipedia.org/wiki/Power_of_two */
that the modulo operation below becomes a logical and and not
an expensive divide. Algorithm from Wikipedia:
http://en.wikipedia.org/wiki/Power_of_two */
#if (CLOCK_CONF_SECOND & (CLOCK_CONF_SECOND - 1)) != 0
#error CLOCK_CONF_SECOND must be a power of two (i.e., 1, 2, 4, 8, 16, 32, 64, ...).
#error Change CLOCK_CONF_SECOND in contiki-conf.h.
#endif
if(count % CLOCK_CONF_SECOND == 0) {
++seconds;
++seconds;
energest_flush();
}
last_tar = read_tar();

View file

@ -52,5 +52,3 @@ enum {
/**@} // End of addtogroup
*/

View file

@ -2,7 +2,7 @@
* @brief Cortex-M3 Non-Volatile Memory data storage system.
* See @ref nvm for documentation.
*
* The functions in this file return an ::StStatus value.
* The functions in this file return an ::StStatus value.
* See error-def.h for definitions of all ::StStatus return values.
*
* See hal/micro/cortexm3/nvm.h for source code.
@ -27,7 +27,7 @@
* that is a multiple of physical flash pages. There are two pages: LEFT
* and RIGHT. The term "flash page" is used to refer to a page of
* physical flash.
*
*
* NVM data storage works by alternating between two pages: LEFT and RIGHT.
* The basic algorithm is driven by a call to halCommonSaveToNvm(). It will:
* - erase the inactive page
@ -58,35 +58,35 @@
* is LEFT then the state machine will advance until state 7 and then exit.
* If "Read from" is RIGHT, then the state machine will advance until
* state 3 and then exit.
*
*
* @code
* Starting from erased or invalid mgmt, write to LEFT
* State # 0 0 1 2 3
* Reads from: x x e w L L L
* State # 0 0 1 2 3
* Reads from: x x e w L L L
* Valid xx|xx FF|FF r r 00|FF 00|FF 00|00
* Active xx|xx FF|FF a i 00|FF 00|FF 00|00
* Dead xx|xx FF|FF s t FF|FF FF|00 FF|00
* Spare xx|xx FF|FF e e FF|FF FF|FF FF|FF
*
*
*
*
* Starting from LEFT page, transition to RIGHT page:
* State # 3 4 5 6 7
* Reads from: L e L w R R R
* State # 3 4 5 6 7
* Reads from: L e L w R R R
* Valid 00|00 r 00|FF r 00|00 00|00 00|00
* Active 00|00 a 00|FF i 00|FF 00|FF 00|00
* Dead FF|00 s FF|FF t FF|FF 00|FF 00|FF
* Spare FF|FF e FF|FF e FF|FF FF|FF FF|FF
*
*
*
*
* Starting from RIGHT page, transition to LEFT page:
* State # 7 8 9 10 3
* Reads from: R e R w L L L
* State # 7 8 9 10 3
* Reads from: R e R w L L L
* Valid 00|00 r FF|00 r 00|00 00|00 00|00
* Active 00|00 a FF|00 i FF|00 FF|00 00|00
* Dead 00|FF s FF|FF t FF|FF FF|00 FF|00
* Spare FF|FF e FF|FF e FF|FF FF|FF FF|FF
* @endcode
*
*
* Based on the 10 possible states, there are 5 valid 32bit mgmt words:
* - 0xFFFFFFFF
* - 0xFFFFFF00
@ -95,7 +95,7 @@
* - 0xFF00FFFF
* The algorithm determines the current state by using these 5 mgmt words
* with the 10 possible combinations of LEFT mgmt and RIGHT mgmt.
*
*
* Detailed State Description:
* - State 0:
* In this state the mgmt bytes do not conform to any of the other states
@ -135,8 +135,8 @@
* Once at these states, the current page is marked Valid and Active and
* the old page is marked as Dead. The algorithm knows which page to
* read from and which page needs to be erased on the next write to the NVM.
*
*
*
*
* Notes on algorithm behavior:
* - Refer to nvm-def.h for a list of offset/length that define the data
* stored in NVM storage space.
@ -189,14 +189,14 @@
/**
* @brief Copy the NVM data from flash into the provided RAM location.
* It is illegal for the offset to be greater than NVM_DATA_SIZE_B.
*
*
* @param data A (RAM) pointer to where the data should be copied.
*
*
* @param offset The location from which the data should be copied. Must be
* 16bit aligned.
*
*
* @param length The length of the data in bytes. Must be 16bit aligned.
*
*
* @return An StStatus value indicating the success of the function.
* - ST_SUCCESS if the read completed cleanly.
* - ST_ERR_FATAL if the NVM storage management indicated an invalid
@ -206,10 +206,10 @@ StStatus halCommonReadFromNvm(void *data, uint32_t offset, uint16_t length);
/**
* @brief Return the address of the token in NVM
*
*
* @param offset The location offset from which the address should be returned
*
*
*
*
* @return The address requested
*/
uint16_t *halCommonGetAddressFromNvm(uint32_t offset);
@ -217,14 +217,14 @@ uint16_t *halCommonGetAddressFromNvm(uint32_t offset);
/**
* @brief Write the NVM data from the provided location RAM into flash.
* It is illegal for the offset to be greater than NVM_DATA_SIZE_B.
*
*
* @param data A (RAM) pointer from where the data should be taken.
*
*
* @param offset The location to which the data should be written. Must be
* 16bit aligned.
*
*
* @param length The length of the data in bytes. Must be 16bit aligned.
*
*
* @return An StStatus value indicating the success of the function.
* - ST_SUCCESS if the write completed cleanly.
* - Any other status value is an error code generated by the low level

View file

@ -23,14 +23,14 @@ typedef enum
/**
* @brief Initialize the UART
*
*
* @param baudrate The baudrate which will be used for communication.
* Ex: 115200
*
*
* @param databits The number of data bits used for communication.
* Valid values are 7 or 8
*
* @param parity The type of parity used for communication.
*
* @param parity The type of parity used for communication.
* See the SerialParity enum for possible values
*
* @return stopbits The number of stop bits used for communication.
@ -45,9 +45,9 @@ void uartInit(uint32_t baudrate, uint8_t databits, SerialParity parity, uint8_t
* instead which does not define fflush(). Therefore, we manually define
* fflush() in the low level UART driver. This function simply redirects
* to the __write() function with a NULL buffer, triggering a flush.
*
*
* @param handle The output stream. Should be set to 'stdout' like normal.
*
*
* @return Zero, indicating success.
*/
size_t fflush(int handle);
@ -61,7 +61,7 @@ size_t fflush(int handle);
#define stdout _LLIO_STDOUT
#endif
/**
* @brief Read the input byte if any.
* @brief Read the input byte if any.
*/
boolean __io_getcharNonBlocking(uint8_t *data);
void __io_putchar( char c );

View file

@ -1,6 +1,6 @@
/**
/**
* \brief Compiler and Platform specific definitions and typedefs common to
* all platforms.
* all platforms.
*
* platform-common.h provides PLATFORM_HEADER defaults and common definitions.
* This head should never be included directly, it should only be included
@ -20,7 +20,7 @@
* <!--(C) COPYRIGHT 2010 STMicroelectronics. All rights reserved. -->
*/
#ifndef PLATCOMMONOKTOINCLUDE
// This header should only be included by a PLATFORM_HEADER
#error platform-common.h should not be included directly
@ -29,7 +29,7 @@
#ifndef PLATFORMCOMMON_H_
#define PLATFORMCOMMON_H_
////////////////////////////////////////////////////////////////////////////////
// Many of the common definitions must be explicitly enabled by the
// Many of the common definitions must be explicitly enabled by the
// particular PLATFORM_HEADER being used
////////////////////////////////////////////////////////////////////////////////
@ -69,16 +69,16 @@
////////////////////////////////////////////////////////////////////////////////
#ifdef _HAL_USE_COMMON_DIVMOD_
/** \name Divide and Modulus Operations
* Some platforms can perform divide and modulus operations on 32 bit
* Some platforms can perform divide and modulus operations on 32 bit
* quantities more efficiently when the divisor is only a 16 bit quantity.
* C compilers will always promote the divisor to 32 bits before performing the
* operation, so the following utility functions are instead required to take
* operation, so the following utility functions are instead required to take
* advantage of this optimisation.
*/
//@{
/**
* \brief Provide a portable name for the uint32_t by uint16_t division
* library function (which can perform the division with only a single
* library function (which can perform the division with only a single
* assembly instruction on some platforms)
*/
#define halCommonUDiv32By16(x, y) ((uint16_t) (((uint32_t) (x)) / ((uint16_t) (y))))
@ -111,12 +111,12 @@
#ifdef _HAL_USE_COMMON_MEMUTILS_
/** \name C Standard Library Memory Utilities
* These should be used in place of the standard library functions.
*
*
* These functions have the same parameters and expected results as their C
* Standard Library equivalents but may take advantage of certain implementation
* optimizations.
*
* Unless otherwise noted, these functions are utilized by the StStack and are
*
* Unless otherwise noted, these functions are utilized by the StStack and are
* therefore required to be implemented in the HAL. Additionally, unless otherwise
* noted, applications that find these functions useful may utilze them.
*/
@ -212,22 +212,22 @@
#define SETBIT(reg, bit) reg |= BIT(bit)
/**
* \brief Sets the bits in the \c reg register or the byte
* as specified in the bitmask \c bits.
* \brief Sets the bits in the \c reg register or the byte
* as specified in the bitmask \c bits.
* @note This is never a single atomic operation.
*/
#define SETBITS(reg, bits) reg |= (bits)
/**
* \brief Clears a bit in the \c reg register or byte.
* @note Assuming \c reg is an IO register, some platforms (such as the AVR)
* \brief Clears a bit in the \c reg register or byte.
* @note Assuming \c reg is an IO register, some platforms (such as the AVR)
* can implement this in a single atomic operation.
*/
#define CLEARBIT(reg, bit) reg &= ~(BIT(bit))
/**
* \brief Clears the bits in the \c reg register or byte
* as specified in the bitmask \c bits.
* \brief Clears the bits in the \c reg register or byte
* as specified in the bitmask \c bits.
* @note This is never a single atomic operation.
*/
#define CLEARBITS(reg, bits) reg &= ~(bits)
@ -238,7 +238,7 @@
#define READBIT(reg, bit) (reg & (BIT(bit)))
/**
* \brief Returns the value of the bitmask \c bits within
* \brief Returns the value of the bitmask \c bits within
* the register or byte \c reg.
*/
#define READBITS(reg, bits) (reg & (bits))
@ -263,13 +263,13 @@
#define HIGH_BYTE(n) ((uint8_t)(LOW_BYTE((n) >> 8)))
/**
* \brief Returns the value built from the two \c uint8_t
* \brief Returns the value built from the two \c uint8_t
* values \c high and \c low.
*/
#define HIGH_LOW_TO_INT(high, low) ( \
(( (uint16_t) (high) ) << 8) + \
( (uint16_t) ( (low) & 0xFF)) \
)
)
/**
* \brief Returns the low byte of the 32-bit value \c n as an \c uint8_t.
@ -301,21 +301,21 @@
//@{
/**
* \brief Returns the elapsed time between two 8 bit values.
* \brief Returns the elapsed time between two 8 bit values.
* Result may not be valid if the time samples differ by more than 127
*/
#define elapsedTimeInt8u(oldTime, newTime) \
((uint8_t) ((uint8_t)(newTime) - (uint8_t)(oldTime)))
/**
* \brief Returns the elapsed time between two 16 bit values.
* \brief Returns the elapsed time between two 16 bit values.
* Result may not be valid if the time samples differ by more than 32767
*/
#define elapsedTimeInt16u(oldTime, newTime) \
((uint16_t) ((uint16_t)(newTime) - (uint16_t)(oldTime)))
/**
* \brief Returns the elapsed time between two 32 bit values.
* \brief Returns the elapsed time between two 32 bit values.
* Result may not be valid if the time samples differ by more than 2147483647
*/
#define elapsedTimeInt32u(oldTime, newTime) \

View file

@ -149,4 +149,3 @@ StStatus halBootloaderStart(uint8_t mode, uint8_t channel, uint16_t panId);
/** @} END micro group */
/** @} */