来自中国的硬件平台
Dependents: mbed_in_china_blink_led
Fork of mbed-src by
Revision 150:49699a7d7064, committed 2014-04-04
- Comitter:
- mbed_official
- Date:
- Fri Apr 04 10:45:08 2014 +0100
- Parent:
- 149:1fb5f62b92bd
- Child:
- 151:7a600087bf72
- Commit message:
- Synchronized with git revision d4566711265f6e274f03a79a4819636519bf3a42
Full URL: https://github.com/mbedmicro/mbed/commit/d4566711265f6e274f03a79a4819636519bf3a42/
K64F - port HAL corrections, pwm clock configuration store
Changed in this revision
--- a/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/TARGET_K64F/port_api.c Thu Apr 03 11:45:06 2014 +0100 +++ b/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/TARGET_K64F/port_api.c Fri Apr 04 10:45:08 2014 +0100 @@ -46,18 +46,22 @@ } void port_dir(port_t *obj, PinDirection dir) { + uint32_t direction = gpio_hal_get_port_direction((uint32_t)obj->port); switch (dir) { case PIN_INPUT : - gpio_hal_set_port_direction((uint32_t)obj->port, kGpioDigitalInput); + direction &= ~obj->mask; + gpio_hal_set_port_direction((uint32_t)obj->port, direction); break; case PIN_OUTPUT: - gpio_hal_set_port_direction((uint32_t)obj->port, kGpioDigitalOutput); + direction |= obj->mask; + gpio_hal_set_port_direction((uint32_t)obj->port, direction); break; } } void port_write(port_t *obj, int value) { - gpio_hal_write_port_output((uint32_t)obj->port, (uint32_t)(value & obj->mask)); + uint32_t input = gpio_hal_read_port_input((uint32_t)obj->port) & ~obj->mask; + gpio_hal_write_port_output((uint32_t)obj->port, input | (uint32_t)(value & obj->mask)); } int port_read(port_t *obj) {
--- a/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/TARGET_K64F/pwmout_api.c Thu Apr 03 11:45:06 2014 +0100 +++ b/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/TARGET_K64F/pwmout_api.c Fri Apr 04 10:45:08 2014 +0100 @@ -87,9 +87,12 @@ break; } } + + pwm_clock = clkval; uint32_t channel = pwm & 0xF; uint32_t instance = pwm >> TPM_SHIFT; clock_manager_set_gate(kClockModuleFTM, instance, true); + ftm_hal_set_tof_frequency(instance, 3); ftm_hal_set_clock_ps(instance, (ftm_clock_ps_t)clkdiv); ftm_hal_set_clock_source(instance, kClock_source_FTM_SystemClk); ftm_hal_set_channel_edge_level(instance, channel, 2);