示例#1
0
uint_32 _ki2c_polled_install
   (
      /* [IN] A string that identifies the device for fopen */
      char_ptr              identifier,
  
      /* [IN] The I/O init data pointer */
      KI2C_INIT_STRUCT_CPTR init_data_ptr
   )
{ /* Body */

   
#if PE_LDD_VERSION
   if (PE_PeripheralUsed((uint_32)_bsp_get_i2c_base_address(init_data_ptr->CHANNEL)))
   {
      /* IO Device used by PE Component*/
      return IO_DEVICE_EXISTS;
   }
#endif

   
   return _io_i2c_polled_install(identifier,
      (uint_32 (_CODE_PTR_)(pointer, pointer _PTR_, char_ptr))_ki2c_polled_init,
      (uint_32 (_CODE_PTR_)(pointer, pointer))_ki2c_polled_deinit,
      (int_32 (_CODE_PTR_)(pointer, char_ptr, int_32))_ki2c_polled_rx,
      (int_32 (_CODE_PTR_)(pointer, char_ptr, int_32))_ki2c_polled_tx,
      (int_32 (_CODE_PTR_)(pointer, uint_32, uint_32_ptr))_ki2c_polled_ioctl, 
      (pointer)init_data_ptr);

} /* Endbody */
示例#2
0
/*FUNCTION*-------------------------------------------------------------------
*
* Function Name    : _mcf51_swap_flash_and_reset
* Returned Value   : none
* Comments         :
*    Swap the flash adresses and restart device.
*
*END*----------------------------------------------------------------------*/
void _mcf51_swap_flash_and_reset()
{
    
    uchar_ptr ramcode_ptr = NULL;
    int_32 (*RunInRAM)( VMCF51MM_RTC_STRUCT_PTR );
    VMCF51MM_SIM_STRUCT_PTR sim_ptr = &(((VMCF51MM_STRUCT_PTR)BSP_IPSBAR)->SIM);
    
    /* Allocate space on stack to run flash command out of SRAM */
    ramcode_ptr = _mem_alloc((char*)mcf51mm_swap_flash_ram_end - (char*)mcf51mm_swap_flash_ram); 
    /* copy code to RAM buffer */
    _mem_copy((void*)mcf51mm_swap_flash_ram, ramcode_ptr, (char*)mcf51mm_swap_flash_ram_end  - (char*)mcf51mm_swap_flash_ram);
    *RunInRAM = (int_32(*)( VMCF51MM_SIM_STRUCT_PTR ))ramcode_ptr;   

    /* Run the code from RAM */
    RunInRAM( sim_ptr );
}
示例#3
0
int_32 _io_socket_install
   (
      char_ptr identifier
   )
{ /* Body */

   return _io_dev_install(identifier,
                          _io_socket_open,
                          _io_socket_close,
                          _io_socket_read,
                          _io_socket_write,
#if MQX_VERSION < 250
                          (int_32(_CODE_PTR_)(MQX_FILE_PTR, uint_32, uint_32_ptr))
#endif
                          _io_socket_ioctl,
                          NULL );
} /* Endbody */