Changeset 364 for asp3_tinet_ecnl_arm/trunk/asp3_dcre/mbed
- Timestamp:
- Feb 1, 2019, 9:57:09 PM (5 years ago)
- Location:
- asp3_tinet_ecnl_arm/trunk/asp3_dcre/mbed
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
asp3_tinet_ecnl_arm/trunk/asp3_dcre/mbed/hal/spi_api.h
r352 r364 116 116 */ 117 117 int spi_master_write(spi_t *obj, int value); 118 119 /** Write a block out in master mode and receive a value 120 * 121 * The total number of bytes sent and received will be the maximum of 122 * tx_length and rx_length. The bytes written will be padded with the 123 * value 0xff. 124 * 125 * @param[in] obj The SPI peripheral to use for sending 126 * @param[in] tx_buffer Pointer to the byte-array of data to write to the device 127 * @param[in] tx_length Number of bytes to write, may be zero 128 * @param[in] rx_buffer Pointer to the byte-array of data to read from the device 129 * @param[in] rx_length Number of bytes to read, may be zero 130 * @param[in] write_fill Default data transmitted while performing a read 131 * @returns 132 * The number of bytes written and read from the device. This is 133 * maximum of tx_length and rx_length. 134 */ 135 int spi_master_block_write(spi_t *obj, const char *tx_buffer, int tx_length, char *rx_buffer, int rx_length, char write_fill); 118 136 119 137 /** Check if a value is available to read -
asp3_tinet_ecnl_arm/trunk/asp3_dcre/mbed/platform/mbed_rtc_time.c
r352 r364 44 44 time_t __time32(time_t *timer) 45 45 #else 46 time_t time(time_t *timer)46 time_t get_time(time_t *timer) 47 47 #endif 48 48 … … 78 78 } 79 79 80 clock_t clock() {80 clock_t get_clock() { 81 81 //_mutex->lock(); 82 82 clock_t t = us_ticker_read(); -
asp3_tinet_ecnl_arm/trunk/asp3_dcre/mbed/targets/TARGET_RENESAS/TARGET_RZ_A1H/spi_api.c
r352 r364 259 259 while(!spi_tend(obj)); 260 260 return spi_read(obj); 261 } 262 263 int spi_master_block_write(spi_t *obj, const char *tx_buffer, int tx_length, 264 char *rx_buffer, int rx_length, char write_fill) { 265 int total = (tx_length > rx_length) ? tx_length : rx_length; 266 267 for (int i = 0; i < total; i++) { 268 char out = (i < tx_length) ? tx_buffer[i] : write_fill; 269 char in = spi_master_write(obj, out); 270 if (i < rx_length) { 271 rx_buffer[i] = in; 272 } 273 } 274 275 return total; 261 276 } 262 277
Note:
See TracChangeset
for help on using the changeset viewer.