Exemplo n.º 1
0
/**************************************************************************************************
 * @fn          BSP_Init
 *
 * @brief       Initialize the board and drivers.
 *
 * @param       none
 *
 * @return      none
 **************************************************************************************************
 */
void BSP_Init(void)
{
  BSP_INIT_BOARD();
  BSP_INIT_DRIVERS();

  /*-------------------------------------------------------------
   *  Run time integrity checks.  Perform only if asserts
   *  are enabled.
   */
#ifdef BSP_ASSERTS_ARE_ON
	/* verify endianess is correctly specified */
	{
		uint16_t test = 0x00AA; /* first storage byte of 'test' is non-zero for little endian */
		BSP_ASSERT(!(*((uint8_t *)&test)) == !BSP_LITTLE_ENDIAN); /* endianess mismatch */
	}
#endif
}
Exemplo n.º 2
0
/**************************************************************************************************
 * @fn          BSP_Init
 *
 * @brief       Initialize the board and drivers.
 *
 * @param       none
 *
 * @return      none
 **************************************************************************************************
 */
void BSP_Init(void)
{
  BSP_INIT_BOARD();
/************* MSP-EXP430F6137Rx Edit: HAL to control LEDs & BUTTONs*********/  
  // BSP_INIT_DRIVERS();
/****************SimpliciTI BSP to not control LEDS & BUTTONS****************/ 

  /*-------------------------------------------------------------
   *  Run time integrity checks.  Perform only if asserts
   *  are enabled.
   */
#ifdef BSP_ASSERTS_ARE_ON
  /* verify endianess is correctly specified */
  {
    uint16_t test = 0x00AA; /* first storage byte of 'test' is non-zero for little endian */
    BSP_ASSERT(!(*((uint8_t *)&test)) == !BSP_LITTLE_ENDIAN); /* endianess mismatch */
  }
#endif
}
Exemplo n.º 3
0
/******************************************************************************
* @fn         mrfiLinkInit
*
* @brief      Initialise the MRFI layer. Selects RF channel and addresses.
*
* @param      src - source address (16 bit)
*
* @param      dst - destination address (16 bit)
*
* @return     void
*
*/
void mrfiLinkInit(uint16 src, uint16 dst, uint8 mrfiChannel)
{
#ifdef USB_SUSPEND_HOOKS
    // Register USB hooks if necessary
    pFnSuspendEnterHook= MRFI_Sleep;
    pFnSuspendExitHook= linkRestore;
#endif

    // Make sure the timer is initialised
    BSP_INIT_BOARD();

    // Initialise the addresses
    src_addr[0]=  LO_UINT16(MRFI_LINK_PAN_ID);
    src_addr[1]=  HI_UINT16(MRFI_LINK_PAN_ID);
    src_addr[2]=  LO_UINT16(src);
    src_addr[3]=  HI_UINT16(src);

    dest_addr[0]= LO_UINT16(MRFI_LINK_PAN_ID);
    dest_addr[1]= HI_UINT16(MRFI_LINK_PAN_ID);
    dest_addr[2]= LO_UINT16(dst);
    dest_addr[3]= HI_UINT16(dst);

    // Initialise MRFI link housekeeping data
    mrfiPktRdy= FALSE;
    fAckRdy= FALSE;
    seqSend= 0;
    seqRecv= 0;

    // Initialise MRFI
    MRFI_Init();
    MRFI_WakeUp();
    MRFI_SetLogicalChannel(mrfiChannel);
    MRFI_RxOn();
    MRFI_SetRxAddrFilter(src_addr);
    MRFI_EnableRxAddrFilter();

}