int peripheral_interface_gpio_close(peripheral_gpio_h gpio);
int peripheral_interface_gpio_set_edge_mode(peripheral_gpio_h gpio, peripheral_gpio_edge_e edge);
int peripheral_interface_gpio_set_direction(peripheral_gpio_h gpio, peripheral_gpio_direction_e direction);
-int peripheral_interface_gpio_write(peripheral_gpio_h gpio, int value);
-int peripheral_interface_gpio_read(peripheral_gpio_h gpio, int *value);
+int peripheral_interface_gpio_write(peripheral_gpio_h gpio, uint32_t value);
+int peripheral_interface_gpio_read(peripheral_gpio_h gpio, uint32_t *value);
int peripheral_interface_gpio_open_isr(peripheral_gpio_h gpio);
int peripheral_interface_gpio_close_isr(peripheral_gpio_h gpio);
int peripheral_interface_i2c_close(peripheral_i2c_h i2c);
int peripheral_interface_i2c_set_address(peripheral_i2c_h i2c, int address);
-int peripheral_interface_i2c_read(peripheral_i2c_h i2c, unsigned char *data, int length);
-int peripheral_interface_i2c_write(peripheral_i2c_h i2c, const unsigned char *data, int length);
+int peripheral_interface_i2c_read(peripheral_i2c_h i2c, uint8_t *data, uint32_t length);
+int peripheral_interface_i2c_write(peripheral_i2c_h i2c, uint8_t *data, uint32_t length);
int peripheral_interface_i2c_smbus_ioctl(peripheral_i2c_h i2c, struct i2c_smbus_ioctl_data *data);
#endif/* __PERIPHERAL_INTERFACE_I2C_H__ */
* @param[in] period pwm period
* @return On success, 0 is returned. On failure, a negative value is returned.
*/
-int peripheral_interface_pwm_set_period(peripheral_pwm_h pwm, int period);
+int peripheral_interface_pwm_set_period(peripheral_pwm_h pwm, uint32_t period);
/**
* @brief pwm_set_duty_cycle() sets the pwm duty cycle.
* @param[in] duty_cycle pwm duty cycle
* @return On success, 0 is returned. On failure, a negative value is returned.
*/
-int peripheral_interface_pwm_set_duty_cycle(peripheral_pwm_h pwm, int duty_cycle);
+int peripheral_interface_pwm_set_duty_cycle(peripheral_pwm_h pwm, uint32_t duty_cycle);
/**
* @brief pwm_set_polarity() sets the pwm polarity.
int peripheral_interface_spi_close(peripheral_spi_h spi);
int peripheral_interface_spi_set_mode(peripheral_spi_h spi, peripheral_spi_mode_e mode);
int peripheral_interface_spi_set_bit_order(peripheral_spi_h spi, peripheral_spi_bit_order_e bit_order);
-int peripheral_interface_spi_set_bits_per_word(peripheral_spi_h spi, unsigned char bits);
-int peripheral_interface_spi_set_frequency(peripheral_spi_h spi, unsigned int freq);
-int peripheral_interface_spi_read(peripheral_spi_h spi, unsigned char *rxbuf, int length);
-int peripheral_interface_spi_write(peripheral_spi_h spi, unsigned char *txbuf, int length);
-int peripheral_interface_spi_transfer(peripheral_spi_h spi, unsigned char *txbuf, unsigned char *rxbuf, int length);
+int peripheral_interface_spi_set_bits_per_word(peripheral_spi_h spi, uint8_t bits);
+int peripheral_interface_spi_set_frequency(peripheral_spi_h spi, uint32_t freq);
+int peripheral_interface_spi_read(peripheral_spi_h spi, uint8_t *rxbuf, uint32_t length);
+int peripheral_interface_spi_write(peripheral_spi_h spi, uint8_t *txbuf, uint32_t length);
+int peripheral_interface_spi_transfer(peripheral_spi_h spi, uint8_t *txbuf, uint8_t *rxbuf, uint32_t length);
#endif /* __PERIPHERAL_INTERFACE_SPI_H__ */
* @param[in] length size to read
* @return On success, 0 is returned. On failure, a negative value is returned.
*/
-int peripheral_interface_uart_read(peripheral_uart_h uart, uint8_t *buf, unsigned int length);
+int peripheral_interface_uart_read(peripheral_uart_h uart, uint8_t *buf, uint32_t length);
/**
* @brief uart_write() writes data over uart bus.
* @param[in] length size to write
* @return On success, 0 is returned. On failure, a negative value is returned.
*/
-int peripheral_interface_uart_write(peripheral_uart_h uart, uint8_t *buf, unsigned int length);
+int peripheral_interface_uart_write(peripheral_uart_h uart, uint8_t *buf, uint32_t length);
#endif /* __PERIPHERAL_INTERFACE_UART_H__ */
return 0;
}
-int peripheral_interface_gpio_write(peripheral_gpio_h gpio, int value)
+int peripheral_interface_gpio_write(peripheral_gpio_h gpio, uint32_t value)
{
int status;
return 0;
}
-int peripheral_interface_gpio_read(peripheral_gpio_h gpio, int *value)
+int peripheral_interface_gpio_read(peripheral_gpio_h gpio, uint32_t *value)
{
int len;
char gpio_buf[GPIO_BUFFER_MAX] = {0, };
return 0;
}
-int peripheral_interface_i2c_read(peripheral_i2c_h i2c, unsigned char *data, int length)
+int peripheral_interface_i2c_read(peripheral_i2c_h i2c, uint8_t *data, uint32_t length)
{
int status;
return 0;
}
-int peripheral_interface_i2c_write(peripheral_i2c_h i2c, const unsigned char *data, int length)
+int peripheral_interface_i2c_write(peripheral_i2c_h i2c, uint8_t *data, uint32_t length)
{
int status;
return 0;
}
-int peripheral_interface_pwm_set_period(peripheral_pwm_h pwm, int period)
+int peripheral_interface_pwm_set_period(peripheral_pwm_h pwm, uint32_t period)
{
int len, status;
char pwm_buf[PWM_BUF_MAX] = {0};
return 0;
}
-int peripheral_interface_pwm_set_duty_cycle(peripheral_pwm_h pwm, int duty_cycle)
+int peripheral_interface_pwm_set_duty_cycle(peripheral_pwm_h pwm, uint32_t duty_cycle)
{
int len, status;
char pwm_buf[PWM_BUF_MAX] = {0};
return 0;
}
-int peripheral_interface_spi_set_bits_per_word(peripheral_spi_h spi, unsigned char bits)
+int peripheral_interface_spi_set_bits_per_word(peripheral_spi_h spi, uint8_t bits)
{
int status;
return 0;
}
-int peripheral_interface_spi_set_frequency(peripheral_spi_h spi, unsigned int freq)
+int peripheral_interface_spi_set_frequency(peripheral_spi_h spi, uint32_t freq)
{
int status;
return 0;
}
-int peripheral_interface_spi_read(peripheral_spi_h spi, unsigned char *rxbuf, int length)
+int peripheral_interface_spi_read(peripheral_spi_h spi, uint8_t *rxbuf, uint32_t length)
{
int status;
struct spi_ioc_transfer xfer;
return 0;
}
-int peripheral_interface_spi_write(peripheral_spi_h spi, unsigned char *txbuf, int length)
+int peripheral_interface_spi_write(peripheral_spi_h spi, uint8_t *txbuf, uint32_t length)
{
int status;
struct spi_ioc_transfer xfer;
return 0;
}
-int peripheral_interface_spi_transfer(peripheral_spi_h spi, unsigned char *txbuf, unsigned char *rxbuf, int length)
+int peripheral_interface_spi_transfer(peripheral_spi_h spi, uint8_t *txbuf, uint8_t *rxbuf, uint32_t length)
{
int status;
struct spi_ioc_transfer xfer;
RETVM_IF(spi->fd < 0, -EINVAL, "Invalid fd : %d", spi->fd);
- if (!txbuf || !rxbuf || length < 0) return -EINVAL;
+ if (!txbuf || !rxbuf) return -EINVAL;
memset(&xfer, 0, sizeof(xfer));
xfer.tx_buf = (unsigned long)txbuf;
return 0;
}
-int peripheral_interface_uart_read(peripheral_uart_h uart, uint8_t *buf, unsigned int length)
+int peripheral_interface_uart_read(peripheral_uart_h uart, uint8_t *buf, uint32_t length)
{
int ret;
return ret;
}
-int peripheral_interface_uart_write(peripheral_uart_h uart, uint8_t *buf, unsigned int length)
+int peripheral_interface_uart_write(peripheral_uart_h uart, uint8_t *buf, uint32_t length)
{
int ret;