raspiezo / mbed-dev

Dependents:   Nucleo_L432KC_Quadrature_Decoder_with_ADC_and_DAC

Fork of mbed-dev by mbed official

Committer:
tonnyleonard
Date:
Sat May 27 01:26:18 2017 +0000
Revision:
161:bd0311f1ad86
Parent:
153:fa9ff456f731
Testing ADC with shunt

Who changed what in which revision?

UserRevisionLine numberNew contents of line
<> 153:fa9ff456f731 1 /***************************************************************************//**
<> 153:fa9ff456f731 2 * @file rail_integration.c
<> 153:fa9ff456f731 3 * @brief Simple code to link this memory manager with a RAIL application by
<> 153:fa9ff456f731 4 * implementing the appropriate callbacks.
<> 153:fa9ff456f731 5 * @copyright Copyright 2015 Silicon Laboratories, Inc. http://www.silabs.com
<> 153:fa9ff456f731 6 ******************************************************************************/
<> 153:fa9ff456f731 7
<> 153:fa9ff456f731 8 #include <stdint.h>
<> 153:fa9ff456f731 9 #include "rail.h"
<> 153:fa9ff456f731 10 #include "buffer_pool_allocator.h"
<> 153:fa9ff456f731 11
<> 153:fa9ff456f731 12 /// Rely on the pool allocator's allocate function to get memory
<> 153:fa9ff456f731 13 void *RAILCb_AllocateMemory(uint32_t size)
<> 153:fa9ff456f731 14 {
<> 153:fa9ff456f731 15 return memoryAllocate(size);
<> 153:fa9ff456f731 16 }
<> 153:fa9ff456f731 17
<> 153:fa9ff456f731 18 /// Use the pool allocator's free function to return the memory to the pool
<> 153:fa9ff456f731 19 void RAILCb_FreeMemory(void *ptr)
<> 153:fa9ff456f731 20 {
<> 153:fa9ff456f731 21 memoryFree(ptr);
<> 153:fa9ff456f731 22 }
<> 153:fa9ff456f731 23
<> 153:fa9ff456f731 24 /// Get the memory pointer for this handle and offset into it as requested
<> 153:fa9ff456f731 25 void *RAILCb_BeginWriteMemory(void *handle,
<> 153:fa9ff456f731 26 uint32_t offset,
<> 153:fa9ff456f731 27 uint32_t *available)
<> 153:fa9ff456f731 28 {
<> 153:fa9ff456f731 29 return ((uint8_t*)memoryPtrFromHandle(handle)) + offset;
<> 153:fa9ff456f731 30 }
<> 153:fa9ff456f731 31
<> 153:fa9ff456f731 32 /// We don't need to track the completion of a memory write so do nothing
<> 153:fa9ff456f731 33 void RAILCb_EndWriteMemory(void *handle, uint32_t offset, uint32_t size)
<> 153:fa9ff456f731 34 {
<> 153:fa9ff456f731 35 }