1
0
mirror of https://github.com/xtacocorex/CHIP_IO synced 2025-07-20 04:43:21 +00:00

randomness for #32 and #48. cleanup of removing the spi function in common.c/.h since it isn't chip specific

This commit is contained in:
Robert Wolterman
2017-01-28 20:05:53 +00:00
parent cb4e272a35
commit a839661c3b
3 changed files with 99 additions and 87 deletions

View File

@ -56,6 +56,7 @@ SOFTWARE.
#define BCM 11
#define CHIP 0
#define CHIPPRO 1
#define BOTH 2
// In the pins_t structure, the "base_method" field tells how
// the "gpio" field should be interpreted.
@ -68,11 +69,12 @@ typedef struct pins_t {
const char *name;
const char *altname; /* alternate name as referenced on pocketchip pin header */
const char *key;
//const char *altkey; /* alternate key for chip pro */
int gpio; /* port number to use under /sys/class/gpio */
int base_method; /* modifier for port number; see BASE_METHOD_... */
int pwm_mux_mode; /* pwm pin */
int ain; /* analog pin */
int spwm_allow; /* pin allowed for software pwm */
int sbc_type; /* which sbc pin is allowed */
} pins_t;
@ -104,7 +106,6 @@ int get_key(const char *input, char *key);
int get_pwm_key(const char *input, char *key);
int get_adc_ain(const char *key, unsigned int *ain);
int build_path(const char *partial_path, const char *prefix, char *full_path, size_t full_path_len);
int get_spi_bus_path_number(unsigned int spi);
void dyn_int_array_set(dyn_int_array_t **in_array, int i, int val, int initial_val);
int dyn_int_array_get(dyn_int_array_t **in_array, int i, int initial_val);
void dyn_int_array_delete(dyn_int_array_t **in_array);
@ -112,3 +113,4 @@ void clear_error_msg(void);
char *get_error_msg(void);
void add_error_msg(char *msg);
void toggle_debug(void);
int compute_port_pin(const char *key, int *port, int *pin);