Commit e08e7184 authored by Astro's avatar Astro
Browse files

update client.c

nix-shell -p gcc --run "python epicardium/api/genapi.py -H epicardium/epicardium.h -c client.c -s server.c"
parent e5caee7a
......@@ -87,6 +87,76 @@ int epic_read_battery_voltage(float *result)
return *(int*)_api_call_transact(epc__apistub_buffer);
}
/* Autogenerated stub for API_BATTERY_CURRENT */
int epic_read_battery_current(float *result)
{
const int epc__apistub_size = sizeof(float *);
void*epc__apistub_buffer;
epc__apistub_buffer = _api_call_start(API_BATTERY_CURRENT, epc__apistub_size);
/* TODO: Check if epc__apistub_buffer is not NULL */
*(float **)(epc__apistub_buffer + 0) = result;
return *(int*)_api_call_transact(epc__apistub_buffer);
}
/* Autogenerated stub for API_CHARGEIN_VOLTAGE */
int epic_read_chargein_voltage(float *result)
{
const int epc__apistub_size = sizeof(float *);
void*epc__apistub_buffer;
epc__apistub_buffer = _api_call_start(API_CHARGEIN_VOLTAGE, epc__apistub_size);
/* TODO: Check if epc__apistub_buffer is not NULL */
*(float **)(epc__apistub_buffer + 0) = result;
return *(int*)_api_call_transact(epc__apistub_buffer);
}
/* Autogenerated stub for API_CHARGEIN_CURRENT */
int epic_read_chargein_current(float *result)
{
const int epc__apistub_size = sizeof(float *);
void*epc__apistub_buffer;
epc__apistub_buffer = _api_call_start(API_CHARGEIN_CURRENT, epc__apistub_size);
/* TODO: Check if epc__apistub_buffer is not NULL */
*(float **)(epc__apistub_buffer + 0) = result;
return *(int*)_api_call_transact(epc__apistub_buffer);
}
/* Autogenerated stub for API_SYSTEM_VOLTAGE */
int epic_read_system_voltage(float *result)
{
const int epc__apistub_size = sizeof(float *);
void*epc__apistub_buffer;
epc__apistub_buffer = _api_call_start(API_SYSTEM_VOLTAGE, epc__apistub_size);
/* TODO: Check if epc__apistub_buffer is not NULL */
*(float **)(epc__apistub_buffer + 0) = result;
return *(int*)_api_call_transact(epc__apistub_buffer);
}
/* Autogenerated stub for API_THERMISTOR_VOLTAGE */
int epic_read_thermistor_voltage(float *result)
{
const int epc__apistub_size = sizeof(float *);
void*epc__apistub_buffer;
epc__apistub_buffer = _api_call_start(API_THERMISTOR_VOLTAGE, epc__apistub_size);
/* TODO: Check if epc__apistub_buffer is not NULL */
*(float **)(epc__apistub_buffer + 0) = result;
return *(int*)_api_call_transact(epc__apistub_buffer);
}
/* Autogenerated stub for API_UART_WRITE_STR */
void epic_uart_write_str( const char *str, intptr_t length )
{
......@@ -415,6 +485,46 @@ void epic_leds_clear_all(uint8_t r, uint8_t g, uint8_t b)
_api_call_transact(epc__apistub_buffer);
}
/* Autogenerated stub for API_BME680_INIT */
int epic_bme680_init()
{
const int epc__apistub_size = 0;
void*epc__apistub_buffer;
epc__apistub_buffer = _api_call_start(API_BME680_INIT, epc__apistub_size);
/* TODO: Check if epc__apistub_buffer is not NULL */
return *(int*)_api_call_transact(epc__apistub_buffer);
}
/* Autogenerated stub for API_BME680_DEINIT */
int epic_bme680_deinit()
{
const int epc__apistub_size = 0;
void*epc__apistub_buffer;
epc__apistub_buffer = _api_call_start(API_BME680_DEINIT, epc__apistub_size);
/* TODO: Check if epc__apistub_buffer is not NULL */
return *(int*)_api_call_transact(epc__apistub_buffer);
}
/* Autogenerated stub for API_BME680_GET_DATA */
int epic_bme680_read_sensors(struct bme680_sensor_data *data)
{
const int epc__apistub_size = sizeof(struct bme680_sensor_data *);
void*epc__apistub_buffer;
epc__apistub_buffer = _api_call_start(API_BME680_GET_DATA, epc__apistub_size);
/* TODO: Check if epc__apistub_buffer is not NULL */
*(struct bme680_sensor_data **)(epc__apistub_buffer + 0) = data;
return *(int*)_api_call_transact(epc__apistub_buffer);
}
/* Autogenerated stub for API_PERSONAL_STATE_SET */
int epic_personal_state_set(uint8_t state, _Bool persistent)
{
......@@ -472,6 +582,48 @@ int epic_stream_read(int sd, void *buf, size_t count)
return *(int*)_api_call_transact(epc__apistub_buffer);
}
/* Autogenerated stub for API_BHI160_ENABLE */
int epic_bhi160_enable_sensor( enum bhi160_sensor_type sensor_type, struct bhi160_sensor_config *config )
{
const int epc__apistub_size = sizeof(enum bhi160_sensor_type) + sizeof(struct bhi160_sensor_config *);
void*epc__apistub_buffer;
epc__apistub_buffer = _api_call_start(API_BHI160_ENABLE, epc__apistub_size);
/* TODO: Check if epc__apistub_buffer is not NULL */
*(enum bhi160_sensor_type*)(epc__apistub_buffer + 0) = sensor_type;
*(struct bhi160_sensor_config **)(epc__apistub_buffer + sizeof(enum bhi160_sensor_type)) = config;
return *(int*)_api_call_transact(epc__apistub_buffer);
}
/* Autogenerated stub for API_BHI160_DISABLE */
int epic_bhi160_disable_sensor( enum bhi160_sensor_type sensor_type )
{
const int epc__apistub_size = sizeof(enum bhi160_sensor_type);
void*epc__apistub_buffer;
epc__apistub_buffer = _api_call_start(API_BHI160_DISABLE, epc__apistub_size);
/* TODO: Check if epc__apistub_buffer is not NULL */
*(enum bhi160_sensor_type*)(epc__apistub_buffer + 0) = sensor_type;
return *(int*)_api_call_transact(epc__apistub_buffer);
}
/* Autogenerated stub for API_BHI160_DISABLE_ALL */
void epic_bhi160_disable_all_sensors()
{
const int epc__apistub_size = 0;
void*epc__apistub_buffer;
epc__apistub_buffer = _api_call_start(API_BHI160_DISABLE_ALL, epc__apistub_size);
/* TODO: Check if epc__apistub_buffer is not NULL */
_api_call_transact(epc__apistub_buffer);
}
/* Autogenerated stub for API_VIBRA_SET */
void epic_vibra_set(int status)
{
......@@ -950,6 +1102,12 @@ int epic_trng_read(uint8_t *dest, size_t size)
/* Weakly linked stubs for ISRs */
void epic_isr_bhi160_accelerometer(api_int_id_t id)
__attribute__((weak, alias("__epic_isr_default_handler")));
void epic_isr_bhi160_orientation(api_int_id_t id)
__attribute__((weak, alias("__epic_isr_default_handler")));
void epic_isr_bhi160_gyroscope(api_int_id_t id)
__attribute__((weak, alias("__epic_isr_default_handler")));
void __epic_isr_reset(api_int_id_t id)
__attribute__((weak, alias("__epic_isr_default_handler")));
void epic_isr_uart_rx(api_int_id_t id)
......@@ -981,6 +1139,15 @@ void __epic_isr_default_handler(api_int_id_t id)
void __dispatch_isr(api_int_id_t id)
{
switch (id) {
case EPIC_INT_BHI160_ACCELEROMETER:
epic_isr_bhi160_accelerometer(id);
break;
case EPIC_INT_BHI160_ORIENTATION:
epic_isr_bhi160_orientation(id);
break;
case EPIC_INT_BHI160_GYROSCOPE:
epic_isr_bhi160_gyroscope(id);
break;
case EPIC_INT_RESET:
__epic_isr_reset(id);
break;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment